Overview
This reference covers all error types returned by the Adaptive API. Adaptive provides detailed, structured error responses to help you diagnose and resolve issues quickly. Key Features:- Type-safe errors with consistent JSON structure
- Provider failure insights for fallback scenarios
- Request tracking with unique request IDs
- Recovery guidance for each error type
Quick Reference
| Error Type | HTTP Code | Description | Recovery Strategy |
|---|---|---|---|
authentication_error | 401 | Invalid or missing API key | Check API key and headers |
invalid_request_error | 400 | Malformed request | Validate request format |
fallback_failed | 503 | All providers failed | Retry with backoff |
model_registry_error | 404/503 | Model lookup failed | Check model identifier |
model_router_error | 503 | Intelligent routing failed | Retry or use specific model |
provider_failure | 503 | Individual provider error | Check provider status |
Error Response Structure
All Adaptive errors follow this consistent JSON structure:type: Error category (see table above)message: Human-readable descriptiondetails: Error-specific information (optional)
Authentication Errors (401)
Invalid API Key
Error Response:- Incorrect API key
- Missing or malformed authorization header
- Expired or revoked key
- Verify your API key from the Adaptive dashboard
- Check header format:
Validation Errors (400)
Invalid Request Format
Error Response:- Missing required fields
- Invalid JSON structure
- Unsupported parameter values
- Model identifier format issues
Fallback Errors (503) ⭐ Unique to Adaptive
Adaptive’s Signature Feature: When intelligent routing exhausts all provider options, you get detailed failure insights from every provider attempt.
Overview
Fallback errors occur when Adaptive’s intelligent routing tries all available providers but none succeed. This provides unprecedented visibility into multi-provider failures. Key Benefits:- See exactly which providers failed and why
- Understand if it’s a widespread outage or isolated issues
- Make informed retry decisions based on failure patterns
Sequential vs Race Mode
Adaptive supports two fallback modes:- Sequential: Try providers one by one until success
- Race: Try all providers simultaneously, return first success
Error Response Structure
Provider Failure Details
Each failure in thefailures array contains:
provider: Provider name ("openai","anthropic","google")model: Specific model that was attemptederror: Provider’s error messageduration_ms: How long the request took (performance insight)
Recovery Strategies
🔄 All Rate Limits (429)
🔄 All Rate Limits (429)
Pattern: All failures show rate limitingStrategy:
- Implement exponential backoff: 1s → 2s → 4s → 8s
- Consider request queuing
- Check your rate limit tier
⚡ Mixed Provider Errors
⚡ Mixed Provider Errors
Pattern: Different errors from different providersStrategy:
- Retry immediately (may be transient)
- Check status page for outages
- Consider degraded mode operation
⏱️ High Latency Failures
⏱️ High Latency Failures
Pattern:
duration_ms > 5000 for multiple providersStrategy:- Check network connectivity
- Consider timeout adjustments
- Use race mode for faster failures
Model Registry Errors (404/503)
Model Not Found
Error Response:- Invalid model identifier
- Model not available in your region
- Model temporarily disabled
- Check available models:
GET /v1/models - Use empty string
""for intelligent routing - Verify model name spelling
Model Router Errors (503)
Routing Failure
Error Response:- All models filtered out by routing logic
- Complex prompt that doesn’t match any model
- Routing service temporarily unavailable
- Specify a model explicitly instead of using
"" - Simplify your prompt if using intelligent routing
- Retry with backoff
Provider-Specific Errors
Pass-Through Errors
When a specific provider returns an error, Adaptive passes it through with additional context:- OpenAI: Rate limits, content policy violations, token limits
- Anthropic: Rate limits, context length exceeded
- Google: Quota exceeded, safety filters
Troubleshooting Guide
By HTTP Status Code
401 Unauthorized
401 Unauthorized
400 Bad Request
400 Bad Request
Check:
- JSON is valid and properly formatted
- Required fields are present
- Parameter values are within limits
- Model identifier is correct
404 Not Found
404 Not Found
Check:
- Endpoint URL is correct
- Model exists (GET /v1/models)
- Method is correct (POST vs GET)
503 Service Unavailable
503 Service Unavailable
By Symptom
Requests work sometimes but fail others
Requests work sometimes but fail others
Likely causes:
- Rate limiting (check usage dashboard)
- Provider-specific outages
- Network issues
All requests fail immediately
All requests fail immediately
Likely causes:
- Authentication issues
- Invalid request format
- Service outage
Requests take very long then fail
Requests take very long then fail
Likely causes:
- Network connectivity issues
- Provider timeouts
- High server load
duration_ms in error detailsBest Practices
Error Handling Patterns
- Always catch errors - Never let them crash your application
- Log request IDs - Essential for support investigations
- Implement retries - With exponential backoff for transient errors
- Monitor error rates - Set up alerts for increased failure rates
Production Checklist
- Implement comprehensive error handling
- Add request ID logging
- Set up retry logic with backoff
- Monitor error rates and alert thresholds
- Test failure scenarios in development
- Document error handling in your codebase



