Chat completions
POST /v1/chat/completions follows OpenAI’s shape. Zabio stores nothing from these calls unless your API key has body logging on (see Teams). The key needs the chat scope (keys have it by default).
For the exact shape of every request and response, with curl, Python and Node examples, see the API reference.
Request fields
Section titled “Request fields”| Field | Supported | Notes |
|---|---|---|
model |
no | a catalog id or auto, auto/best, auto/balanced, auto/cheap. Omitted means auto |
messages |
yes | 1 to 4096 messages. Roles: system, developer, user, assistant, tool. system and developer messages are joined into one system prompt. The legacy function role is refused |
messages[].content |
yes | a string, or an array of parts. user messages accept text, image_url and input_audio parts; other roles accept text parts only |
tools |
yes | up to 256 tools of type function. parameters defaults to an empty object schema |
tool_choice |
yes | auto, none, required or {"type": "function", "function": {"name": "..."}}; needs tools unless it is none |
parallel_tool_calls |
yes | passed to the vendor where supported |
max_tokens, max_completion_tokens |
yes | max_completion_tokens wins when both are present. No default: with none set, Zabio adds no output limit, as on OpenAI; providers that need a value (Anthropic, DeepSeek, Together AI) are sent the model’s maximum output (on DeepSeek and Together AI, at most the room the context window leaves beside the input). A value above the served model’s maximum output is lowered to that limit, on every attempt, so auto and failover never send a vendor a budget it rejects |
temperature |
yes | 0 to 2. Left out for a model that does not take it, and named in zabio.dropped_parameters and the x-zabio-dropped-params header; see Sampling parameters by model |
top_p |
yes | 0 to 1. Left out for a model that does not take it, and named in zabio.dropped_parameters and the x-zabio-dropped-params header; see Sampling parameters by model |
stop |
yes | a string or up to 4 strings. Where the model’s provider does not take it, Zabio cuts the answer at the first sequence itself, so it is always honored |
stream |
yes | server sent events, see below |
stream_options.include_usage |
accepted | the final usage chunk is always sent, so this flag changes nothing |
response_format |
yes | text, json_object or json_schema; see structured output below |
reasoning_effort |
yes | none, minimal, low, medium, high or xhigh, one scale for every vendor, mapped onto the served model’s own control and reported in zabio.reasoning. On auto, leave it out and Zabio chooses the setting with the model; see Reasoning levels |
user, metadata |
yes | forwarded as request metadata |
n |
only 1 | n greater than 1 is refused |
seed, logit_bias, presence_penalty, frequency_penalty |
ignored | accepted so SDK defaults do not break; listed in zabio.ignored_parameters when they carry a non default value |
modalities, audio |
yes | a spoken answer: modalities: ["text", "audio"] and audio: {"voice", "format"} on a model that answers in audio; see Audio answers |
messages[].audio |
yes | on an assistant message, {"id": ...} of an earlier spoken answer; see Audio answers |
web_search_options |
yes | the model’s own vendor searches the web before it answers, on a model named in model that takes web search (one whose zabio.pricing.per_search is set): search_context_size and user_location, with zabio.search.max_uses for the most searches (3 by default). The citations come back as url_citation entries in message.annotations, on a stream in one delta after the text. An OpenAI model always searches first; a Claude model decides. Billing, limits and what does not search are as on the Responses API |
logprobs, top_logprobs, prediction |
refused | 400 unsupported_parameter |
provider |
yes | OpenRouter’s provider preferences: what Zabio applies of them narrows the hosts that may serve, never widens them. See OpenRouter’s provider object |
zabio |
yes | Zabio’s options, below |
Request bodies are limited to 32 MB (413 payload_too_large).
The zabio request object
Section titled “The zabio request object”{ "model": "auto", "messages": [...], "zabio": { "session_id": "chat-7f3a", "vendors": ["anthropic", "openai"], "fallback": "same_vendor", "cache": {"ttl": "1h", "breakpoints": "auto"}, "split": "auto", "deadline": "30m" }}| Field | Values | What it does |
|---|---|---|
session_id |
any string up to 128 characters | groups calls so the routing decision is reused and signals accumulate. See Models and routing |
vendors |
list of anthropic, openai, google |
only these vendors are candidates |
fallback |
same_vendor, cross_vendor, none |
what happens when an explicitly named model is unavailable. Default: the key’s fallback_policy. A request may only tighten it: from cross_vendor to same_vendor or none, and from same_vendor to none. A looser value is served at the key’s policy and listed in zabio.ignored_parameters, so a key set to keep calls with one vendor keeps them there whatever a request says. To allow fallback to another vendor, set it on the key |
cache.ttl |
5m, 1h, none |
prompt cache lifetime where the vendor offers one. Anthropic: 5 minutes or 1 hour (1 hour costs more to write). OpenAI, Google and the other vendors with a published cache price cache repeated prefixes on their side, so with them this value cannot be sent: a none is accepted and listed in zabio.ignored_parameters (see the per-vendor table). Caching is automatic on every call, to auto or to a named model; none turns Zabio’s markers off. Default: 5m, the lifetime used when Zabio writes. A long prompt (1,024 tokens or more) is written to the cache on its second appearance, not its first: the first time it is sent without a write, and when the same prompt or the same system prompt and tools come back within the lifetime it is written, and later calls read it. A prompt sent once never pays the write. Calls in a session_id, requests that carry earlier turns of the conversation, and requests that set cache.ttl themselves are written at once. With that default, a call in a session_id whose previous turn was more than five minutes ago gets 1h instead: a 5 minute cache would have expired and be rewritten on every turn, which costs more than no cache. zabio.cache.ttl_applied reports the choice and zabio.cache.applied who cached. Inside a batch the default is none: a batch line caches only when it asks |
cache.breakpoints |
auto, none |
auto places cache markers on the system prompt, the last tool, the last message and the previous user turn, so a conversation’s history is cached turn to turn; none places no cache markers and forces ttl to none: honored on Anthropic, reported in zabio.ignored_parameters where the vendor caches on its own (see the per-vendor table) |
split |
auto, off |
whether Zabio may split a big request under auto (see Split and route): a cheap model copies the relevant lines of a large source and the routed model answers on that excerpt, when that is cheaper. off sends the request whole. Default auto. Not a key setting: the choice lives in the request |
deadline |
a duration with units s, m or h (15m, 1h, 24h), up to 168h |
how long the answer may take. Absent or under 15 minutes: nothing changes. From 15 minutes up, the call may be served on the vendor’s flex tier where the model has one: the same model at about half the price, slower (see Flex tier). Not a guarantee of a delivery time, and not a key setting: the choice lives in the request |
search |
{"max_uses": 1 to 100} |
the most web searches the call may run when it asks for web search (web_search_options here, the web_search tool on the Responses API). 3 by default. engine may be sent as native, the only one: the model’s own vendor searches |
If your SDK rejects unknown body fields, send the same values as headers. Headers win over the body.
| Header | Same as |
|---|---|
x-zabio-session-id |
zabio.session_id |
X-HF-Session-Id |
zabio.session_id, when x-zabio-session-id is not sent (Hugging Face’s header) |
x-zabio-cache-ttl |
zabio.cache.ttl |
x-zabio-fallback |
zabio.fallback |
x-zabio-split |
zabio.split |
x-zabio-deadline |
zabio.deadline |
OpenRouter’s provider object
Section titled “OpenRouter’s provider object”Code written for OpenRouter can send its provider object as it is. What it asks only narrows the models and hosts your key may already use: it never adds a provider or a model your key’s model access leaves out. A host it leaves out does not serve the call, nor any fallback, review or step of it. On auto, Zabio’s classifier (TypeSafe’s Jev) reads an excerpt of the request to choose the model, as the privacy page describes; the classifier’s later steps on Google and Anthropic are skipped when the object leaves that provider out, as they are under model access. With zdr: true, auto is refused instead.
On a named model, a request that sends order or sort has said which host it wants, so that choice wins: the first host of order that can take the request, else the sort pick. The model as named is the default only when neither chooses a host, and when it does not pass the other fields the cheapest of its hosts that passes serves. A model name that already chooses its host, by a suffix (deepseek-flash:deepinfra) or by a host’s own id (deepseek-flash@deepinfra), is never moved: order beside it is listed as ignored, sort beside it is refused with 400 unsupported_model_suffix, and a host that only, ignore, max_price or require_parameters leaves out is refused with 400 no_model_allowed, naming the conflict.
| Field | What Zabio does |
|---|---|
only |
only these providers’ hosts may serve the call. Names are OpenRouter’s provider names (anthropic, openai, google-ai-studio, deepseek, mistral, together, alibaba, moonshotai, deepinfra, parasail, amazon-bedrock, xai, meta, aion-labs, typesafe) or Zabio’s own vendor ids (zabio.vendor in GET /v1/models, such as bedrock or alibaba-us); alibaba is both Alibaba Cloud vendors and xai both xAI endpoints. A name Zabio does not route to matches nothing and is listed as provider.only in zabio.ignored_parameters; when no name matches, or none is also in zabio.vendors, the request is refused with 400 no_model_allowed |
ignore |
these providers’ hosts never serve the call |
order |
a named model is served on the first host in this order that can take the request. A model with no host on those providers is served as named (see below). On auto the order only decides between hosts at the same price. When the chosen host fails, the fallback applies from it, not the next provider of the order |
allow_fallbacks |
false is zabio.fallback: none |
sort |
on a named model, price is the host choice :cheapest, and latency and throughput are :fastest: the host its vendor sells as faster, since Zabio does not yet measure speed per host (see Model names from OpenRouter and Hugging Face). A sort beside a host suffix in the model name (:deepinfra, :floor) is refused with 400 unsupported_model_suffix. On auto it is listed as ignored: the line chooses the model |
max_price |
prompt and completion, in USD per million tokens: a ceiling on the rate you are billed, the service fee included (on your own vendor keys, the list rate, which is what you pay there). A model’s highest text rate counts, its long context rate where it has one; cache rates, audio and image token rates and the per call fee are not compared. Hosts above it are left out. A named model with no host under it, or auto with no model under it, is refused with 400 no_model_allowed, naming the price and the ceiling. Any other price in it (request, image, audio) is refused with 400 unsupported_parameter |
require_parameters |
true keeps only the hosts that never leave out a parameter you send: temperature and top_p (see Sampling parameters by model), and reasoning_effort on a model that cannot reason, or that turns reasoning off beside tools. A model that leaves one out only while it reasons is left out too, since its reasoning setting is chosen after the host. With a parameter no model applies (seed, logit_bias, presence_penalty, frequency_penalty, a cache lifetime) the request is refused with 400 unsupported_parameter, naming it |
zdr |
true serves the call only on hosts the catalog marks as zero data retention. The call is not shared, not written to body logging, and on the Responses API not stored. A named model with no such host is refused with 400 no_model_allowed, param provider.zdr. auto is refused with 400 auto_needs_classifier; store: true, a web search, a batch line, and every call while the organization’s firewall paid tier is on, with 400 zdr_conflict |
data_collection |
"deny" keeps only the hosts whose vendor’s own terms say it does not use a request’s content to train or improve its models. A vendor whose terms Zabio has not read and recorded counts as one that may, so its hosts are left out. A named model with no host left is refused with 400 no_model_allowed, param provider.data_collection. "allow" asks for nothing. While the organization’s firewall audio screening is on, "deny" is refused with 400 data_collection_conflict |
quantizations, any other field |
listed in zabio.ignored_parameters by its name, such as provider.quantizations: Zabio does not record the quantization of a host |
The host that served is in zabio.model_served and zabio.vendor, and its location in GET /v1/models. In a batch, a line is served on the model it names: the other fields apply as here, and order and sort on a named model are listed as ignored. A background response keeps the host chosen when it was sent.
Zero data retention
Section titled “Zero data retention”A request with provider.zdr: true is served only on a host whose vendor’s own terms say it keeps none of the request’s content after answering it. Today those are the models served by DeepInfra (except its image models, whose outputs DeepInfra keeps for a short time), Parasail and Aion Labs. Their terms still allow some records, such as those the law requires and the metadata a vendor bills by. Each vendor’s terms are summarized on the privacy page. Other vendors are added when Zabio has their terms, or their written confirmation for Zabio’s account, in hand.
- Zabio keeps none of the request’s content, in any form, not even a hash of it. The call is never a shared call, whatever your organization’s sharing setting, so it earns no sharing discount. It is not written to body logging, even on a key that has body logging on, and no excerpt of it is kept for the session. The call’s record (tokens, cost, model, host, timings) is kept as for any call.
- A named model is served on one of its hosts that passes, chosen as above. A model with none, or a host the model name chooses that does not pass, is refused with 400
no_model_allowed, paramprovider.zdr. Fallback stays on hosts that pass. autois refused with 400auto_needs_classifier:autochooses its model from the classifier’s reading of the request, and the classifier’s vendor, TypeSafe AI, does not keep nothing. Name a model.- What would keep the request is refused with 400
zdr_conflict:store: true,web_search_options(the search runs on a service whose terms Zabio has not read as keeping nothing), and every call while your organization has the firewall’s paid tier on, since its screening sends parts of the request to TypeSafe AI, ElevenLabs or Deepgram. An organization that sets the firewall’szdr_modetofree_onlyhas its zero data retention calls served instead, with the free screening only and their audio not screened (see Zero data retention calls). A batch line withprovider.zdris refused too: a batch keeps its input and output files. - On your own vendor key, the vendor’s terms for your account apply.
data_collection: "deny"is refused too with 400data_collection_conflictwhile your organization has the firewall’s audio screening on, since the audio goes to ElevenLabs or Deepgram, except besidezdr: trueunderfree_only, where the audio is not screened.
Streaming
Section titled “Streaming”With stream: true the response is text/event-stream. Each event is a data: line with a chat.completion.chunk. The order is: a chunk with delta.role, content and tool call deltas, a chunk with finish_reason, then one usage chunk with empty choices, the usage block and the zabio object, then data: [DONE].
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":9,"total_tokens":21},"zabio":{...}}
data: [DONE]The usage chunk is always sent. If the vendor connection fails mid stream, an error object is sent in a chunk and the stream ends.
A request with a final review carries two more chunks with empty choices, which say the review is running and then done; see “On a stream” there. A request whose model calls a sub-agent carries the same two chunks for each worker.
Long calls
Section titled “Long calls”Some calls take minutes: a long answer, or a model that thinks for a while before it writes. Zabio receives the answer from the model provider as a stream, also when you did not ask for one (calls on the flex tier and decision models are sent in one piece, with their own time limit), and keeps your connection alive, so nothing between you and the provider gives up first. An attempt ends only when the provider stops sending data for 2 minutes (10 minutes before the first data on those OpenAI calls), or after 30 minutes in all. Until any part of the answer has reached you, a failed attempt is tried again on another model.
- Not streamed. As soon as a model provider accepts the request (after 90 seconds at the latest), Zabio sends the
200status and headers, then one space every 15 seconds until the answer is ready; the JSON body follows the spaces, and every JSON parser skips them. On OpenAI’s models that reason, a call on your own OpenAI key, or one that setsstopon o1 or o3-mini, is answered only once the model has finished thinking, so its200goes out at the 90-second mark. A failure after that point cannot change the status any more, so the body is then only anerrorobject (message,type,code,request_id), with nochoices. Check forerrorbefore you readchoices: the OpenAI SDKs return such a body without raising. - Streamed. Whenever nothing else has been sent for 15 seconds, Zabio sends an SSE comment line (
: ZABIO PROCESSING), which SSE clients ignore. A failure after the stream started comes as an error event,data: {"error": {...}}, then a last chunk withfinish_reason: "error", thendata: [DONE]; the official SDKs raise on the error event. - Your own timeout. Stream long answers, or set your client’s request timeout to at least 30 minutes.
- If you disconnect. Closing the connection cancels the vendor call, and you pay for the work done: the input, and the output generated before you disconnected, streamed or not.
- Headers on a long call. The
200and its headers go out before the answer, so the headers that depend on it (x-zabio-vendor,x-zabio-byok,x-zabio-dropped-params) are absent then; the vendor, the model served and the routing are in the body’szabioobject, as always.
Split and route
Section titled “Split and route”Under auto, a big request can be answered in two steps when that is cheaper: a cheap model copies, word for word, the lines of your source that the question needs, and the model routing chose answers on that excerpt instead of the whole source. Zabio does this only when the last user message is plain text of several thousand tokens with a separate question that needs part of it, the request carries no tools or images, its own estimate says the split costs at most 70 percent of the unsplit call, a check confirms the excerpt holds what the question names, and every guard passes; otherwise the request goes whole, as always. The answering model is told the material was excerpted and can reply with the line NEED_MORE_SOURCE, in which case Zabio sends the full request to the same model and returns that answer. A named model is never split. Send zabio.split: "off" (or the header x-zabio-split: off) to send a request whole. Every step, model and cost is in zabio.split, and a split never costs you more than the unsplit call. See Split and route for what the model sees and Billing for the fee.
Classification jobs on auto
Section titled “Classification jobs on auto”Under auto, a request whose response_format is a json_schema made only of fixed choices (enum), booleans and bounded integers or numbers, with no tools, images or stream, may be answered by Jev (jev-1.14.0) instead of the text model routing chose: on an easy or medium classification job by the line’s rule on our measurements of Jev against the routed models, which can cost slightly more when the routed model is one our tests have not measured; on other jobs when Zabio’s estimate says Jev is cheaper. Jev answers in about 0.15 seconds with the calibrated probability of every answer; when any field of its answer is under 0.5, Zabio discards it and the text model answers as always, at Zabio’s cost. You can tell from zabio.model_served (jev-1.14.0) and zabio.decision; the answer keeps your schema’s shape. A named model is never answered by Jev. See Classification jobs on auto.
Flex tier
Section titled “Flex tier”OpenAI (flex processing) and Google (Flex inference) serve the same model at about half the price when you can wait: their own latency target is up to 15 minutes, and capacity is best effort. Zabio uses these tiers when your request says it can wait: send zabio.deadline (or the header x-zabio-deadline) with a duration of 15 minutes or more, for example "30m" or "2h". A deadline under 15 minutes, or none, changes nothing.
- Which models. OpenAI’s GPT-5, GPT-5.x and GPT-6 chat models,
o3ando4-mini; every Google Gemini model. Flex prices are half the standard input, output and cache read prices, except the cached input ofgpt-5.4ando4-mini, which OpenAI lists at 0.13 and 0.138 USD per million tokens. Every other model (the GPT-4 family,o1,o3-mini,chat-latest, every Anthropic, DeepSeek, xAI, Mistral and Together AI model) has no flex tier and is served and priced at standard, deadline or not. - With
auto. Routing compares the candidates at their flex prices where a model has one, soautocan pick a model because it is cheaper in flex. A named model is served at flex when it has a flex price. - Never a failed call. When the vendor refuses a flex request for capacity (OpenAI answers 429 resource unavailable, Google 503 or 429), Zabio retries the same model at the standard tier at once and bills the price actually used.
zabio.tier.fallbackis thencapacity. - Time. A flex attempt may take up to 900 seconds; Zabio keeps the connection alive under it as described in Long calls. Set your client’s timeout to at least 900 seconds when you send a deadline.
- What you see.
zabio.tierreportsrequested(flexorstandard, what your deadline mapped to),applied(what served the call) andfallback(capacitywhen flex was refused). - The saving. In what routing saved, a flex call is compared with your key’s baseline model at its flex price, or its standard price when that model has no flex tier, so the vendor’s own discount never counts as a saving. See Billing.
- Split and route. The pre-steps of a split (the extract and the checks) run at the standard tier; only the answer can be flex.
Work that can wait a day goes through Batches (/v1/files and /v1/batches), where every line is priced at the vendors’ batch rates, or through a background response with a deadline of 24 hours or more, which joins your organization’s next batch without a file. A synchronous call with such a deadline cannot wait that long on one connection, so it is served at the flex tier where the model has one (at standard otherwise) and zabio.tier says so: {"requested": "batch", "applied": "flex", "fallback": "synchronous"}.
Images
Section titled “Images”user messages may contain image_url parts:
{"role": "user", "content": [ {"type": "text", "text": "What is in this picture?"}, {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}]}url is either an http(s) URL or a data URI of the form data:image/<type>;base64,<data>. Zabio downloads URLs and sends the bytes to the vendor, so every vendor gets the same input. Rules for URLs:
- public hosts only; addresses in private, loopback, link local or otherwise internal ranges are refused
- at most 20 MB per image, up to 20 images per request
- the server must answer with
image/png,image/jpeg,image/webporimage/gif - at most 3 redirects,
http(s)only, 15 second timeout
Failures return 400 invalid_image_url with param pointing at the failing part. A request with images is only routed to vision capable models; a named model without vision (zabio.capabilities.vision is false in GET /v1/models) answers 400 unsupported_for_model naming the model, before anything is sent to a vendor, whatever the key’s fallback setting.
user messages may contain input_audio parts, in the shape OpenAI’s SDKs send:
{"role": "user", "content": [ {"type": "text", "text": "What is said in this clip?"}, {"type": "input_audio", "input_audio": {"data": "<base64>", "format": "wav"}}]}data is the audio as raw base64 (not a data URL) and format is wav or mp3. The clip is sent to the model as it is, except that a WAV header written by a streaming recorder gets its two size fields set from the clip’s length; Zabio reads its header for the length and the container, and nothing is transcoded. Rules:
- the limit on a request’s audio depends on the model: Google’s Gemini models take up to 100 MB of decoded audio per request, every other model 20 MB. More than the model takes answers 413
media_too_largebefore anything is sent to a vendor, and on a named model the message states its limit.autopicks among the models that take the request’s audio - one request body is limited to 32 MB, which is about 25 MB of decoded audio, so a single request carries at most that. More reaches a Gemini model only on the Responses API, where the clips of a conversation’s stored turns are sent again with each later turn and count toward the limit
- another
formatanswers 400unsupported_value; a data URL or bytes that are not base64 answer 400invalid_value; awavthat is really anmp3, or the reverse, answers 400invalid_valueonformat - a request with audio is only routed to models that take audio input:
zabio.capabilities.audio_inputistrueon them inGET /v1/models. Today they are Google’sgemini-3.8-flash,gemini-3.6-flash,gemini-3.5-flash-lite,gemini-3-flash-previewandgemini-3.1-flash-lite, and OpenAI’sgpt-audio-1.5,gpt-audioandgpt-audio-mini(the last two until their shutdown on 2027-01-20).autopicks among the Gemini models; the OpenAI models are called by name - a named model that takes no audio answers 400
unsupported_for_modelnaming the model, before anything is sent to a vendor - for an answer in audio, see Audio answers
The vendor counts the clip in audio tokens and reports them in usage.prompt_tokens_details.audio_tokens, inside prompt_tokens; they are billed at the model’s audio price (zabio.pricing.audio_input in GET /v1/models, per million audio tokens), the text at the text price. On the Gemini models, audio the vendor read from its cache is counted in prompt_tokens_details.cached_tokens and billed at the cache price, or at the model’s cache price for audio where it has one (zabio.pricing.cache_read_audio in GET /v1/models), and audio_tokens is the rest, so no token is billed twice. A call’s details in Logs and the CSV export of your calls name that cached audio apart from the other cached tokens (tokens_cached_audio_read in the export), so you can add up what the call cost from its tokens. Google counts 25 tokens a second of audio, so a minute is about 1,500 tokens. Before the call, Zabio estimates the clip at the model’s rate for the rate limits and the balance check, from the length its header states.
On this endpoint the clip is never stored and never logged: it goes to the vendor that answers (zabio.vendor) and is dropped when the call ends. When a request to a Gemini model carries more than 20 MB of media, Google takes its clips through its own file service, and Zabio deletes them there as soon as the answer is in. With body logging on for the key, the stored request keeps the clip’s format, size and length, never its bytes. On the Responses API a stored turn keeps the clip, encrypted, under the conversation’s retention, so later turns can still hear it.
Audio answers
Section titled “Audio answers”A chat model that answers in audio speaks its answer when the request asks, in the shape OpenAI’s SDKs send:
{"model": "gpt-audio-1.5", "modalities": ["text", "audio"], "audio": {"voice": "alloy", "format": "wav"}, "messages": [{"role": "user", "content": "Tell me a short joke."}]}The answer carries the audio in choices[0].message.audio: data (the audio as base64, in the asked format), transcript (its words), and id and expires_at (see a later turn, below); content is null. Rules:
- the models that answer in audio have
zabio.capabilities.audio_outputset totrueinGET /v1/models, their formats inaudio_formats, the formats they stream inaudio_stream_formatsand their voices invoices. Today they are OpenAI’sgpt-audio-1.5,gpt-audioandgpt-audio-mini(the last two until their shutdown on 2027-01-20) and Alibaba’sqwen3.5-omni-plus,qwen3.5-omni-plus-2026-03-15andqwen3.5-omni-flash(processed outside mainland China; see Qwen Omni, below;qwen3.5-omni-flash-2026-03-15answers in text only, because it sends no audio), listed with their audio prices under Audio answers on the models page formatiswav,mp3,flac,opus,pcm16(16-bit samples with no header) oraac, as the model offers;voiceis one of the model’s voices by name (on the OpenAI models:alloy,ash,ballad,cedar,coral,echo,fable,marin,nova,onyx,sage,shimmerandverse; on the Qwen Omni models the 56 voices listed invoices, such asTinaorLiora Mira, spelled as listed). A custom voice object is refused with 400unsupported_value, as is a format or a voice the named model does not offer, with what it offers in the message- a named model that does not answer in audio answers 400
unsupported_for_model, before anything is sent to a vendor, whatever the key’s fallback setting; a fallback only ever moves the request to another model that answers in the same format and voice autodoes not answer in audio yet: an audio request toautoor one of its lines answers 400unsupported_for_model; name the modelmodalitiesmust be["text", "audio"]: audio alone answers 400invalid_value, as the models refuse it- a spoken answer cannot run in a batch, and the Responses API answers in text (400
unsupported_parameteronmodalitiesoraudio)
Streaming. The OpenAI models stream an answer in pcm16 only: stream: true with another format answers 400 unsupported_value on audio.format, before anything is sent to a vendor; without stream every format works. With stream: true the audio arrives in choices[0].delta.audio chunks, in OpenAI’s shape: pieces of data and of transcript, the id, and last a chunk with expires_at alone. Decode each data piece from base64 and join the bytes in order; pcm16 can be played as it arrives.
Qwen Omni. The Qwen Omni models answer in audio only when the request streams (zabio.capabilities.audio_stream_only in GET /v1/models): without stream: true, a request with the audio modality answers 400 unsupported_value on stream, before anything is sent to a vendor, because the vendor would answer in text and still bill the audio. A request without the audio modality is served streamed or not. They answer in pcm16 only (24 kHz, 16-bit, mono). The words of the answer arrive in content (in delta.content when streamed), not in transcript. They take text in, not images, audio, video or tools, and an earlier answer’s audio id is refused: send the earlier answer’s content as the assistant’s content.
A later turn. To go on after a spoken answer, send the assistant turn back as {"role": "assistant", "audio": {"id": "<the answer's audio.id>"}}. The vendor keeps that audio until expires_at, and Zabio keeps none, so such a request must name a model of the vendor that gave the answer (to auto, or to another vendor’s model, it answers 400 unsupported_for_model), and after expires_at the vendor refuses the id. Sending the transcript as the assistant’s content instead works with any model.
Billing. The vendor reports the answer’s audio in usage.completion_tokens_details.audio_tokens and its text in text_tokens, both inside completion_tokens. The audio tokens are billed at the model’s audio output price (zabio.pricing.audio_output in GET /v1/models, per million audio tokens), the text at its output price, plus the fee as on every call; if a vendor reports no audio count, the whole output is billed at the audio price, and audio tokens a vendor reports for an answer that carried no audio are not billed. On the Qwen Omni models the text of an answer that carries audio is free and only its audio is billed, as Alibaba bills it (zabio.pricing.text_free_with_audio in GET /v1/models); an answer in text alone pays the output price. Before the call the balance check counts the whole output budget at the audio price: your max_tokens, or at least 2,048 tokens when you send none; when your balance cannot pay for the model’s whole output, the model is sent the output the balance can pay for. A stream that ends without its usage is billed from what reached you, marked estimated.
Never stored. The spoken answer goes from the vendor to you; Zabio does not keep the audio, not in a file and not in a log. With body logging on for the key, the stored answer keeps its transcript, its id and its size in bytes, never the audio.
user messages may contain video_url parts, the image part’s shape with a file form beside it:
{"role": "user", "content": [ {"type": "text", "text": "What happens in this video?"}, {"type": "video_url", "video_url": {"url": "https://example.com/clip.mp4"}}]}video_url.url is one of three things: a data URL (data:video/mp4;base64,..., also video/quicktime and video/webm), an https URL, or a public YouTube URL (youtube.com/watch?v=, youtu.be/, youtube.com/shorts/). Send a video inline or by URL; video_url.file_id is not taken for an upload, because user_data uploads to POST /v1/files take text files only (a video is refused with 400 invalid_file). Videos are MP4, MOV or WebM; Zabio reads the file’s header for its format and length and changes nothing in it. Rules:
- an https URL is downloaded by Zabio under the rules for image URLs: public addresses only, 15 seconds, at most 20 MB. For a bigger video, upload it and send its
file_id, or send its URL to a Qwen model by name (the next rule) - an https video over 20 MB sent to a Qwen model by name is not downloaded by Zabio: Alibaba fetches it from your URL, up to the 2 GB Alibaba states as its limit. The URL must be reachable from the public internet, and Alibaba asks that its server state the file’s size and type (
Content-LengthandContent-Type). Zabio reads only the first 1 MB of the file, under the same rules as any download, for its format and length. An MP4 or MOV saved for streaming (its index at the start of the file, often called fast start) states its length there. One with the index at the end does not, and is estimated at ten minutes. Every other model answers 400invalid_video_urlfor an https video over 20 MB, and so doesauto, which does not pick the Qwen models - at most 10 videos per request, and at most 100 MB of video in all (413
media_too_large). A data URL also counts toward the 32 MB request body, so a video over about 24 MB goes as a file - a request with video is only routed to models that take video:
zabio.capabilities.video_inputistrueon them inGET /v1/models. Today they are Google’sgemini-3.8-flash,gemini-3.6-flash,gemini-3.5-flash-lite,gemini-3-flash-previewandgemini-3.1-flash-lite, and Alibaba’sqwen3.8-omni-flash,qwen3.8-flashandqwen3.7-plus(alsoqwen3.7-plus@alibaba-us), and its Qwen 3.6 and 3.5 modelsqwen3.6-plus,qwen3.6-flash,qwen3.6-35b-a3b,qwen3.6-27b,qwen3.5-plus-2026-04-20,qwen3.5-plus-2026-02-15,qwen3.5-flash-2026-02-23,qwen3.5-397b-a17b,qwen3.5-122b-a10b,qwen3.5-35b-a3bandqwen3.5-27b.autopicks among the Gemini models; the Qwen models are called by name - a named model that takes no video answers 400
unsupported_for_modelnaming the model, before anything is sent to a vendor - YouTube URLs and WebM videos go to the Gemini models only. The Qwen models take a video sent as data only under 10 MB of base64 (about 7.5 MB of video); a bigger video goes to them as an https URL, which Zabio passes on for the vendor to fetch. A named Qwen model asked otherwise answers 400
unsupported_valuesaying why - a video cannot run in a batch or as a background Response: Zabio does not keep videos until later
The vendor counts the video in input tokens, inside usage.prompt_tokens, and they are billed at the model’s input price; A test clip counted about 65 tokens a second on Gemini without sound and about 90 with it, and on the Qwen models one token for every 32 by 32 pixels of a frame, one frame a second: about 220 a second at 360p, about 400 at 480p and about 600 at 720p and above, so a minute on Gemini is about 4,000 to 6,000 tokens; Google’s page states about 100 a second at low resolution and 300 at high. Gemini counts a video’s sound inside the video’s tokens, at the input price. Alibaba’s Omni model counts a video’s sound apart, in usage.prompt_tokens_details.audio_tokens, billed at the model’s audio price. The other Qwen models do not listen to a video’s sound and count none. Before the call, Zabio estimates the video at the model’s rate for the rate limits and the balance check, from the length its header states; a video whose length Zabio cannot read (a YouTube URL, a WebM recorded live, an https video over 20 MB whose length is not at the start of the file) is estimated at ten minutes. A call whose stream ends before the vendor reports its usage is billed from Zabio’s own count: the length Zabio read, at no more than 220 tokens a second on the Qwen models, or 594 when Zabio read a picture of 720p or larger from the file’s start.
Zabio never keeps a video: it goes to the vendor that answers (zabio.vendor) and is dropped when the call ends. Google takes a video over 20 MB through its own file service, and Zabio deletes it there as soon as the answer is in. An https video over 20 MB sent to a Qwen model is fetched by Alibaba from your URL; Zabio reads its first 1 MB and keeps none of it. Nothing of the video is logged; with body logging on for the key, the stored request keeps the video’s format, size and length, never the video or its address. On the Responses API a stored turn keeps the same reference only, so a later turn of the conversation does not see the video again.
Function tools work as in OpenAI. Send tools, receive tool_calls on the assistant message with finish_reason: "tool_calls", answer with tool messages carrying tool_call_id. Arguments are always a JSON string ({} when empty). Requests with tools are only routed to tool capable models.
Tools on Gemini models
Section titled “Tools on Gemini models”Google’s Gemini models take a subset of JSON Schema in a tool’s parameters. Zabio converts each schema on the way to a Gemini model, so the schemas the OpenAI and Anthropic SDKs and Claude Code send work unchanged: references ($ref to $defs) are written out in place, a list of types becomes one type marked nullable, const becomes a one value enum, oneOf becomes anyOf, and an integer’s exclusiveMinimum or exclusiveMaximum becomes the next whole number’s minimum or maximum. Keywords with no Gemini equivalent are left out of the call, and the ones that carried a rule are listed in zabio.ignored_parameters as tools.parameters.<keyword>, once each: for example tools.parameters.additionalProperties, so the model may add a property your schema closed. A format Gemini does not know, an enum of numbers, multipleOf, uniqueItems and a bound on a decimal number are repeated in the field’s description, so the model still reads them. Annotations such as $schema, $id and $comment are left out without a mention. A tool that takes no parameters is declared without any.
A schema that refers to itself (a recursive $ref, such as a tree whose children are trees) cannot be written out for Gemini. Under auto the Gemini models are left out for that request and another model answers; a request that names a Gemini model gets 400 unsupported_parameter naming the tool and the keyword, and on that 400 nothing is sent to Google and nothing is billed.
Final review
Section titled “Final review”A second model can check an answer before you get it. When the model you called ends with an answer, the reviewer reads the whole conversation with that answer and says whether it agrees. Use it where a wrong answer is costly and you keep a cheaper model for the work.
Ask for it in one of two ways:
- A header, for a client that cannot change the request body:
x-zabio-final-review: reviseorx-zabio-final-review: report. The reviewer isauto/best. - A tool entry, which also lets you name the reviewer:
{ "model": "claude-haiku-5-5", "messages": [{"role": "user", "content": "..."}], "tools": [{"type": "zabio:review", "parameters": {"mode": "revise", "model": "auto/best"}}]}mode is revise (the default) or report. model is an auto line (auto/best is the default) or a model by name. When you send both the header and the tool entry, the tool entry decides and the header is listed in zabio.ignored_parameters. off, or no header, means no review. A request takes one zabio:review entry. A parameter the entry does not read is listed in zabio.ignored_parameters. The review is not a function: the model you called is never offered it and cannot call it.
revise. When the reviewer disagrees, the model you called gets the review as a user turn and answers once more, possibly after calling tools again. That second answer is the one you get. There is one review per request: the second answer is not reviewed. When the second answer calls your own tools, see When the second answer calls your tools.report. The answer goes out as written, with the review beside it. Nothing is changed.
On a stream. With stream: true the review runs as well, and what you see depends on the mode:
reportstreams as usual. The answer is sent as it is written. The review runs after it, andzabio.reviewcomes in the last chunk, besideusage. The stream ends later by the time the review takes.revisesends nothing of the answer before the review is done, because the review may replace it. While the model writes and the reviewer reads, the stream carries only comment lines (: ZABIO PROCESSING) and the two status chunks below. Then the answer you get is sent in one piece. A client that shows text as it arrives shows nothing until then: usereport, or no stream, where that matters.- Status chunks. When the review starts, Zabio sends a chunk with empty
choicesand"zabio": {"server_tool": {"type": "zabio:review", "name": "review", "status": "running"}}, and the same chunk with"status": "done"when the review’s call has ended, whatever its result. The result itself is in the last chunk. The OpenAI SDKs read a chunk with emptychoices, as they read the usage chunk, and put every text chunk into one message. Code of your own that readschoices[0]on every chunk must skip a chunk whosechoicesis empty. - The chunks’
idis the first call of the model you asked for. Inreviseafter a disagreement the answer comes from a second call, andzabio.call_idin the last chunk names that one. - If you disconnect, you pay for the work done. An answer that was written whole is billed whole, also in
revisewhen it had not been sent to you yet. A review that was still running is cancelled and not billed. - The time limit of such a request is the limit of a call that is not streamed, 20 minutes in all, and not the 10 minutes a stream has until its first text. When it passes, no review and no second answer start. An answer that is already being sent to you is sent to its end; a request that has sent nothing yet ends with
request_timeout.
The reviewer. With an auto line, Zabio picks the reviewer for the request’s kind of work, and never the model that wrote the answer, on any host. On auto/best, the default, the reviewer is a model of the two highest tiers (powerful or frontier in GET /v1/models), and never of a lower tier than the model that wrote the answer. The reviewer can be a model of another vendor than the one you called, and the whole conversation is sent to it. Your key’s model list and zabio.vendors limit which models it can be; to choose it yourself, name it. The reviewer reads the conversation as text: your system prompt, every message, the tool calls and their results. An image, an audio clip or a video is named and not sent. The reviewer cannot call tools. It writes at most 2,048 tokens, its reasoning included, and Zabio sets its reasoning so that room is left for its text. A model that does not reason by default is asked not to reason; Zabio never turns reasoning on for a review, and does not pick a model whose reasoning it cannot lower.
What you get. zabio.review on the response:
| Field | Meaning |
|---|---|
model |
the model that reviewed |
verdict |
agree, disagree, or none when the review failed or the reviewer wrote no verdict line (its text is then in advice, and nothing is revised) |
advice |
what the reviewer wrote after its verdict, cut at 2,000 characters (a text that was cut ends in [cut]) |
revised |
true when the answer you got is the second one |
answer_before |
the first answer, when revised is true, cut at 8,000 characters |
cost_micros |
what the review’s own model call was billed, inside zabio.cost_micros |
status |
ok; review_failed when the review did not run or wrote nothing (error has the code); revision_failed when the reviewer disagreed and the second answer did not come, so you got the first; revising when the second answer called your own tools, so the task goes on in your next request (see below) |
usage counts both answers of the model you called, and zabio.attempts counts every call of it.
What it costs. The review is one more model call, billed at the reviewer’s list price plus the service fee of (see the pricing page). It is a line of its own in zabio.cost.server_tools (type zabio:review), with zabio.cost.server_tool_micros and zabio.cost.server_tool_fee_micros as the sums, inside zabio.cost_micros, and a line of its own under Logs, marked Review. In revise, a disagreement adds a second call of the model you called, billed like the first. When Zabio picks the reviewer, the request pays the price of automatic model choice once, also when you named the model that answers, whatever the verdict; a request that names its model does not pay it when the review failed (status review_failed). With a model you named and a reviewer you named, it is not paid. See Billing.
Your balance. Before the call, Zabio sets aside the most the request may cost: the review reading the whole conversation on the most expensive model it may run on and, in revise, one more answer. With auto/best that is the most expensive model of those two tiers your key may use, which can be far more than the review ends up costing. When your balance does not cover it, the review is left out, the request runs without it, and zabio.ignored_parameters says so. Naming the reviewer (for example "model": "gpt-6.1-sol") keeps the amount set aside lower, which helps on a small balance. What was set aside and not spent is free again when the call ends.
A review can be wrong. The reviewer is a model and can disagree with a right answer. In our tests on 12 tasks, with claude-haiku-5-5 answering and gpt-6.1-sol reviewing, the reviewer flagged all 6 wrong answers and also 3 of the 6 right ones. One revision fixed 5 of the 6 wrong answers, and the model kept its answer on the 3 right ones. In revise, the model you called is asked to check the reviewer’s point and to keep its answer when the point does not hold. In report, read disagree as a reason to look at the answer, not as a correction.
When the second answer calls your tools
Section titled “When the second answer calls your tools”In revise, the model may call your own functions while it fixes its answer. The response then ends with those tool calls (finish_reason is tool_calls), and zabio.review has status revising, the review’s advice, and the first answer in answer_before. Run the tools and send their results as usual: the model goes on with the task in your next request. On a stream the tool calls come in one piece after the two status chunks, as any answer does in revise.
Keep the review in your history. The model read its first answer and the review before it called your tools, but those two turns are not in the message you got. To let it see why it went back to work, add them to your history before the message with the tool calls: an assistant message with answer_before, then a user message with the advice.
"messages": [ {"role": "user", "content": "Triage tickets T-2079 and T-2115."}, {"role": "assistant", "content": "<zabio.review.answer_before>"}, {"role": "user", "content": "A reviewer disagreed: <zabio.review.advice>"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_abc~zrv1", "type": "function", "function": {"name": "merge", "arguments": "{\"ticket\": \"T-2079\", \"into\": \"T-2001\"}"}}]}, {"role": "tool", "tool_call_id": "call_abc~zrv1", "content": "merged"}]Keep the tool call ids as you got them. The id of each tool call in such a response ends in ~zrv and a number, for example call_abc~zrv1. It tells Zabio, in your next request, how many reviews the task already had. Zabio takes it off before your request reaches the model, on every endpoint. A client that changes the ids loses it, and its next answer is reviewed as if the task were new.
Up to 3 reviews per task. A task is everything after your last user message. The answer that comes after a tool round is reviewed again, up to 3 reviews in one task, and each review is billed like the first. After the third, the review is left out of the request and listed in zabio.ignored_parameters; nothing is set aside or billed for it, and there is no zabio.review. A new user message starts a new task. In our tests on 20 long sessions, with gpt-6-luna answering and claude-opus-5-5 reviewing, 15 sessions ended with the right result after one review, 17 after two and 18 after three. A later review can also disagree with a right answer: it did 4 times in 11, and the model kept its answer each time.
Who decides. The marks are in your request’s history, so whoever builds that history can remove them (and get another review) or write them (and get none). The final review is a choice of whoever sends the request; Zabio does not impose it.
A review that fails never fails your request. You get the answer, verdict is none and status is review_failed. A review whose model call failed is not billed. error gives the cause: empty when the reviewer wrote nothing, its output spent on reasoning, and otherwise the code of the failure (for example overloaded, too_many_requests, execution_time_exceeded or model_not_found). A review that wrote nothing is not billed within the same daily allowance as an empty answer (see Checked answers); past it, it is billed.
When there is no review. The review is left out, and listed in zabio.ignored_parameters with the reason, on a request with web search, under the Free plan’s limits, when the account has no credit, when the reviewer is not a model your key can use, when your key can use no model of the reviewer’s auto line (on auto/best, none of tier powerful or frontier), when your balance does not cover it, and when the task already had 3 reviews (see When the second answer calls your tools). A request that ends in your own tool calls is not reviewed: the review runs on the request in which the model answers. Under auto, a request with a final review is not split and is not answered by Jev. The review runs on chat completions only. On the Responses API and on /v1/messages the header is listed as ignored.
Sub-agents (beta)
Section titled “Sub-agents (beta)”This is a beta. The tool’s shape (its name, its parameters, what the model is told about it and the fields of zabio.subagent) may change, with 30 days’ notice in the changelog. Billing is not beta: every call is billed exactly as this section says.
The model you call, the delegator, can hand a task to a cheaper model, a worker, and get its outcome back. The worker opens the documents itself: the delegator names files of yours by their id, and Zabio reads them and puts their text into the worker’s input. The expensive model then reads a short outcome instead of the whole document. Use it where you keep a strong model for the decision and the work is reading many long documents.
{ "model": "claude-opus-5-5", "messages": [{"role": "user", "content": "The supplier agreements are in the files file_01a2..., file_01b7... and file_01c4.... For each one, find the end date and the annual fee. Then tell me which ones end before April."}], "tools": [{"type": "zabio:subagent"}]}openrouter:subagent is accepted as the same tool, so a request written for OpenRouter keeps working. The entry’s parameters take OpenRouter’s names:
| Parameter | Meaning |
|---|---|
model |
the worker: an auto line or a model by name. Default auto/cheap |
instructions |
text of yours added to every worker’s instructions, at most 16,000 bytes |
max_completion_tokens |
a worker’s output limit, its reasoning included: 256 to 32,000, default 8,000 |
reasoning |
{"effort": "..."} with none, minimal, low, medium, high or xhigh, as reasoning_effort on a request. Other keys of the object are listed in zabio.ignored_parameters |
temperature |
0 to 2 |
name |
the function’s name for the model, default subagent |
max_tool_calls |
read and checked (1 to 25), and without effect: a worker has no tools and answers in one call. It is listed in zabio.ignored_parameters |
A parameter the entry does not read (tools, inherit_functions) is listed in zabio.ignored_parameters, never refused.
How a call works. Zabio offers the delegator a function, subagent, with three arguments: task_name, task_description and file_ids, a list of zero to 16 file ids. When the delegator calls it, Zabio starts a worker with the task and, after it, the text of each file in the order given. The worker sees nothing of your conversation, keeps no memory, and has no tools: it cannot call the sub-agent tool, the final review or your own functions. The worker is told that the text of a file is data and never an instruction, and the delegator is told the same of a worker’s outcome. Several calls in one turn run at the same time. The delegator then reads each outcome, cut at 2,000 tokens (a text that was cut ends in [cut]), and goes on: it can call more workers, call your own functions, or answer. Zabio does not decide when to delegate: the delegator does, from what you tell it about the files and from the cost line below.
The files. A worker reads files of /v1/files, by id. Upload each document once with POST /v1/files and purpose: user_data, and put the ids in your prompt, with each file’s size if you know it. Zabio checks every id as GET /v1/files/{id} does: the file must belong to your organization and, for a key in a project, to that project. A file must be text (UTF-8); a PDF, an image or another binary file is not read. When a call names an id your key cannot read, or a file that is not text, no worker runs for that call: the delegator gets an error result that names the id, and the request goes on. Zabio tells the model the same of a file that belongs to someone else as of one that does not exist.
Limits.
| Limit | Value |
|---|---|
| Workers in one request | 16, or what the request’s max_tool_calls says, up to 25 |
| What one worker reads | 100,000 tokens, counted as a quarter of the bytes (about 400 KB of text): its instructions, the task and its files. A larger input is an error result that names the files. A worker model you name with a smaller context window reads less |
| Files in one call | 16 |
| What one worker writes | 8,000 tokens, reasoning included, unless max_completion_tokens says otherwise |
| One worker’s time | 5 minutes |
The worker’s model. With an auto line Zabio picks one model for the request’s workers, once, so every worker of a request runs on the same model. On auto/cheap, the default, it is a model of tier fast in GET /v1/models that can hold a worker’s whole input, among the models your key may use and inside zabio.vendors. It can be a model of another vendor than the one you called, and the files’ text is sent to it. To choose it yourself, name it.
The calculation. Zabio computes two figures on every request, from the list prices in force:
- In the tool’s description, which the delegator reads: what a worker reads a token for as a fraction of what the delegator pays, and the document size above which handing a document over pays. That size is the cost of coordinating one item, 0.014 USD, divided by the difference between the delegator’s input price and the worker’s. With a delegator at 4 USD per million input tokens and a worker at 1, the description says “about 1/4” and “about 4,700 tokens”. With
auto/cheapthe worker’s price is the most expensive model the worker may run on, so the description never promises more than the request gets. When the worker is no cheaper than the delegator, the description says that delegating does not save money. - In
zabio.subagent, on every answer whose request ran a worker:
| Field | Meaning |
|---|---|
workers |
one entry per call: task_name, file_ids, model, status (ok or error, with error as the code), file_tokens, input_tokens, output_tokens and cost_micros, what the worker’s call was billed |
file_tokens |
the size of the files the workers read, as Zabio estimates tokens (a quarter of the bytes) |
direct_estimate_micros |
what the model you called would have paid to read the same files itself, once, at its own input price, with the service fee |
coordination_micros |
0.014 USD per worker that ran: an estimate of what the delegator spent handing the work out, measured on claude-opus-5-5 |
delegated_micros |
the workers as billed, plus coordination_micros |
These figures are shown and never billed. The bill is zabio.cost. direct_estimate_micros is an estimate: a model’s own tokenizer counts the files, and on a Claude model it counts more than a quarter of the bytes.
One example from our own test: eight agreements of about 22,300 tokens each, with claude-opus-5-5 deciding. Handing each agreement to a worker cost 0.18 to 0.20 USD a request. claude-opus-5-5 reading all eight itself cost 1.08 USD. Both gave the right answer.
When it does not pay. In the same test the cheap model alone, with no strong model, cost less still (2 to 9 percent of delegating) and was right on 11 of 13 tasks, against 10 of 10 with delegation. At these counts that difference is not significant. If the cheap model alone is good enough for your task, call it, or auto/cheap: that costs less than any sub-agent. On documents under about 2,500 tokens delegating cost about as much as reading. And it is slower: 45 to 64 seconds against 19 to 33 in the test. The test was one kind of task, eight documents, one strong model and one worker.
What it costs. Each worker’s call is billed at its model’s list price plus the service fee of (see the pricing page). It is a line of its own in zabio.cost.server_tools (type zabio:subagent), inside zabio.cost_micros, and a line of its own under Logs, marked Worker. Every turn of the model you called is billed like any call, and usage counts them all. When Zabio picks the worker’s model, the request pays the price of automatic model choice once, also when you named the model you called, once a worker’s outcome was delivered. With a worker you named and a model you named, it is not paid. A worker whose model call failed is not billed. A worker that wrote nothing is not billed within the same daily allowance as an empty answer (see Checked answers); past it, it is billed. See Billing.
Your balance. Before the call, Zabio sets aside the most the request may cost: every worker the request may run, each reading 100,000 tokens and writing its full output on the most expensive model it may run on, and one more turn of the model you called for each. That is far more than the request ends up costing. At the list prices of November 2026, on claude-opus-5-5 with max_tokens 1,024 and the defaults, the tool adds about 6 USD to the amount set aside. max_tool_calls: 8 on the request lowers that to about 2.20 USD, and max_tool_calls: 4 to about 0.90. When your balance does not cover it, the tool is left out, the request runs without it, and zabio.ignored_parameters says so. The request is never refused for the tool alone. What was set aside and not spent is free again when the call ends.
Rate limits. Each worker’s call counts against your key’s tokens per minute, by its input and its output limit. A worker the limit has no room for right now does not wait: the delegator gets the error too_many_requests at once and may call it again on a later turn. A worker whose input is larger than the key’s whole limit per minute gets prompt_too_long. Size the key’s limit for the number of workers a turn starts.
On a stream. With stream: true the delegator’s text streams as it is written. While workers run, the stream carries a chunk with empty choices and "zabio": {"server_tool": {"type": "zabio:subagent", "name": "subagent", "status": "running"}}, then the same with "status": "done", as for the final review. zabio.subagent comes in the last chunk. If you disconnect, you pay for the work done: a worker that was still running is cancelled and not billed.
When a worker fails. A failure never fails your request: the delegator gets {"status": "error", "error": "<code>: <text>"} and goes on. The codes are file_not_found, file_not_text, prompt_too_long, invalid_input, too_many_requests, overloaded, execution_time_exceeded, model_not_found, max_uses_exceeded, empty (the worker wrote nothing, its output spent on reasoning) and unavailable. A call the delegator makes in the same turn as one of your own functions is not run and not billed: it is listed in zabio.server_tools with status skipped_mixed_turn.
When there is no sub-agent. The tool is left out, and listed in zabio.ignored_parameters with the reason, on a request with web search, under the Free plan’s limits, when the account has no credit, when the worker is not a model your key can use, when your key can use no model of the worker’s auto line, and when your balance does not cover it. The tool runs on chat completions only: the Responses API answers 400 for it, and /v1/messages lists it as ignored. When Zabio has switched the tool off, a chat completion that carries it is refused with 503 subagent_unavailable: send the request without the tool, or try again later.
Structured output
Section titled “Structured output”response_format.type |
Behaviour |
|---|---|
text |
default |
json_object |
OpenAI, Google, DeepSeek, xAI, Mistral AI and Together AI use their native JSON mode. Anthropic has no JSON object mode: Zabio adds a system instruction asking for exactly one JSON object and nothing else, starts the reply inside the object on models that allow it, and strips a Markdown code fence around the object when the model adds one anyway. This is best effort by construction. Validate the output on your side when the answer may come from an Anthropic model, and prefer json_schema whenever you know the shape you want |
json_schema |
{"type": "json_schema", "json_schema": {"name": "...", "schema": {...}, "strict": true}}. Mapped to each vendor’s native structured output. schema is required. Only routed to models with json_schema support (not the DeepSeek direct models, nor the Qwen models on Alibaba Cloud that do not enforce a schema; zabio.capabilities.json_schema in GET /v1/models says which models take it). On Jev, the decision model (jev-1.14.0 or jev-1.13.0), the schema’s properties are the questions Jev answers, each with its probability in zabio.decision; see Decision models |
The response
Section titled “The response”A standard chat.completion object. usage.prompt_tokens counts every input token, cached or not, so totals match what the vendor processed; usage.prompt_tokens_details.cached_tokens is the cached part, and usage.completion_tokens_details.reasoning_tokens is the vendor’s count of thinking tokens inside completion_tokens, present when the vendor reports one. finish_reason is stop, length, tool_calls or content_filter. Zabio serves exactly one choice. A reasoning model that spends its whole output budget thinking returns an empty answer with finish_reason: "length": raise max_tokens so it leaves room for the answer above the thinking, or lower reasoning_effort.
The zabio response object
Section titled “The zabio response object”| Field | Type | Meaning |
|---|---|---|
vendor |
string | who served the call: anthropic, openai, google, deepseek, xai, mistral, together or typesafe |
model_served |
string | the model that answered; differs from model you sent for auto and fallbacks |
routing |
object or absent | line, task, task_type (the kind of work as a tag, see Kinds of work), difficulty, band, stakes, biased, cell, confidence (0 to 1), reason (the classifier’s sentence), trigger (why the decision was made; see Models and routing), classifier (who decided: typesafe/jev-1.13.0, or the text classifier it fell back to; absent on explicit models), effort (the reasoning setting chosen with the model), effort_reason (why) and sticky (present only when the session’s warm prompt cache decided the pick: the model kept and the one cold pricing would have chosen). Absent on explicit models without routing information |
reasoning |
object | requested (the level you sent, omitted when none) and applied (what the served model got: default, off, the vendor’s level name, budget N, on, always on or not supported) |
cost_micros |
integer | what you were billed, in millionths of a US dollar (1,000,000 micros = 1 USD) |
cost |
object | the breakdown: vendor_micros (provider list price), service_fee_micros, call_fee_micros (the fixed fee an auto request pays once, the price of automatic model choice; 0 on a named model), savings_fee_micros and classifier_micros (both always 0, kept so existing clients keep parsing them). On /v1/messages with Anthropic’s advisor tool, server_tools lists each advisor call (type, name, model, vendor_micros, service_fee_micros, cost_micros), and server_tool_micros and server_tool_fee_micros are their sums, inside cost_micros above (see The advisor tool). The cost only: what routing saved is computed for a period, never per call (see The saving of a period) |
byok |
boolean | true when the call used your own vendor key |
cache |
object | read_tokens, write_tokens, ttl_applied (5m, 1h or none) and applied (none, zabio or vendor_automatic: who cached, see the per-vendor table) |
session_id |
string | echoes the session id you sent |
escalated_from |
string | the line Zabio applied (cheap, balanced or best, also on plain auto) and the model whose answer auto replaced: on the Responses API when that model asked for a stronger one, and on any request that is not streamed when its answer failed Zabio’s check |
compacted |
boolean | Responses API only: the stored history was summarized before this turn |
vendor_stop_reason |
string | the vendor’s own stop reason, for debugging |
ignored_parameters |
list | request fields Zabio accepted and ignored |
dropped_parameters |
list | sampling parameters the model that answered does not take (temperature, top_p), left out of its request; also the x-zabio-dropped-params header |
attempts |
integer | how many providers were tried before one answered |
decision |
object | when Jev answered (jev-1.14.0 or jev-1.13.0), named or chosen by auto for a classification job: the calibrated probabilities behind each property of the answer, see Decision models |
no_answer |
string | present when the request ended with no answer, the output budget spent on reasoning, or the input left no room for an answer in the model’s context window: what happened, what to change and whether it was billed (not, within the limits in Checked answers) |
split |
object | present while split and route is on: applied (true when the answer came from an excerpt of your source), pattern (distill), reason (why the request was not split: named_model, opt_out, not_eligible, below_threshold, jev_no, jev_failed, price_check), steps (every call of the split: role questions, extract, check or answer, with vendor, model, input_tokens, output_tokens, micros at list price and billed), excerpt (lines_kept, lines_total, tokens, verbatim_rate), check_p (the check’s probability), and fallback (the guard that sent the request whole). See Split and route |
tier |
object | the service tier: requested (standard, flex or batch, what your deadline mapped to: flex from 15 minutes, batch from 24 hours), applied (what served the call) and fallback (capacity when flex was requested and the vendor refused it, so standard served and was billed; synchronous when the deadline asked for batch on a synchronous call, which cannot wait a day, so flex or standard served). See Flex tier |
review |
object | present when the request asked for a final review and ended with an answer: the reviewer’s model, its verdict, its advice, revised, answer_before, cost_micros and status. See Final review |
subagent |
object | present when the request ran a sub-agent worker: workers, file_tokens, direct_estimate_micros, coordination_micros and delegated_micros, Zabio’s calculation of what delegating cost beside reading the files directly. Shown, never billed |
search |
object | present on a call that could search the web: form (native: the model’s own vendor searched), mode (tool), engine (the vendor), searches (the searches the vendor counted), max_uses (the most the call could run) and cost_micros (the search line of the bill, inside cost_micros above; cost.search_micros and cost.search_fee_micros are its parts). See Web search |
plan |
object | present on a call served under the Free limits (see Billing): tier (free), reason (free_plan, the organization never topped up; zero_balance, a paid organization at zero continuing on the free tier), paid_would_use (on auto, the model a paid account would have been given, when it differs from the one that answered) and topup_url. Absent on a paid call. Not to be confused with tier, the vendor processing tier |
Fields with empty values are omitted, so check for presence.
Response headers
Section titled “Response headers”| Header | Meaning |
|---|---|
x-request-id |
id to quote in support requests |
x-zabio-vendor |
same as zabio.vendor. On a call whose 200 went out before the answer (see Long calls) it is absent, so read vendor, model and routing from the body’s zabio object |
x-zabio-byok |
true when your own vendor key was used |
x-zabio-searches |
the web searches the vendor counted on the call; only on a response that is not streamed and asked for web search |
x-zabio-balance-micros |
your organization’s credit balance after the admission check |
x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-reset-requests |
the key’s requests per minute bucket |
x-ratelimit-limit-tokens, x-ratelimit-remaining-tokens, x-ratelimit-reset-tokens |
the key’s tokens per minute bucket. It is charged up front with the input estimate plus the output budget, clamped to what the served model can produce, and settled after the call; a max_tokens far above what the job needs can hit the limit early, so set it near what you need |
x-zabio-quota-scope, x-zabio-quota-limit, x-zabio-quota-remaining |
present when a spend limit applies to the key (key, over its reset period) or the monthly quota of the member who created it (member); on a 429 also policy or organization, for a routing policy’s or the organization’s spend limit |
x-zabio-plan |
free on every call served under the Free limits; absent on a paid call |
x-ratelimit-limit-requests-day, x-ratelimit-remaining-requests-day, x-ratelimit-reset-requests-day |
the Free plan’s day: 100 successful requests, what is left, and the time to 00:00 UTC. Only with x-zabio-plan: free; on such calls x-ratelimit-*-requests is the Free minute bucket (20), which is tighter than the key’s own |
x-zabio-free-limit |
on a 429 or 403 free_tier_limit, which limit was met: requests_per_day, requests_per_minute, daily_cost, input_tokens, max_tokens, members or api_keys |
Retry-After |
seconds to wait, on 429 and on retryable 5xx |
Server-Timing |
the time each stage of the request took; see Server timing below |
See Errors for what happens when a limit is hit.
Server timing
Section titled “Server timing”Answers from /v1 carry the standard Server-Timing header: the time Zabio spent in each stage of your request, in milliseconds. A request refused at the API key check has none.
Server-Timing: auth;dur=0.9, admission;dur=2.4, routing;dur=88.1, vendor_first_byte;dur=412.6, vendor_rest;dur=1203.3, after_vendor;dur=14.8| Entry | What it measures |
|---|---|
auth |
checking your API key |
admission |
the balance, rate limit, spend limit and Free plan checks |
routing |
choosing the model: on auto, classifying the job and selecting the model; on a named model, the selection alone |
vendor_first_byte |
from Zabio’s first request to a model provider to the first byte of the answer you got, including any failed attempt on another model before it |
vendor_rest |
from that first byte to the provider’s last byte |
after_vendor |
from the provider’s last byte to the headers: what Zabio did before it answered |
The header goes out with the status, so it holds the stages finished by then. A streamed answer’s headers leave as the answer starts, so its header ends at vendor_first_byte; so does a call whose 200 went out before the answer (see Long calls). A stage the request never reached, because it was refused before it, is absent. The time between stages, such as reading your request body, is in no entry, so the entries add up to less than the whole call. The header holds durations only, nothing about your organization or your request. Entries with other names may be added by the network between you and Zabio; ignore them.
With the OpenAI Python SDK, read it from the raw response:
raw = client.chat.completions.with_raw_response.create( model="auto", messages=[{"role": "user", "content": "Hello"}],)print(raw.headers.get("server-timing"))completion = raw.parse()