Error Codes
API error codes and troubleshooting
All API errors follow a consistent format.
Error Response Format
Error Code Reference
| Code | Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid authentication |
INVALID_API_KEY | 401 | API key is invalid or expired |
FORBIDDEN | 403 | Access denied to this resource |
BAD_REQUEST | 400 | Malformed request |
MISSING_REQUIRED_FIELD | 400 | Required field not provided |
INVALID_MODEL | 400 | Unknown or unsupported model |
INVALID_MESSAGE_LENGTH | 400 | Message exceeds 2000 characters |
STREAMING_REQUIRED | 400 | Fight mode requires streaming |
GUARDRAIL_BLOCKED | 400 | Request blocked by guardrails (PII, content moderation) |
RATE_LIMIT_EXCEEDED | 429 | Too many requests |
MODEL_UNAVAILABLE | 503 | Model temporarily unavailable |
INTERNAL_ERROR | 500 | Server error |
Common Errors
Authentication Error
Solution: Include your API key in the Authorization header.
Invalid Model
Solution: Use a valid model ID from the available models list.
Rate Limit Exceeded
Solution: Wait for the specified retry time before making another request.
Missing Required Field
Solution: Include all required fields in your request.
Streaming Required (Fight Mode)
Solution: Remove "stream": false from your request, or set "stream": true. Fight mode only supports streaming responses.