Authentication
Calling the gateway endpoints in this documentation requires an API key. The recommended authentication method is the Authorization header.
Bearer Token
| Item | Value |
|---|---|
| Header | Authorization |
| Format | Bearer YOUR_API_KEY |
| Applies to | All public gateway endpoints |
bash
curl https://api.llmapi.site/v1/usage \
-H 'Authorization: Bearer YOUR_API_KEY'Compatible Headers
The server also accepts these headers for client compatibility:
| Header | Example |
|---|---|
Authorization | Bearer YOUR_API_KEY |
x-api-key | YOUR_API_KEY |
x-goog-api-key | YOUR_API_KEY |
Use only one authentication method per request. New integrations should use Authorization: Bearer.
API Key Types
Create an API key on the website's API Key page and bind it to the group for the platform you want to call.
| Type | Binding | Supported endpoints |
|---|---|---|
| Regular API key | General group | Text APIs, model listing, usage queries, and synchronous platform image endpoints. |
See Create API Keys for the full steps.
Authentication Failure
Interface details:
| Item | Value |
|---|---|
| HTTP status | 401 |
| Error type | authentication_error |
| Trigger | Missing, invalid, or unrecognized API key |
Response example:
json
{
"type": "error",
"error": {
"type": "authentication_error",
"message": "Invalid API key"
}
}Group and Platform Restrictions
Successful authentication does not make every endpoint available.
| Key type | Example endpoints | Restrictions |
|---|---|---|
| Regular API key / OpenAI group | /v1/responses, /v1/chat/completions, /v1/images/generations, /v1/images/edits | OpenAI-specific endpoints require an OpenAI group. |
| Regular API key / Anthropic group | /v1/messages, /v1/messages/count_tokens | OpenAI-specific image endpoints are unavailable. |
| Regular API key / Gemini group | /v1beta/models, /v1beta/models/{model}:generateContent | OpenAI-specific image endpoints are unavailable. |
When the platform or key type does not match, the endpoint may return 400, 403, or 404. See Errors for common causes and resolutions.