Authentication
All gateway endpoints require 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 |
curl https://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
When creating an API key in the console, choose a binding type:
| Type | Binding field | Supported endpoints |
|---|---|---|
| General API key | General group group_id | Text APIs, model listing, usage queries, synchronous OpenAI image endpoints, and Gemini native paths. |
| Image API key | Image batch group image_batch_group_id | Async image tasks, task retrieval, cancellation, and task events. |
The bindings are mutually exclusive. An image API key cannot bind to a general group. A general API key cannot bind to an image batch group. 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:
{
"type": "error",
"error": {
"type": "authentication_error",
"message": "Invalid API key"
}
}Group and Platform Restrictions
Successful authentication does not make every endpoint available. For general API keys, the general group determines platform capabilities. For image API keys, the image batch group determines available image models, account selection, concurrency, and pricing.
| Key type | Example endpoints | Restrictions |
|---|---|---|
| General API key / OpenAI group | /v1/responses, /v1/chat/completions, /v1/images/generations | Async image tasks require an image API key. |
| General API key / Anthropic group | /v1/messages, /v1/messages/count_tokens | OpenAI-specific image endpoints are unavailable. |
| General API key / Gemini group | /v1beta/models... | Gemini native paths require a Gemini group; async image tasks still require an image API key. |
| General API key / Antigravity group | /antigravity/v1/messages, /antigravity/v1beta/models... | Dedicated prefixes force the Antigravity account pool. |
| Image API key / image batch group | /v1/images/tasks, /v1/images/tasks/events | Only for async image tasks, not for text APIs or synchronous image endpoints. |
When the platform does not match, the endpoint may return 400, 403, or 404. See the errors page for examples.