Skip to main content

Error format

REST API errors return a JSON body with a single error object:
object
message (string, human-readable), type (string, error category), param (string or null, the offending parameter if any), code (string or null, machine-readable cause).
Handle errors by type (the stable category) and use code to distinguish causes within it.

Error types

Both rate_limit_error and insufficient_quota arrive as 429 — check error.type before retrying. A rate_limit_error recovers on its own; an insufficient_quota never does.

insufficient_quota codes

Realtime errors

The Realtime WebSocket signals problems with an error server event carrying the same type / code / message / param fields. Billing refusals use type: "insufficient_quota" and are followed by WebSocket close code 4429; invalid or expired keys close with code 3000. See the close-code table for all codes. Any other error leaves the session open. When a response fails, its response.done follows with status: "failed". A rate limit there is type: "rate_limit_error", code: "rate_limit_exceeded", and is transient like its REST counterpart: retry with response.create. See the error event for the response-failure codes.

Product-specific request errors

Report a problem

If an error persists or doesn’t match this page, report it with the full error object and a timestamp.