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.

Product-specific request errors