Skip to main content

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 key
  • invalid_group: Invalid token group, please select a valid group
  • model_not_found: Model does not exist, check the model name
  • missing_model: Missing model parameter in the request
  • account_balance_insufficient: Insufficient account balance, please recharge
  • 404 Not Found: Path or resource not found
  • 5xx 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"
}
}