Developer guide

Error codes

Actions and retry rules by status code

This page summarises the status codes returned by the gateway, what they mean, and the action to take for each code.
If the upstream returns a 4xx or 5xx, the gateway passes that code through unchanged. Otherwise, it follows the table below.
It also describes the error body formats for the two compatible specifications, the rules for Anthropic-compatible error.type, and the console screens for checking limits and usage.

Status codes

CodeMeaningAction
400Invalid request value. The limit for the Anthropic-compatible model list is outside the range of 1–1000, or an attempt was made to resume a stored response with GET /responses/{responseId}?stream=trueCorrect the value so that it is within the permitted range. Retrieve stored responses without stream.
401The key is missing, expired or revokedCheck the key status on the API keys page, and verify the header name and Bearer prefix.
403No access to the model, usage limit exceeded, insufficient credits, or not the voice ownererror.message distinguishes the reason. Check the figures on the screens described in the Limits and usage section below.
404The model does not exist or cannot be accessed with this key (including models that are no longer supported), the path does not exist, or the CleviDrive output is more than 3 days past its retention periodFirst check the list of models available to call with GET /models. Compare the path with the table on the Making API calls page.
408 · 409 · 413Upstream timeout, congestion or request size exceeded. For voice and audio paths, the timeout is 5 minutes and the request limit is 28 MiBIf 409 includes Retry-After, wait for that amount of time. For 413, split the request into multiple parts.
429The upstream provider has applied a rate limitIf Retry-After is provided, follow it as specified. Otherwise, retry with exponential backoff.
5xxA temporary error from the gateway or upstream (including 503)Retry with exponential backoff. If the issue persists, report it to Help and Contact us with the X-Request-Id.

Retries

The gateway does not generate its own 429 responses, nor does it silently retry or queue upstream responses.
The client is responsible for waiting and retrying.

CodeWaiting timeThen
409If Retry-After is present, wait for that durationSend the same request again.
429If Retry-After is present, wait for that duration; otherwise use exponential backoffSend the same request again.
5xxExponential backoffContact us if it keeps happening.
413No waitingSplit the request.

Error body

The format of the error body differs by specification. Upstream errors are passed on in a cleaned-up form with only the message retained; stack traces and internal fields are not passed through.

The body for the OpenAI-compatible path.

{
  "error": {
    "message": "API key is required.",
    "type": "invalid_request_error"
  }
}

The body for the Anthropic-compatible path. error.type is determined by the status code.

{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "..."
  },
  "request_id": "rqid..."
}
Anthropic-compatible error.type
Status codeerror.type
400invalid_request_error
401authentication_error
403permission_error
404not_found_error
413request_too_large
429rate_limit_error
529overloaded_error
Other codesapi_error

Checking limits and usage

Limits vary by workspace. Check the reason for the 403 in error.message, then view the figures on the screens below.

What to checkConsole screen
Limits applied to my workspaceAllocated usage limits in Overview
Range allowed by the plan and balancePlan and Credits
Actual usage (calls by model and key, estimated credits deducted)Usage
Key status (whether expired or revoked)API keys
CLEVI

Language and region

Machine-translated languages are marked. Availability follows the published site bundle.

136 languages

Recommended

1

East Asia

7

Southeast Asia

11

South Asia

18

Central Asia

5

Middle East and the Caucasus

10

Western and Southern Europe

16

Britain and Ireland

4

Northern Europe and the Baltics

10

Central Europe and the Balkans

14

Eastern Europe

5

East Africa and the Horn

8

West and Central Africa

9

Southern Africa

8

The Americas

5

The Pacific

5