Skip to content

Authentication ​

Calling the gateway endpoints in this documentation requires an API key. The recommended authentication method is the Authorization header.

Bearer Token ​

ItemValue
HeaderAuthorization
FormatBearer YOUR_API_KEY
Applies toAll 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:

HeaderExample
AuthorizationBearer YOUR_API_KEY
x-api-keyYOUR_API_KEY
x-goog-api-keyYOUR_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.

TypeBindingSupported endpoints
Regular API keyGeneral groupText APIs, model listing, usage queries, and synchronous platform image endpoints.

See Create API Keys for the full steps.

Authentication Failure ​

Interface details:

ItemValue
HTTP status401
Error typeauthentication_error
TriggerMissing, 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 typeExample endpointsRestrictions
Regular API key / OpenAI group/v1/responses, /v1/chat/completions, /v1/images/generations, /v1/images/editsOpenAI-specific endpoints require an OpenAI group.
Regular API key / Anthropic group/v1/messages, /v1/messages/count_tokensOpenAI-specific image endpoints are unavailable.
Regular API key / Gemini group/v1beta/models, /v1beta/models/{model}:generateContentOpenAI-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.