Gengxi API Developer Docs
Errors
Understand public error codes and take safe recovery actions.
Error handling
Use the HTTP status, stable public error code, message, and Request ID when available. Do not parse internal provider details as a stable contract.
Error reference
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request_error | The request is malformed or unsupported. | Validate fields and content types. |
| 400 | api_key_in_query_deprecated | A query parameter was used for authentication. | Move the key to an authorization header. |
| 401 | API_KEY_REQUIRED / INVALID_API_KEY | A key is missing or invalid. | Check the header and key value. |
| 401 | API_KEY_DISABLED / USER_INACTIVE | The key or user cannot make requests. | Review account and key status. |
| 403 | API_KEY_EXPIRED | The key has expired. | Create or update a valid key. |
| 403 | INSUFFICIENT_BALANCE / ACCESS_DENIED | Balance or access policy blocks the request. | Check Usage, subscription, and group access. |
| 404 | model_not_found / not_found_error | The model or resource is unavailable. | Call GET /v1/models and verify the path. |
| 429 | API_KEY_QUOTA_EXHAUSTED / USAGE_LIMIT_EXCEEDED / rate_limit_exceeded | A quota or rate limit was reached. | Honor Retry-After and use exponential backoff. |
| 500 | INTERNAL_ERROR | An internal error occurred. | Retry safely; contact Support with the Request ID. |
| 502 | upstream_error | An upstream request failed. | Retry later with backoff. |
| 503 | service_unavailable / API_KEY_AUTH_OVERLOADED | Capacity is temporarily unavailable. | Retry later with backoff. |
Retry policy
- Retry only idempotent or safely repeatable operations.
- Honor Retry-After on 429 responses.
- Use exponential backoff with jitter for 429, 502, and 503.
- For persistent 500 errors, include the Request ID when contacting Support.