Overview
The Concentrate AI API uses standard HTTP status codes to indicate success or failure. All error responses include a JSON body with details about what went wrong.Error Response Format
All errors follow this structure:Status Codes
Error Types
400 Bad Request
Invalid or malformed request parameters.Invalid Model Name
Invalid Model Name
- Model doesn’t exist
- Typo in model name
- Unsupported model
- Check supported models list
- Verify spelling and format
- Use provider prefix format:
provider/model
Missing Required Fields
Missing Required Fields
- Required parameter not provided
- Empty or null value
- Include all required fields:
modelandinput - Ensure values are not null or empty
Invalid Parameter Type
Invalid Parameter Type
- Wrong data type for parameter
- Invalid enum value
- Check parameter types in API reference
- Use correct data types (string, number, boolean, etc.)
Invalid Parameter Value
Invalid Parameter Value
- Value outside allowed range
- Negative value for positive-only fields
- Review parameter constraints
temperature: 0.0 - 2.0top_p: 0.0 - 1.0max_output_tokens: > 0
401 Unauthorized
Authentication failed or API key is invalid.- API key is missing
- API key is invalid or revoked
- Wrong header format
402 Payment Required
Insufficient credits to complete the request.- Account credit balance too low
- Request would exceed credit limit
- Free tier exhausted
-
Check your balance:
- Visit dashboard
- View credit usage and remaining balance
-
Add credits:
- Purchase additional credits
- Upgrade your plan
-
Optimize requests:
- Reduce
max_output_tokens - Use cost-optimized models
- Enable auto routing with
routing: { strategy: "min", metric: "cost" }
- Reduce
424 Failed Dependency
The requested provider is unavailable.- Provider experiencing outage
- Model temporarily unavailable
- Regional restrictions
- Retry with exponential backoff
- Specify alternative provider
429 Too Many Requests
Rate limit exceeded.- Exceeded requests per minute limit
- Too many tokens per minute
- Burst limit exceeded
- Implement rate limiting in your code
- Use exponential backoff
- Batch requests when possible
- Upgrade plan for higher limits
500 Internal Server Error
Server-side error. These are rare and usually temporary.- Temporary server issue
- Unexpected error condition
- Any provider internal error (e.g., Cloudflare server outage)
- Retry the request after a short delay
- If persists, contact support
Best Practices
Implement comprehensive error handling
Implement comprehensive error handling
Log errors for debugging
Log errors for debugging
Use circuit breaker pattern
Use circuit breaker pattern
Validate before sending
Validate before sending
Error Monitoring
Track and analyze errors in production:Debugging Checklist
When encountering errors, check:- API key is valid and properly formatted
- Request payload matches schema requirements
- Parameter values are within allowed ranges
- Account has sufficient credits
- Model name is correct and supported
- Network connectivity is stable
- Timeout values are appropriate
- Error handling is implemented
- Retry logic is in place
Related Documentation
Create Response
Main endpoint documentation
Auto Routing
Automatic provider/model routing
Rate Limits
Understanding rate limits
Support
Contact support for help