Errors
Handle stable problem codes and retain the request ID.
Problem documents
Errors use application/problem+json. Read code for programmatic handling, status for the HTTP status, and request_id when asking for help. Every error has charged: false. Do not depend on the wording of title or detail.
Find a code
Search for a code such as validation_failed, idempotency_conflict or insufficient_credits. The Problem schema documents the response fields and registered values. Each operation lists its possible error responses.
Credit caps on API keys
A workspace owner can give each API key a credit cap per UTC day or per UTC calendar month on the key's page in the portal. A request that would take the key past its cap fails with 402 api_key_credit_cap_reached and costs nothing. A request that costs less may still succeed. Retry-After gives the seconds until the next day or month starts, when the full cap is available again; the owner can also raise or remove the cap. Repeating an already charged request with the same Idempotency-Key still returns its result without a second charge. A key without a cap can spend the workspace's whole balance.