Error Reference
Complete reference for all API error codes.
HTTP Status Codes
| Code | Meaning | Typical Cause |
|---|---|---|
| 400 | Bad Request | Invalid parameters |
| 401 | Unauthorized | Missing/invalid API key |
| 403 | Forbidden | Policy violation |
| 404 | Not Found | Invalid endpoint |
| 429 | Too Many Requests | Rate limit exceeded |
| 503 | Service Unavailable | Capacity exhausted |
| 500 | Internal Server Error | Server-side error |
Error Codes
Authentication Errors
invalid_token
Status: 401
Meaning: API key is malformed or invalid
{ "error": "invalid_token", "message": "API key format invalid"}token_expired
Status: 401
Meaning: API key has expired
insufficient_credits
Status: 402
Meaning: Account has insufficient credits
Request Errors
invalid_prompt
Status: 400
Meaning: Prompt violates constraints
{ "error": "invalid_prompt", "message": "Prompt too long (max 5000 chars)"}invalid_parameters
Status: 400
Meaning: Request parameters invalid
unsupported_format
Status: 400
Meaning: Format not supported for model
Content Policy Errors
nsfw_detected
Status: 403
Meaning: Content policy violation detected
{ "error": "nsfw_detected", "message": "Content policy violation"}prompt_filtered
Status: 403
Meaning: Prompt triggered safety filter
Capacity Errors
capacity_exhausted
Status: 503
Meaning: Sync tier at capacity
{ "error": "capacity_exhausted", "message": "sync tier at capacity, retry in 30s", "retry_after": 30}queue_full
Status: 429
Meaning: Async queue at capacity
Rate Limit Errors
rate_limit_exceeded
Status: 429
Meaning: Too many requests
{ "error": "rate_limit_exceeded", "message": "Rate limit: 100/min", "retry_after": 15}Error Response Format
All errors follow this schema:
interface ErrorResponse { error: string; message: string; retry_after?: number; details?: Record<string, unknown>;}