Error Codes
AnyPath gateway public error codes and HTTP statuses
Every AnyPath gateway error response uses the same envelope:
{
"error": {
"message": "Human-readable error description",
"type": "error_code",
"code": "error_code",
"param": "parameter_name"
}
}
At runtime the type field is always identical to code (both carry the
canonical error code). The error_type column below is a documentation-only
grouping; it never appears as the value of the JSON type field.
The code values below are the complete public registry.
| Code | HTTP | error_type (grouping) | Default message |
|---|---|---|---|
auth_required | 401 | authentication | Authentication required. Provide a valid API key in the Authorization header. |
auth_invalid | 401 | authentication | Invalid API key. |
auth_expired | 401 | authentication | API key has expired. |
forbidden | 403 | authorization | You do not have permission to perform this action. |
spending_limit_exceeded | 403 | authorization | API key spending limit exceeded. |
rate_limit_exceeded | 429 | rate_limit | Rate limit exceeded. Please retry after the period indicated in the Retry-After header. |
supplier_rate_limited | 429 | rate_limit | The suppliers of this model are at their rate limits right now. Please retry after the period indicated in the Retry-After header. |
invalid_request | 400 | invalid_request | The request was malformed or contained invalid data. |
validation_error | 400 | invalid_request | Request body failed validation. |
unsupported_request_field | 400 | invalid_request | The selected provider route does not support one or more request fields. |
invalid_argument | 400 | invalid_request | One or more arguments are invalid. |
request_too_large | 413 | invalid_request | Request body exceeds the maximum allowed size. |
invalid_content_type | 415 | invalid_request | Unsupported Content-Type header. |
model_not_found | 404 | not_found | The requested model does not exist or is not available. |
model_unavailable | 503 | provider | The requested model is temporarily unavailable. |
not_found | 404 | not_found | The requested resource was not found. |
provider_error | 502 | provider | Upstream provider returned an error. |
provider_timeout | 504 | provider | Upstream provider request timed out. |
provider_circuit_open | 503 | provider | Circuit breaker is open for the target provider. Requests are temporarily blocked. |
internal_error | 500 | server | An internal server error occurred. |
gateway_timeout | 504 | server | The request timed out. |
not_implemented | 501 | server | This feature or endpoint is not yet implemented. |
Do not depend on non-registry hint fields. Client logic should branch on HTTP status and error.code; use headers such as Retry-After when present.