# Get ak from ask

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask

Derives the authorization key (ak) from the spend authorization key (ask) for TRON shielded transactions.

Reference: https://www.alchemy.com/docs/chains/tron/tron-http-api-endpoints/tron-http-api-endpoints/get-ak-from-ask

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask \
  --header 'Content-Type: application/json' \
  --data '{
  "ask": "string"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({ask: 'string'})
};

fetch('https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask"

payload = { "ask": "string" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask"

	payload := strings.NewReader("{\n  \"ask\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask")
  .header("Content-Type", "application/json")
  .body("{\n  \"ask\": \"string\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getakfromask");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"ask\": \"string\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /wallet/getakfromask
method: POST
operation:
  summary: Get ak from ask
  description: Derives the authorization key (ak) from the spend authorization key (ask) for TRON shielded transactions.
  tags:
    - Tron HTTP API Endpoints
  requestBody:
    content:
      application/json:
        schema:
          type: object
          properties:
            ask:
              type: string
        example:
          ask: 11aa22bb33...
  responses:
    '200':
      description: ak key generated
      content:
        application/json:
          example:
            ak: 99ff88ee77...
```
