Errors

Error bodies follow the OpenAI envelope:

{ "error": { "message": "insufficient balance", "type": "invalid_request_error", "code": "..." } }

Status codes

CodeMeaningWhat to do
400Bad JSON or unsupported field combinationFix the body
401Missing / unknown / revoked keyMint a new key
402Insufficient balanceTop up
404Unknown path, or model_not_foundCheck /v1/models
429Host concurrency capBack off, or enable persist
502Upstream / no host / fallback failedRetry later; check Status
504 / client timeoutHost too slow or prompt too largeRaise client timeout; shrink context

Messages you will actually see

Retry policy

Retry 429 and 502 with jitter. Do not retry 401 or 402. Do not tight-loop 404 model_not_found — wait for the model to return on /v1/models.

Status vs your request

The Status page can show a model as “healthy” (shards exist) while your request still 429s. Health is inventory. 429 is a full queue.