Overview
An Error Response is returned when an API request fails. Most/v1/* endpoints return a standardized JSON error shape, but authentication and some middleware responses may use a simpler format.
What Error Responses Include:
- Human-readable error message
- Optional suggestions for resolving the issue
- Optional structured details (error code, usage/concurrency details, etc.)
- HTTP status code indicating the error type
Fields
The API may return one of these common shapes:- Standard endpoint errors
- Authentication errors
- Usage enforcement errors (minutes/concurrency)
| Field | Type | Description |
|---|---|---|
success | boolean | Present on most endpoint errors (false) |
error | object | string | Error details (object for most endpoints; string for some auth/middleware responses) |
error.message | string | Human-readable error message (when error is an object) |
error.suggestion | string | Optional suggestion for resolving the issue |
error.code | string | Optional machine-readable error code (e.g. INSUFFICIENT_MINUTES) |
error.details | object | Optional structured details (e.g. minutes/concurrency breakdown) |
Examples
Bad Request (400)
Not Found (404)
Access Denied (403)
Authentication Error (401)
Validation Error (400)
HTTP Status Codes
| Status Code | Description | When It Occurs |
|---|---|---|
400 | Bad Request | Missing required fields, invalid data format, business logic violations |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | User doesn’t have permission to access the resource |
404 | Not Found | Session, avatar, or other resource not found |
409 | Conflict | Request conflicts with current state (e.g., resource already exists) |
422 | Unprocessable Entity | Well-formed request but contains semantic errors |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Unexpected server-side error |
502 | Bad Gateway | Invalid response from upstream server |
503 | Service Unavailable | Service temporarily unavailable |
Rate Limiting
When rate limited (429 status code), you may receive headers indicating:RateLimit-Limit: Maximum number of requests allowedRateLimit-Remaining: Requests remaining in current windowRateLimit-Reset: Seconds until the window resetsRetry-After: Seconds to wait before making another request
Error Handling Best Practices
Always Check Response Status
Check both the HTTP status code and thesuccess field:
Implement Retry Logic for Rate Limits
Don’t Retry 4xx Errors
Notes
- Suggestions are optional - not all errors include them
- Success field is present on most
/v1/*endpoint responses, but authentication failures may return{ "error": "..." } - Error messages are human-readable and safe to display to users
- HTTP status codes follow standard REST conventions