{ "error": { "message": "The model 'claud-ultra' does not exist or you do not have access to it.", "type": "invalid_request_error", "code": "model_not_found", "param": "model", "request_id": "req_01J9X3Q5K7M2N8P4R6T0V2W4Y6" }}
messagestring
A human-readable description. Safe to log; never contains secrets.
typestring
The error family (see below). Use it for coarse handling such as "retry" versus "fix the request".
codestring
A stable machine-readable code. Branch on this, not on message.
paramstring
Present when the error relates to a specific request field, for example messages or model.
request_idstring
Identifies the request in Claud's logs. Include it when contacting support. Also returned in the x-request-id header on every response.
For 429 and some 503 errors a retry-after header tells you how many seconds to wait.
Errors raised by POST /v1/messages follow the Messages API convention so the Anthropic SDKs surface them correctly. The code and request_id fields are the same as above:
Schema validation failed. message names the field and the problem, e.g. messages.0.content: Required.
invalid_request
A semantic problem such as too many messages; param names the field.
context_length_exceeded
The prompt exceeds the context window for the model on your plan (pay-as-you-go and Starter accounts are capped at 128K tokens). Shorten the prompt or upgrade.
Not enough tokens to cover the worst-case cost of the request. Claud reserves an estimate up front and settles the actual cost afterwards, so a balance that looks "just enough" may still be rejected.
If a stream has already started when something fails, the HTTP status is already 200. Claud then sends an error event on the stream, followed by data: [DONE]:
Text
data: {"error":{"message":"The model provider timed out.","type":"provider_error","code":"provider_timeout","request_id":"req_..."}}data: [DONE]
Any tokens generated before the failure are billed; the reservation for the rest is released. See Streaming.