Skip to content

Errors

Error format

The gateway returns errors in the dialect of the caller’s API surface.

OpenAI-compatible error envelope

{
"error": {
"message": "Invalid API key.",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}

Anthropic-compatible error envelope

{
"type": "error",
"error": {
"type": "authentication_error",
"message": "Invalid API key."
}
}

Common errors

HTTP statusCauseResolution
401 UnauthorizedInvalid or missing API keyCheck that you are passing a valid sk-ru-… key via Authorization: Bearer or x-api-key.
402 Payment RequiredInsufficient balanceTop up your balance in the console → Billing.
400 Bad RequestUnknown model ID or malformed requestVerify the model ID against GET /v1/models. Check request body fields.
429 Too Many RequestsRate limit exceededReduce request frequency; implement exponential backoff.
502 Bad GatewayUpstream provider errorTransient error from the upstream LLM provider. Retry with backoff.
503 Service UnavailableGateway overloaded or upstream unavailableRetry with backoff.

Retrying errors

For 502 and 503 errors, implement exponential backoff with jitter. For 402 errors, top up your balance before retrying — requests will continue to fail until the balance is positive.