VarunSH

Errors

Errors use a consistent JSON envelope with a stable type and code.

json
{
  "error": {
    "message": "Token quota exceeded. Used 5,000,000 of 5,000,000 for this month.",
    "type": "quota_error",
    "code": "quota_exceeded",
    "request_id": "req_abc123"
  }
}

Status codes

StatusTypeMeaning
400invalid_request_errorMalformed request or failed validation.
401authentication_errorMissing, invalid, or expired API key.
403authorization_errorInsufficient scope or model not in your plan.
404invalid_request_errorModel not found or endpoint not enabled.
413invalid_request_errorRequest body too large.
429rate_limit_error / quota_errorRate limit or token quota exceeded.
502provider_errorUpstream provider unavailable (after failover).
504provider_errorUpstream provider timed out.
500server_errorUnexpected internal error.

Request IDs

Every response includes an x-request-id header, also present as request_id in error bodies. Include it when reporting an issue — it lets us trace the request.