> For the complete documentation index, see [llms.txt](https://doc1.antgst.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc1.antgst.com/readme/authentication.md).

# Authentication

**API Key**

ANT APIs use API keys for authentication. An API key is a token that a client provides when making API calls. The key should be sent as a request body named `authSecret`

```http
POST /user/account/balance HTTP/1.1
Host: api.antgst.com
Content-Type: application/json
{
    "authSecret": "YOUR_API_KEY"
}
```

### 📘How do I get my API Key? <a href="#api-key" id="api-key"></a>

### **old:**

Log in to ANT Dashboard > SecurityCenter>AccessKeyManage and you will find it on that page.

<figure><img src="https://4057628204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhZiLUgOBsVcntyTrc1xb%2Fuploads%2Fgit-blob-76d767cda0590adcc011fde720877f883dc0ee19%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4057628204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhZiLUgOBsVcntyTrc1xb%2Fuploads%2Fgit-blob-75e4730af18ec6ab2686b87961f5742069786288%2Fimage%20(1).png?alt=media" alt=""><figcaption><p>click</p></figcaption></figure>

### new:

<figure><img src="https://4057628204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhZiLUgOBsVcntyTrc1xb%2Fuploads%2Fgit-blob-13d75764958ca92df9795cfbffe0c7b505f45ecf%2Fimage%20(3).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4057628204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhZiLUgOBsVcntyTrc1xb%2Fuploads%2Fgit-blob-c5dfd25bdb89e858b976e8cd12d4aa150f59d4a4%2Fimage%20(4).png?alt=media" alt=""><figcaption></figcaption></figure>

### Test with cURL

[cURL](https://curl.se/) is a command-line tool and library for transferring data with URLs. Here is an example of how to retrieve your account balance authenticated with your API key:

```shell
curl --location --request POST 'https://api.antgst.com/user/account/balance' 
--header 'Content-Type: application/json' 
--data '{"authSecret": "YOUR_API_KEY"}'
```

It returns a response with HTTP status `200` if succeeded. Here is an example of the response body:

```json
{
    "msg": "SUCCESS",
    "code": 200,
    "result": {
        "smsBalance": -18.383,
        "voipBalance": 0.0,
        "currency": "CNY"
    }
}
```

Otherwise, if the API key is invalid. Here is an example of the response body:

```json
{
    "msg": "auth secret error!",
    "code": -22
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc1.antgst.com/readme/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
