← Documentation

Error codes

Every error the API returns: the HTTP code, the type field, what it means and what to try first.

Anthropic · /v1/messages
{"type": "error", "error": {"type": "rate_limit_error", "message": "…"}}
OpenAI · /v1/chat/completions, /v1/responses
{"error": {"type": "rate_limit_error", "message": "…"}}

Errors come back in the format of the API you called. An error before generation starts costs nothing; you pay only for tokens actually generated.

401
authentication_error

Invalid or revoked key

The request has no API key, the key is mistyped, or it has been revoked.

Try first: Copy the key again from the dashboard and send it as x-api-key or Authorization: Bearer. If it was revoked, get a new key in your dashboard.
402
insufficient_quota

Not enough tokens

The balance is used up, or it does not cover the largest possible cost of this request. The cost is estimated from the input and max_tokens before the request starts. Context the previous request already cached (same model, within the cache window) is estimated at the cache-read rate. A refused request appears in History with a charge of 0.

Try first: Top up the balance on the Overview page. If some tokens are left, lower max_tokens so the estimate fits.
429
rate_limit_error

Too many requests at once

This key already has the maximum number of requests in progress. The response carries Retry-After: 1.

Try first: Wait for running requests to finish and retry. Lower the number of parallel agents or threads in your client.
429
rate_limit_error

Low balance — request waited

This is not an outage and not a mistake on your side. The balance left is already reserved for your other requests that are still running, so this one waited up to 20 seconds for them to finish. The message starts with “Low balance:” (on the free plan: “Free plan limit:”) and shows the balance left and how many requests are running. A refused request appears in History with a charge of 0.

Try first: Retry in a few seconds — it goes through once the running requests finish. Top up on the Overview page to send more requests at once.
402 / 403 / 429
Free plan limit

Free plan limit

This is not an error. The key runs on free starter tokens, and free plan limits apply: requests per minute, requests at a time, available models, no images or video, and the free tokens themselves. The message starts with “Free plan limit:” and says what was reached. A refused request appears in History with a charge of 0.

Try first: Buy tokens on the Overview page — the free plan limits are removed as soon as the purchase is credited.
529
overloaded_error

Service busy

The service is under heavy load right now and could not take this request. You are not charged.

Try first: Retry in 30–60 seconds with a growing pause. If it lasts more than a few minutes, write to support.
400
invalid_request_error

Invalid request

The body is not a JSON object, or a parameter is wrong or not accepted for this model. The message field says what exactly.

Try first: Read the message and check the model id and parameters. Newer Sonnet and Opus reject temperature and top_p sent together.
400
invalid_request_error

Feature not available for this key

This request uses a feature that is not available for your key — usually tools (tool_use), attachments or count_tokens.

Try first: Send the request without tools or attachments, try a different model, or skip count_tokens. If you need tools, contact support in your dashboard.
404
not_found_error

Unknown endpoint or model

The path does not exist, or the model id is not available.

Try first: Check the base URL (with or without /v1, see Connect) and take the model id from GET /v1/models.
413
request_too_large

Request too large

The body is larger than 64 MB, or it is too large for the model. Large images and long chat history are the usual cause.

Try first: Shrink or drop images and trim old messages, then send again.
500
api_error

Stream interrupted

A streaming answer started, but it was cut off before the final event. History records it as 500. Only the tokens generated before the break are charged.

Try first: Send the request again. If it keeps breaking on long answers, lower max_tokens.
501
not_implemented

Endpoint not available

/v1/images/generations is not served through the API.

Try first: Generate images on the Images page of the dashboard.
5xx
api_error

Temporary server error

Something went wrong on our side. A request that fails this way costs nothing.

Try first: Retry after a short pause. If every request fails, write to support.