Errors

On failure the gateway returns a non-2xx HTTP status code with a unified error body. The message usually ends with a request id to help you locate the entry in the console logs.

Error Structure

{
  "error": {
    "code": "",
    "message": "Error description (request id: 2026053012xxxx)",
    "type": "new_api_error"
  }
}

type indicates the source of the error: the gateway itself, or a passthrough from an upstream provider.

Error Types

typeMeaning
new_api_errorError from the gateway itself (auth, balance, rate limit, parameters, etc.)
upstream_errorError returned by an upstream provider (wrapped passthrough)
openai_errorError from an OpenAI-protocol upstream
claude_errorError from a Claude-protocol upstream
gemini_errorError from a Gemini-protocol upstream
midjourney_errorMidjourney task error

HTTP Status Codes

StatusMeaningTroubleshooting
400Bad requestCheck the JSON structure, required fields, and whether model is correct
401Unauthenticated / invalid keyCheck the auth header and key; confirm it has not been deleted
403ForbiddenThe key cannot access this model or group; confirm the model is in range
429Rate limited or insufficient balanceLower concurrency, retry later, or check your balance
500Internal server errorContact support with the request id
503Upstream unavailableUpstream is temporarily unavailable; retry is recommended

Retry Guidance

Idempotency and Backoff

For 429 / 500 / 503, use exponential backoff. 400 / 401 / 403 are client errors — retrying will not help, so fix the request first.