API Reference

Errors

Stable machine-readable HTTP status codes and retry behavior.

Error envelope

{ "error": { "code": "invalid_api_key", "message": "This API key is not valid or has been revoked." } }

Error codes

StatusCodeRetry?Action
400invalid_jsonNoSend valid UTF-8 JSON.
401missing_api_keyNoAdd Authorization: Bearer mk_... header.
401invalid_api_keyNoVerify key format (48 chars) or mint a new key.
402insufficient_creditNoTop up credit under Billing.
402spend_cap_reachedNoRaise monthly cap under Billing.
403missing_scopeNoUse a key with search:read.
404corpus_not_foundNoCheck the corpus slug or create it first.
422invalid_requestNoFix the field named in error.message.
429rate_limitedYesBack off for Retry-After seconds.
502inference_errorYesTransient inference error; retry with exponential backoff.