HTTP Status Codes#
| Status Code | Meaning | Recommended Action |
|---|
| 200 | Success | -- |
| 400 | Bad Request | Check JSON format and ensure all required parameters are present |
| 401 | Authentication Failed | Verify that your API Key is correct and has not expired or been disabled |
| 403 | Forbidden | This key may not be authorized to access the requested model |
| 429 | Rate Limit Exceeded | Reduce request frequency, or contact support to increase your RPM quota |
| 500 | Internal Server Error | Retry the request; if the issue persists, submit a support ticket |
| 502/503 | Upstream Service Unavailable | Wait and retry; consider switching to an alternative model |
{
"error": {
"message": "Invalid API key provided: sk-nex-xxx...xxx.",
"type": "authentication_error",
"code": "invalid_api_key"
}
}
Common Errors and Solutions#
invalid_api_key#
Cause: The API Key is incorrect or has been deleted.Solution: Go to the console to verify the key status and re-copy the full key.model_not_found#
Cause: The model ID is misspelled, or the model is not enabled for your plan.Solution: Check the model ID for correctness (model IDs are case-sensitive). Query the /v1/models endpoint to retrieve the full list of available models.rate_limit_exceeded#
Cause: Request frequency has exceeded the RPM (requests per minute) quota.Solution: Reduce request frequency and increase the interval between requests. Contact support if you need a higher quota.context_length_exceeded#
This model's maximum context length is xxx tokens
Cause: The combined input and output token count exceeds the model's context limit.Solution: Reduce the input length or lower the max_tokens parameter.Retry Strategy#
For 429 and 5xx errors, we recommend exponential backoff:Modified at 2026-04-04 15:55:30