error field is an object with code, message and type, the shape OpenAI-compatible SDKs read, so their exceptions carry the gateway’s message.
Example error response
Fields you will always get
error: an object describing the failure:error.code: a machine-readable error code, such asvalidation_error.error.message: a plain-language explanation of what happened.error.type: the error type (see Error types).error.param: the request parameter that caused the error, when the gateway knows it, otherwisenull.error.metadata(optional): structured detail such as the failing provider, the subreason, the failed statuses orretry_after_seconds. The same values are also returned at the top level.
code: the same code aserror.code. Earlier responses returned this code string aserror; readcodeif your client expected a string there.message: the same text aserror.message.generation_id: a stable request ID you can share with support.status_code: mirrors the HTTP status code.error_type: a high-level class, usuallyuserorsystem.error_origin: whether the problem was mainly caused by the caller, Phaseo, or an upstream provider.description: a plain-language explanation of what happened.details(optional): structured validation details when the error is a request-validation problem.
Extra fields you may see
Some errors include more detail to help you fix the issue faster:reason: a more specific subreason such asall_candidates_failedorpricing_not_configured.provider_candidate_diagnosticsandprovider_enablement: explain why a model could not be used with the requested endpoint.routing_diagnostics: extra detail about how routing or availability checks narrowed the request.provider_failure_diagnostics: hints for missing credentials, missing access, region restrictions, rate limits, and similar provider-side failures.upstream_errorandfailure_sample: best-effort summaries of the first provider failure when the request reached a provider.failed_providers,failed_statuses, andattempt_count: extra retry and failover context.
Error types
error.type follows OpenAI’s documented error types and is set from the HTTP status:
Errors on
/v1/messages use the same body, so Anthropic SDKs also find error.type and error.message.
Status class guidance
Common error codes
When a provider fails
If Phaseo reached a provider but the request still failed, you may see:provider_failure_diagnostics.categoryprovider_failure_diagnostics.hintprovider_failure_diagnostics.provider
credentials_not_configuredcredentials_invalid_or_forbiddenprovider_access_missingregion_or_project_restrictionmodel_unavailable_for_endpointrate_limitedserver_error
When a model or endpoint is not available
Forunsupported_model_or_endpoint responses, Phaseo may include:
provider_candidate_diagnosticsprovider_enablementmissing_pricing_providersrouting_diagnostics
- a known model that is not active yet
- a model that does not support the endpoint you asked for
- missing pricing data
- rollout or internal availability restrictions
provider_candidate_diagnostics.totalProviders: how many providers were known for the model before endpoint filtering.provider_candidate_diagnostics.supportsEndpointCount: how many of those providers support the requested endpoint.provider_candidate_diagnostics.candidateCount: how many providers remained after adapter checks.provider_candidate_diagnostics.droppedUnsupportedEndpoint: providers dropped because they do not support the endpoint.provider_candidate_diagnostics.droppedMissingAdapter: provider/endpoint pairs dropped because there is no gateway adapter for that endpoint yet.provider_enablement.capability: the capability gate being enforced, such asvideo_generation.provider_enablement.providersBefore/provider_enablement.providersAfter: providers before and after capability or enablement filtering.provider_enablement.dropped[].reason: machine-readable reasons such aspricing_missing.routing_diagnostics.filterStages[].stage: the routing stage, for example capability, rollout, or routing-status filtering.routing_diagnostics.filterStages[].beforeCount/routing_diagnostics.filterStages[].afterCount: provider counts before and after each stage.routing_diagnostics.filterStages[].droppedProviders[].reason: machine-readable reasons such as rollout or routing restrictions.
Example
When a model is retired
A retired model is still served while any provider serves it. Once none does, requests for it fail with410 and the model_retired error:
model: the model you requested.retired_at: when the model was retired, ornullif no date is recorded.replacement_model: the suggested replacement, ornullif there is none.
models list or turn on retired model routing for the workspace. See
Model Deprecation and Retirement.
Optional debug mode
Most request schemas support adebug object for controlled troubleshooting:
enabledreturn_upstream_requestreturn_upstream_responsetracetrace_level(summaryorfull)
Retry strategy
- 400-series errors other than 429: Fix the request, credentials, or access policy before retrying.
- 429: Implement exponential backoff and honor the
Retry-Afterheader. - 500-series errors: Use bounded retries only when repeating the operation is safe. An ambiguous submission may already have created a job or incurred a charge; retrieve an accepted job instead of submitting it again.
Streaming-specific notes
- If the request fails before streaming begins, you get a standard JSON error payload.
-
If it fails mid-stream, the stream ends with the endpoint’s failure event instead of a normal finish: an
errorframe on Chat Completions,response.failed(orerror) on Responses, and anerrorevent on Messages. Treat the partial stream as incomplete and show a retry option. -
The Chat Completions
errorframe carries the same error object, witherror.typeset from the code: -
A non-streaming request whose provider fails part-way returns
502withupstream_stream_failure, not a partial response. -
Always capture
generation_idand endpoint/model metadata in logs.
Troubleshooting tips
- Check the Gateway status page for ongoing incidents.
- Review your request payload against the endpoint docs.
- Share
generation_idwhen contacting support.
Related resources
Authentication
Authenticate with bearer API keys.
Limits
Handle provider-driven throttling and retries.
Streaming
Use SSE safely in production flows.