codeis stable and machine-readable. Branch on it.messageis for people and may be reworded. Do not parse it.
Error codes
These codes will not be renamed within
v1.
The monthly answer limit
Two different refusals arrive as429, and they need different handling. Branch on code, not on the status.
rate_limit_exceededmeans too many requests in the last minute. Wait forRetry-After, then retry.quota_exceededmeans your organisation has used its monthly answer allowance. Retrying does not help:Retry-Afteris the number of seconds until the next calendar month begins, which can be weeks.
ask_assistant MCP tool. The refusal comes before the question is stored and before any model is called, and for a streaming request it arrives as a 429 status, not as an event on an open stream. Read Get answer allowance to see how close you are before you reach it.
Email, invitations and password reset
Sending an invitation, re-sending one and asking for a password reset all send email, so they can fail in ways other requests cannot.
The
503 arrives before anything is written, so no invitation is created that nobody could receive.
Not found, not forbidden
A404 means “no such resource that you can see”. A resource in another organisation returns the same 404 as one that does not exist, so identifiers cannot be used to discover what exists elsewhere.
A request to a path or method that does not exist at all is answered by the web server’s own 404 or 405, which may not have a JSON body.
Common conflicts
Errors during streaming
Once a stream has started, the HTTP status is already200. A failure after that point arrives as a final answer.error event carrying the same code and message. Always read the final event. See Streaming.
Retrying safely
- Retry only
429,500,502and503, with exponential backoff and jitter. Do not retry a429whosecodeisquota_exceeded. - Honour
Retry-Afterwhen present; it is omitted when no wait is known. - When retrying a question, send the same
idempotency_keyso a request that actually succeeded is not asked, and paid for, twice.