Error Response Format
All errors follow a consistent format:HTTP Status Codes
| Code | Meaning | When It Occurs |
|---|---|---|
400 | Bad Request | Invalid JSON, malformed request |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Access denied to resource |
404 | Not Found | Endpoint or prompt doesn’t exist |
422 | Validation Error | Input doesn’t match schema |
429 | Rate Limited | Too many requests |
500 | Server Error | Internal error |
502 | Bad Gateway | LLM provider error |
504 | Timeout | Request took too long |
Error Types
401 Unauthorized
x-api-keyheader is missing- API key is invalid or malformed
- API key has been revoked
403 Forbidden
- Endpoint is private/internal
- API key doesn’t have permission
404 Not Found
- Typo in endpoint path
- Endpoint was deleted
- Wrong tenant subdomain
422 Validation Error
| Error | Message | Solution |
|---|---|---|
| Missing field | ”Field ‘x’ is required” | Include the required field |
| Wrong type | ”Field ‘x’ must be a string” | Check data type |
| Out of range | ”Field ‘x’ must be between 1 and 100” | Adjust value |
| Pattern mismatch | ”Field ‘x’ must match pattern” | Fix format |
| Enum violation | ”Field ‘x’ must be one of: a, b, c” | Use allowed value |
429 Rate Limited
500 Server Error
- Note the
request_id - Retry the request (may be transient)
- Contact support with the request ID if persistent
502 Bad Gateway
- LLM provider (OpenAI, Anthropic) is down
- Provider rate limits exceeded
- Invalid provider API key in settings
504 Timeout
- Very long input text
- Complex prompt requiring extended processing
- LLM provider slowdown
- Reduce input size
- Simplify the prompt
- Increase client timeout setting
Error Handling Best Practices
Implement Exponential Backoff
Log Request IDs
Handle Specific Errors
Testing Error Handling
Test your error handling by:- Missing field — Omit a required field
- Invalid type — Send string instead of number
- Invalid key — Use a fake API key
- Rate limit — Send many rapid requests

