Documentation
Error Codes Reference
Comprehensive reference for API error codes and how to handle them
Error Response Format
All API errors follow a consistent JSON format with an error code, message, and optional details for debugging.
Standard Error Format
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid request parameters", "details": { "field": "limit", "issue": "Must be between 1 and 100" } }, "request_id": "550e8400-e29b-41d4-a716-446655440000"}Always include the request_id when contacting support for faster debugging.
HTTP Status Codes
200OKRequest succeeded
201CreatedResource created successfully
204No ContentRequest succeeded, no content to return (typically for DELETE)
400Bad RequestInvalid request syntax or parameters
401UnauthorizedMissing or invalid API key
403ForbiddenValid API key but insufficient permissions or scope
404Not FoundResource does not exist or you don't have access
409ConflictResource already exists (e.g., duplicate upload)
402Payment RequiredSubscription is past due or payment required
422Unprocessable EntityRequest is well-formed but contains validation errors or violates business rules
429Too Many RequestsRate limit exceeded. Check Retry-After header.
500Internal Server ErrorServer error. Retry with exponential backoff.
503Service UnavailableAI provider error or upstream service failure
503Service UnavailableTemporary overload. Retry after a short delay.
Application Error Codes
Authentication Errors
INVALID_API_KEYThe API key provided is invalid or malformed
Solution: Check that you're using a valid API key from your dashboard
EXPIRED_API_KEYThe API key has expired
Solution: Generate a new API key from your dashboard
DEACTIVATED_API_KEYThe API key has been deactivated
Solution: Generate a new API key from your dashboard
AUTHZ_ERRORAPI key lacks required authorization for this operation
Solution: Create a new API key with the required scope
Upload Errors
HTTP_413File exceeds maximum size limit or storage quota exceeded
Solution: Reduce file size or use chunked upload for videos. Check the message for details.
CHUNK_UPLOAD_ERRORVideo chunk upload failed (invalid chunk number, size, or parameters)
Solution: Verify chunk boundaries and retry using the retry endpoint
MEMORY_LIMIT_EXCEEDEDServer is temporarily overloaded with concurrent uploads
Solution: Wait for current uploads to complete before starting new ones. Check Retry-After header.
Quota Errors
STORAGE_QUOTA_EXCEEDEDAccount storage limit reached
Solution: Delete unused files or upgrade your plan
RATE_LIMIT_ERRORToo many API requests in the time window
Solution: Implement exponential backoff and respect Retry-After
USAGE_LIMIT_EXCEEDEDMonthly API call or processing limit reached
Solution: Wait for next billing cycle or upgrade plan
CONCURRENT_UPLOAD_LIMIT_EXCEEDEDMaximum concurrent operations reached
Solution: Wait for current operations to complete
Processing Errors
IMAGE_PROCESSING_ERRORImage processing or analysis failed
Solution: Check file integrity and try re-uploading
VLM_PROVIDER_ERRORAI vision provider encountered an error during analysis
Solution: Retry the request. If the error persists, the provider may be temporarily unavailable.
TIMEOUTOperation timed out
Solution: Retry with smaller batch size or simpler query
Error Handling Best Practices
import requestsimport timeimport random
def api_request_with_retry(method, url, max_retries=3, **kwargs): """Make API request with exponential backoff.""" for attempt in range(max_retries): response = requests.request(method, url, **kwargs)
if response.status_code == 200: return response.json()
if response.status_code == 429: # Rate limited - use Retry-After header retry_after = int(response.headers.get('Retry-After', 5)) print(f"Rate limited. Waiting {retry_after}s...") time.sleep(retry_after) continue
if response.status_code >= 500: # Server error - exponential backoff wait_time = (2 ** attempt) + (random.random() * 0.5) print(f"Server error. Retrying in {wait_time:.1f}s...") time.sleep(wait_time) continue
# Client error - don't retry data = response.json() error = data.get('error', {}) raise APIError( code=error.get('code'), message=error.get('message'), request_id=data.get('request_id') )
raise MaxRetriesExceeded(f"Failed after {max_retries} attempts")