Error Codes & Retry
Errors are returned in a unified format with HTTP status codes and error payloads. You should handle different error types appropriately.
Common Errors
invalid_api_key: Invalid API keyinvalid_group: Invalid token group, please select a valid groupmodel_not_found: Model does not exist, check the model namemissing_model: Missingmodelparameter in the requestaccount_balance_insufficient: Insufficient account balance, please recharge404 Not Found: Path or resource not found5xx Server Error: Server-side error, safe to retry (idempotent operations)
Retry Recommendations
- Set a maximum retry count and an overall timeout for the request
- Log request IDs and response times for troubleshooting and analysis
Error Response Example
{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key",
"type": "invalid_request_error"
}
}