Skip to main content

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.
Causes:
  • Model doesn’t exist
  • Typo in model name
  • Unsupported model
Solution:
Causes:
  • Required parameter not provided
  • Empty or null value
Solution:
  • Include all required fields: model and input
  • Ensure values are not null or empty
Causes:
  • Wrong data type for parameter
  • Invalid enum value
Solution:
  • Check parameter types in API reference
  • Use correct data types (string, number, boolean, etc.)
Causes:
  • Value outside allowed range
  • Negative value for positive-only fields
Solution:
  • Review parameter constraints
  • temperature: 0.0 - 2.0
  • top_p: 0.0 - 1.0
  • max_output_tokens: > 0

401 Unauthorized

Authentication failed or API key is invalid.
Causes:
  • API key is missing
  • API key is invalid or revoked
  • Wrong header format
Solutions:
Get a new API key from the Concentrate AI dashboard if yours is invalid.

402 Payment Required

Insufficient credits to complete the request.
Causes:
  • Account credit balance too low
  • Request would exceed credit limit
  • Free tier exhausted
Solutions:
  1. Check your balance:
    • Visit dashboard
    • View credit usage and remaining balance
  2. Add credits:
    • Purchase additional credits
    • Upgrade your plan
  3. Optimize requests:
    • Reduce max_output_tokens
    • Use cost-optimized models
    • Enable auto routing with routing: { strategy: "min", metric: "cost" }

424 Failed Dependency

The requested provider is unavailable.
Causes:
  • Provider experiencing outage
  • Model temporarily unavailable
  • Regional restrictions
Solutions:
  1. Retry with exponential backoff
  2. Specify alternative provider
Implement client-side retry logic or specify an alternative provider/model to handle provider unavailability.

429 Too Many Requests

Rate limit exceeded.
Causes:
  • Exceeded requests per minute limit
  • Too many tokens per minute
  • Burst limit exceeded
Solutions:
  1. Implement rate limiting in your code
  2. Use exponential backoff
  3. Batch requests when possible
  4. Upgrade plan for higher limits

500 Internal Server Error

Server-side error. These are rare and usually temporary.
Causes:
  • Temporary server issue
  • Unexpected error condition
  • Any provider internal error (e.g., Cloudflare server outage)
Solutions:
  1. Retry the request after a short delay
  2. If persists, contact support

Best Practices

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

Create Response

Main endpoint documentation

Auto Routing

Automatic provider/model routing

Rate Limits

Understanding rate limits

Support

Contact support for help