Agent-Friendly Errors
Every apitree error response carries two extra fields designed for AI Agents: recovery_action tells the agent what to do next, and docs_url points to a deep link in this documentation.
Example
{
"error": "RATE_LIMIT_EXCEEDED",
"http_status": 429,
"message": "Rate limit exceeded: 60 requests per 1m on trial plan.",
"request_id": "req_abc123",
"recovery_action": "Back off for ~42s and retry (honor the Retry-After header).",
"docs_url": "https://apitree.ai/docs/errors#rate-limit"
}Covered Codes
- •
UNAUTHORIZED,FORBIDDEN,NOT_FOUND - •
INVALID_BATCH,BATCH_TOO_LARGE - •
RATE_LIMIT_EXCEEDED,PAYLOAD_TOO_LARGE - •
CIRCUIT_OPEN,PROVIDER_TIMEOUT - •
INSUFFICIENT_CREDITS,CALL_FAILED