Errors
All errors share a single envelope shape. The HTTP status code + the error.code field together tell you what to do next.
{
"error": {
"code": "insufficient_credits",
"message": "Account balance is insufficient for this request.",
"type": "billing_error",
"param": null,
"x_relayx": { "request_id": "rx_chat_abcdef..." }
}
}| Code | HTTP | When you see this | What to do |
|---|---|---|---|
missing_api_key | 401 | No Authorization header on the request | Add Authorization: Bearer rx_live_… |
invalid_api_key | 401 | Key is revoked, expired, or never existed | Create a new key from /dashboard/keys |
insufficient_credits | 402 | Account balance can’t cover this request | Top up your balance, then retry |
key_cap_reached | 402 | This specific key has hit its per-key spend ceiling | Raise the cap on the key, or use a different key |
rate_limited | 429 | You exceeded the per-key request quota | Back off (Retry-After header) and resend |
upstream_capacity | 429 | Upstream provider is at concurrency / rate-limit cap | Honor the Retry-After header and resend |
unsupported_model | 400 | Model id is not in the RelayX catalog | GET /v1/models to list valid ids |
invalid_request | 400 | Body shape, params, or headers failed validation | Check error.message for the specific field |
internal_error | 500 | Upstream provider failed or RelayX hit a bug | Retry; if persistent, report with x_relayx.request_id |