Errors
The error envelope
Every JSON error uses one shape. The HTTP status carries the class. The code carries the reason.
The envelope is the same on every model endpoint: the eight decision-machine-1 capabilities, the OpenAI-compatible endpoints and rakeaudio.
A wrong method or an unrouted path returns 404 with the code unknown_route. A GET on a model path hits this case. The API checks the key first, so a request without a key gets 401 instead.
Codes
The spec declares 502 and 529 on the eight capability endpoints. It declares 529, but not 502, on POST /v1/chat/completions.
Validation messages
invalid_request reports the first three validation issues. Each issue reads path: message. The issues join with ; , and the path is body when the rule covers the whole object.
The message body: provide text, texts or image also appears when you send none of the three fields. All eight capabilities need exactly one of text, texts or image.
OpenAI-compatible errors
The facade rejects requests it cannot map to a capability.
A wrong id on GET /v1/models/{id} returns a shorter message.
Which errors you retry
Only 429 rate_limit_exceeded carries retry-after. A 429 insufficient_quota requires a credit balance change, not a timed retry.
Use exponential backoff with jitter on 502 and 529. Honour retry-after on 429. Cap the attempts at three. Treat 529 as backpressure, not as a fault. Lower your concurrency when you see it often.
Retry code
The examples below retry 502 and 529 only, and give up after three attempts.
Authentication and rate-limit errors
Both authentication failures return 401:
A rate-limit breach returns 429. The message names the limit, requests or tokens:
Read retry-after on 429 rate_limit_exceeded. It gives the wait in seconds. Limits and rate limits documents the x-ratelimit-* headers that let you stay below the limit.
Next
- Authentication covers the key format and the 401 codes.
- Limits and rate limits lists every field limit that raises
invalid_request. - Input shows how to shape
textandtextscorrectly. - Extract documents the schema rules behind
invalid_schema.