| Status Code | Meaning | Handling Suggestion |
|---|---|---|
| 200 | Success | Process the response normally |
| 400 | Request parameter error | Check the request body format and required parameters |
| 401 | Authentication failed | Check whether the API Key is correct |
| 402 | Insufficient quota | Top up or switch to a Key with quota |
| 403 | No permission | The Key does not have access to this model or interface |
| 404 | Interface does not exist | Check whether the request path is correct |
| 429 | Request rate limit exceeded | Lower the request rate, or contact the administrator to increase the limit |
| 500 | Server internal error | Retry later; contact operations if it persists |
| 502 | Gateway error | Upstream service exception, retry later |
| 503 | Service unavailable | Service is temporarily overloaded, retry later |
{
"error": {
"message": "Specific error description",
"type": "Error type",
"code": "Error code"
}
}| code | Meaning | Trigger Scenario |
|---|---|---|
invalid_api_key | Invalid API Key | Key is incorrect, deleted, or disabled |
insufficient_quota | Insufficient quota | Key balance is exhausted |
model_not_found | Model does not exist | An invalid model parameter was passed |
context_length_exceeded | Input too long | The total length of messages exceeds the model's context window |
rate_limit_exceeded | Rate limit exceeded | Too many requests in a short period |
invalid_request_error | Request format error | Missing required parameters, incorrect types, etc. |
server_error | Server error | Internal exception, usually recoverable by retry |