Skip to content

API reference: errors and limits

Every error on /v1/* uses the OpenAI error format, so the OpenAI libraries raise their usual exceptions (BadRequestError, AuthenticationError, RateLimitError and so on).

{
"error": {
"message": "The Instant tier does not support function calling. Use Fast or Smart or Genius for active tool requests.",
"type": "invalid_request_error",
"code": "unsupported_tools",
"param": "tools",
"request_id": "b63d6449901d41e0b02e7f1a4af3b885"
}
}

param names the field at fault. Quote request_id, also sent as the X-Request-ID header, when you ask your administrator about a request.

Status Meaning What to do
400 The request has a field the server can’t use Fix the field in param; retrying unchanged fails again
401 Missing or wrong API key (invalid_api_key) Send Authorization: Bearer with a valid key
415 The body is not sent as Content-Type: application/json Send JSON with that header
404 Unknown tier (model_not_found, also from GET /v1/models/{id}), a stored response that does not exist for your key (GET or DELETE /v1/responses/{id}, code: null), or the endpoint is turned off (api_disabled) Use a tier from /v1/models, or ask your administrator
429 A request limit was reached (rate_limit_exceeded) Wait Retry-After seconds and send it again
502 The model’s answer did not pass a check Read error.retryable and retry only when it is true
503, 504 The model is busy or took too long Retry with back-off
Code Status When
invalid_api_key 401 The key is missing, wrong or revoked
model_not_found 404 model is not a tier your key may use
api_disabled 404 Your administrator has turned the endpoint off
previous_response_not_found 400 previous_response_id names a response that was not stored with store: true, has expired or been deleted, or belongs to another key
store_too_large, store_full 400 store: true on a response over about 25 MB with its input and output, or when the server’s response store is full. Send store: false
store_unavailable 503 store: true while the server cannot save responses. Retryable: try again later, or send store: false
unsupported_parameter 400 A field value the server does not take, named in param (see request fields)
invalid_request_error 400 An unknown field or a value of the wrong type, named in param
unsupported_tools 400 Tools were sent to a tier without capabilities.tools, or the computer tool to a tier other than Genius
unsupported_tool 400 On /v1/responses, a hosted tool type such as web_search or file_search (the computer tool is accepted). On /v1/chat/completions any tool type other than function gets invalid_request_error with the message tools[0].type must be 'function'
unsupported_content_part, unsupported_input_item 400 An input part or item type the server does not take
unsupported_schema 400 A JSON schema feature that can’t be checked
invalid_tool_schema 400 A function’s parameters schema is not valid
invalid_response_format, response_schema_too_large 400 text.format or response_format is not valid, or its schema is over 64,000 characters
max_output_tokens_exceeded 400 max_output_tokens is over the tier’s limit for a request with tools
unsupported_vision 400 Images were sent to a tier whose capabilities.vision is false
context_length_exceeded 400 The request and the answer it needs don’t fit the tier’s context window. With thinking on Genius, the thinking reserve counts too and is listed as reasoning_tokens. Shorten the input, use a lower reasoning_effort, or use a tier with a bigger window (defaults per tier)
too_many_images, images_too_large 400 Over 8 images, 10 MiB for one image or 20 MiB in total
invalid_image, invalid_image_detail 400 The image can’t be read, or detail is not auto, low, high or original
unpaired_tool_output_image 400 A function output with images is not right after its function_call
reserved_image_marker 400 [img] or [img- in a tool definition, schema or call in a request with images
image_url_not_supported 400 An https image address, on a server that takes only data: URLs
image_url_not_allowed, image_url_not_public, image_fetch_timeout, image_fetch_failed, image_too_large, unsupported_image_mime 400 An image address your administrator allows could not be fetched or used
rate_limit_exceeded 429 Too many requests or open streams. Wait for Retry-After
image_fetch_busy 429 Image downloads are busy. Wait for Retry-After
invalid_structured_output, empty_model_response 502 The model’s answer failed the schema check after a retry. retryable is true: send the request again
tool_choice_violation 502 The model made a call that tool_choice forbids. retryable is false: look at the request instead of resending it
invalid_tool_call 502 A function call still did not match its schema after one regeneration. retryable is true. See the details
incomplete_tool_call, incomplete_structured_output, incomplete_model_stream, server_error 502 The model’s answer was cut off or could not be read. Read retryable before you send it again. An answer cut at the output limit on a tool turn is marked false: raise the limit or ask for less
model_unavailable 503 The model is not reachable right now
model_timeout 504 The model took too long

Every JSON error from /v1 that carries error.retryable also sends the same decision in a response header, x-should-retry: true or x-should-retry: false. The official OpenAI libraries read this header. Without it they resend every 5xx error, so a 502 that cannot succeed was sent again and again. With it they resend only what is marked true and stop on the rest. Errors marked false include tool_choice_violation and an answer cut at the output limit on a tool turn. Errors without retryable, such as most 400s, have no x-should-retry header and keep the library’s default.

HTTP/1.1 502 Bad Gateway
x-should-retry: false
{"error": {"message": "...", "code": "tool_choice_violation", "retryable": false, "request_id": "b63d..."}}

What to do yourself:

  • Read error.retryable (or the header) in your own HTTP code. Retry on true, with back-off. Do not retry on false.
  • Wait out a 429 with Retry-After. A 400, 401 or 404 fails again until you change the request.
  • A false error means the same request fails the same way. Change the request: raise the output limit, fix the tool_choice or simplify the schema.
  • A stream that has started reports a failure as a last error event, with no x-should-retry header and no [DONE]. Do not treat the partial text as a finished answer, and do not run a partial tool call.
  • The OpenAI libraries resend a failed request twice by default. Set max_retries for another number.

With non-strict tools, or a mix of strict and non-strict functions, the arguments of a call are checked against the schema after generation, with at most one regeneration. A call that still does not match ends with HTTP 502 invalid_tool_call and retryable: true. You never receive a partial or invalid call. The error object adds these fields:

Field Description
reason arguments_schema_mismatch
tool_name The function the model called
rule The schema rule that failed, for example enum or required
arg_path Where in the arguments it failed, for example /modifiers/0
schema_path Where in your schema the rule is
{
"error": {
"message": "...",
"type": "...",
"code": "invalid_tool_call",
"reason": "arguments_schema_mismatch",
"tool_name": "press_keys",
"rule": "enum",
"arg_path": "/modifiers/0",
"schema_path": "...",
"retryable": true,
"request_id": "b63d..."
}
}

If the same function fails often, mark every function strict: true. A strict turn is generated to match the schema; see strict mode.

Limit Default
Requests per API key 60 a minute, across /v1/chat/completions and /v1/responses. /v1/models counts only toward the address limit
Open streams 4 at a time per API key, 8 at a time on the server. A refused stream gets 429 with Retry-After: 5
Requests from one network address 120 a minute, 40 in any 10 seconds, 16 at the same time
Wrong or missing keys from one address 20 in 10 minutes. After that the address gets 429 instead of 401 until the window passes
Images per request 8, up to 10 MiB each and 20 MiB in total
Input items per request (/v1/responses) 400 items, 100 messages

Your administrator can change these. A refused request does not count against any limit. When more than one limit applies, Retry-After gives the longest wait.

Every answer from /v1/chat/completions and /v1/responses, a 429 included, carries OpenAI’s request headers for your key’s minute:

Header Meaning
x-ratelimit-limit-requests Requests your key may send in a minute, for example 60
x-ratelimit-remaining-requests Requests left in the current minute
x-ratelimit-reset-requests When the next request is free again, in seconds, for example 12s

There is no token limit, so no x-ratelimit-*-tokens headers are sent. With the OpenAI Python library, read them from client.chat.completions.with_raw_response.create(...), then .headers.

/v1/responses refuses these values with HTTP 400. Nothing is kept on the server unless you send store: true (see stored responses).

Field or value Code
conversation, background: true, prompt, truncation other than "disabled" or "auto", an include value other than "reasoning.encrypted_content", reasoning keys other than effort and summary, a reasoning value not in the accepted list, other service_tier values, context_management unsupported_parameter
top_logprobs other than 0, text.verbosity other than low, medium or high, stream_options with anything but include_obfuscation invalid_request_error
previous_response_id of a response that was not stored, has expired or been deleted, or belongs to another key previous_response_not_found
store: true on a response over about 25 MB, or when the response store is full store_too_large, store_full
Hosted tool types other than the computer tool (web_search, file_search, …) unsupported_tool
The computer tool on a tier other than Genius unsupported_tools
A second computer tool, or one with fields it does not take invalid_tool_schema
input_file, input_audio and file_id parts unsupported_content_part
Other input item types unsupported_input_item
Any field not in the request body invalid_request_error

/v1/responses accepts and ignores reasoning.summary (auto, concise, detailed), text.verbosity (low, medium, high), and prompt_cache_key and safety_identifier up to 512 characters. reasoning.effort (none to xhigh) is accepted on every tier and switches thinking on for Genius; see thinking on Genius.

/v1/chat/completions refuses these with HTTP 400, with param naming the field:

  • functions and function_call
  • n other than 1, logprobs: true and a non-null top_logprobs
  • store: true and service_tier other than auto or default
  • a non-empty logit_bias, audio, prediction, and modalities other than text
  • an invalid value for an accepted field. The message names the accepted values, for example reasoning_effort must be one of none, minimal, low, medium, high, xhigh
  • any other unknown field

reasoning_effort is accepted on every tier and switches thinking on for Genius; see thinking on Genius. It accepts and ignores verbosity, prompt_cache_key, safety_identifier, an empty logit_bias, modalities: ["text"], null prediction, audio and web_search_options, and the SDK defaults; the full list is in fields that are accepted and ignored.

For web search use POST /websearch, and for PDF files use POST /pdf.

Common questions

What does the x-should-retry header mean on ZenithAI errors?

It repeats error.retryable as true or false. The official OpenAI libraries read it, so they resend an error marked true and stop on one marked false. Read it in your own retry code too.

What does HTTP 429 mean on ZenithAI's API?

A request limit was reached, for your key or for your network address. The body has the code rate_limit_exceeded and the Retry-After header says how many seconds to wait. The OpenAI libraries wait and retry for you.

Which ZenithAI errors are safe to retry?

Errors whose error.retryable is true, also sent as the header x-should-retry true, a 429 after Retry-After, and 503 or 504 with back-off. An error marked false, or a 400, fails again until you change the request.