Skip to content
docs

Errors

The error format depends on the endpoint: /v1/chat/completions responds in OpenAI style, /v1/messages in Anthropic style, and /v1/responses in Responses style. The HTTP status and the machine-readable code error.code are the same on all three.

Chat Completions (OpenAI): an error object with the fields code, message, and extra. extra holds the details of the rejection, if there are any.

{ "error": { "code": "model_not_found", "message": "Model 'nope/nope' is not available. Check the model name and try again.", "extra": {} } }

/v1/embeddings and /v1/systemone respond in the same format.

Messages (Anthropic): an object with type: "error" and a nested error with the fields type, code, and message. The Anthropic error type is coarse, with several causes mapped to one type, so it comes with a code that has the same value as in the OpenAI format. The details of the rejection, if there are any, are in details.

{ "type": "error", "error": { "type": "not_found_error", "code": "model_not_found", "message": "Model 'nope/nope' is not available. Check the model name and try again." } }

Responses: an error object with the fields type, code, and message, plus the optional param and details. details holds the same details as extra in the OpenAI format.

{ "error": { "type": "not_found_error", "code": "model_not_found", "message": "Model 'nope/nope' is not available. Check the model name and try again." } }

An API key rejection on /v1/chat/completions and /v1/messages comes in a different, short form; see unauthorized.

HTTPcodeWhen
400invalid_model, feature_not_supported, provider_bad_requestThe request is invalid, or the requested feature is not supported
400model_endpoint_mismatchThe endpoint does not serve this model’s class, see Model classes
400invalid_output_modalitiesUnknown output_modalities value in GET /v1/models
400provider_context_length_exceededThe input does not fit in the model’s context window
400dlp_multi_choice_unsupportedn is greater than 1 in a request with DLP
401authentication_required, invalid_api_keyNo API key, or the key is not valid. On /v1/chat/completions and /v1/messages the response has no code, see unauthorized
402insufficient_fundsNot enough funds for the request
403policy_violationThe request is blocked by an access policy
403dlp_violationThe request is blocked by DLP, see Plugins
403provider_forbiddenThe model’s provider refused the request because of its content
404model_not_foundThe model is not in the catalog
408provider_timeoutThe model did not respond in time
413payload_too_large, file_too_large, text_content_too_largeThe body, an attachment, or the text is too large, see Limits
413provider_payload_too_largeThe provider’s limit for this model is lower than ours, and the request did not fit in it
422validation_errorThe request failed validation (for example, model is not in the <provider>/<model> format)
429provider_rate_limitedThe model limited the request rate
429api_key_limit_exceededThe key’s spending limit is reached. The time the counter resets is in extra.reset_at
500, 502, 503internal_service_errorAn error on our side
502provider_unavailable, provider_model_downThe model is temporarily unavailable
503service_unavailableThe router is under load. The retry interval is in the Retry-After header
503dlp_policy_unavailableThe DLP policy for the key could not be fetched. The retry interval is in Retry-After

The waibee/auto model has its own 422 codes (auto_routing_no_match, auto_routing_request_too_large, auto_routing_caching_unavailable, auto_routing_missing_context); see Autorouting.

HTTPerror.typeWhen
400, 413, 422invalid_request_errorThe request is invalid or too large
401authentication_errorNo API key, or the key is not valid. On /v1/messages the body is short, see unauthorized
402, 429rate_limit_errorNot enough funds, the key’s spending limit is used up, or the model limited the request rate
403permission_errorThe request is blocked by an access policy, DLP, or the provider’s moderation
404not_found_errorThe model is not in the catalog
408, 500, 502, 503api_errorA model timeout or outage, an internal error, or load

Exceptions to the table:

  • on /v1/messages, the code provider_unavailable comes as overloaded_error, and on /v1/responses as api_error;
  • invalid_model comes as not_found_error;
  • auto_routing_* and dlp_multi_choice_unsupported come as api_error.

One type covers several causes: permission_error comes for both policy_violation and dlp_violation. So branch on code, not on the type.

The param field on /v1/responses names the parameter that caused the rejection. It is not always present; see Responses format.

401. The API key is missing, wrong, revoked, or expired. The response shape depends on the endpoint. On /v1/chat/completions and /v1/messages, the body is short, {"error":"unauthorized"}, with no code field. On /v1/responses, /v1/embeddings, /v1/systemone, and GET /v1/models, the usual envelope comes back with the code authentication_required (the Authorization header is missing or malformed) or invalid_api_key (the key is not valid). How to pass the key: Authentication.

402. There are not enough funds for the request. Top up your balance; retries will not help. waibee/auto needs a minimum balance; see Autorouting.

404. The model is not in your key’s catalog. Check the ID against GET /v1/models; see Models.

422. The request failed validation. message names up to three fields and the reason, for example Invalid request: body.max_tokens: Field required, and the full list is in extra.errors (in details.errors on /v1/messages and /v1/responses). Common causes are a model name without the provider prefix and too many messages or tools. See Limits.

400. The request asks for a feature the router does not provide:

  • a provider’s server tool (web_fetch, code_execution, MCP), see Tool calling;
  • the :online or :batch suffix in the model name;
  • waibee/auto on /v1/embeddings and /v1/systemone;
  • server-side history storage on /v1/responses, see Responses format.

The field that caused the rejection comes as param: in extra on Chat Completions, in details on Messages, and directly in error on Responses.

400. The model is in the catalog, but this endpoint does not serve its class: an embeddings model on /v1/chat/completions, a chat model on /v1/embeddings, or a decisions model on any endpoint other than /v1/systemone. extra holds model, model_class, and endpoint; on /v1/messages and /v1/responses they are in error.details. Send the request to the endpoint for the class in model_class, or pick a model of the class you need. See Model classes.

400. output_modalities in GET /v1/models has a value the router does not recognize. The accepted values come in extra.accepted: text, embeddings, decisions, and all. See Filtering by class.

400. The model rejected the request body. If the reason concerns your request, it comes in message: fix the body accordingly, because retrying the same request will not help.

400. The input does not fit in the model’s context window. Shorten the history or the attachments, or pick a model with a larger context_length. See Models.

429. The model limited the request rate. Retry with exponential backoff, and under sustained load spread it across models. See Limits.

429. The key’s spending limit for the period is reached. extra.reset_at holds the time the counter resets, and retries before then are pointless. You need another key or a higher limit.

403. The request is blocked by an access policy: for example, the model is not allowed for your group.

403. DLP blocked the request because it found sensitive data in it. The findings are listed in extra.dlp (in details.dlp on /v1/messages and /v1/responses). See Plugins.

The status is the same as for policy_violation, but the fix is different: the cause is the content of the request, not the key’s permissions. Remove what was found from the request or replace it with a placeholder. Another key will not help.

The check may be broader than what you sent in plugins.dlp, and it may even run without that field: a key can have its own policy, and that policy applies as the minimum. See API key policy.

503. The DLP policy for your key could not be fetched, so the request was rejected rather than let through unchecked. Retry after the interval in Retry-After.

413. The whole request body is too large. The codes file_too_large and text_content_too_large mean that a single attachment or the total text is over the limit. The values are in Limits.

403. The model’s provider refused to process the content of the request, usually because its own moderation flagged it. The refusal concerns the text, not your key or your permissions. Rephrase the request or pick another model.

413. The request passed our limits but not the provider’s, which is lower for some models. Shorten the input or pick a model with a larger context.

408. The model did not respond in time. Retry; this happens more often on reasoning models with a high effort level. See Reasoning.

502. The model did not serve the request: it is unavailable or overloaded, it could not be reached, or its response did not match the request. Retry. If the error keeps happening on one model, try another; if it happens on all of them, contact support. provider_model_down means the same thing.

503. The router is under load. Retry after the interval in the Retry-After header.

500, less often 502 or 503. An error on our side. Retry the request; if the error keeps happening, contact support and include the value of the x-waibee-trace-id header from the response.

422. Errors in picking a model for waibee/auto, covered in Autorouting.