Documentation Index
Fetch the complete documentation index at: https://docs.akool.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
OpenAPI supports two authentication methods. We recommend using the direct API key method for simplicity and better security.Method 1: Direct API Key (Recommended)
The simplest way to authenticate is by using your API Key directly. Get your API Key from our API interfaces by clicking on the top API button on this page openAPI. Note: In the frontend interface, this is displayed as “API Key”, but in code implementation, it’s the same value as your previous clientSecret.- Login to our website
- Click API icon
- Click “API Credentials” to generate your API Key
- Use the API Key directly in your requests
Method 2: ClientId/API Key (clientSecret) - Legacy Method
For backward compatibility, we also support the traditional clientId/clientSecret method: Note: Your API Key (displayed in frontend) is the same value as your previous clientSecret. In code, you can reference it as either clientSecret or use the x-api-key header format.- Login to our website
- Click API icon
- Click “API Credentials” to set your key pair (clientId, API Key)
- Use the clientId/API Key to obtain an access token via the
/getTokenendpoint - Use the obtained token in subsequent API calls
API
Using Direct API Key (Recommended)
When using the direct API Key method, you can include your API Key in the HTTP headers using either format: Custom x-api-key headerGet Token (Legacy Method)
| Parameter | Description |
|---|---|
| clientId | Used for request creation authorization |
| clientSecret | Used for request creation authorization (same value as your API Key) |
| Parameter | Value | Description |
|---|---|---|
| code | 1000 | Interface returns business status code(1000:success) |
| token | API token |
Please note that the generated token is valid for more than 1 year.
Example
Direct API Key Usage (Recommended)
Using x-api-key headerLegacy Token Generation Method
Body Please note that if the value of the response code is not equal to 1000, the request is failed or wrong
| Parameter | Value | Description |
|---|---|---|
| code | 1000 | Success |
| code | 1101 | Invalid authorization or The request token has expired |
| code | 1102 | Authorization cannot be empty |
| code | 1200 | The account has been banned |