Quickstart
Zabio is an OpenAI compatible API. You keep your SDK and change two things: the base URL and the API key. One key gives you Anthropic, OpenAI, Google, DeepSeek, xAI, Mistral AI and Together AI models, plus the auto models that pick the cheapest model able to do the job.
Base URL
Section titled “Base URL”| Host | Use |
|---|---|
https://api.zabio.ai/v1 |
default; resolves to the US region |
https://api-us.zabio.ai/v1 |
the US region by name |
Both hosts serve the same API. Use the second one when you want to be explicit about the region.
Your API key
Section titled “Your API key”Create a key in the web app under API keys, or with the CLI (zabio keys create --name laptop). A key looks like zb_live_ followed by 43 letters and digits. It is shown once; store it in a secret manager or an environment variable, never in code.
Send it as a bearer token:
Authorization: Bearer zb_live_...Some SDKs send the key in an x-api-key header instead. Zabio accepts that too.
First call with curl
Section titled “First call with curl”curl https://api.zabio.ai/v1/chat/completions \ -H "Authorization: Bearer insert your zabio.ai key here" \ -H "Content-Type: application/json" \ -d '{ "model": "auto", "messages": [{"role": "user", "content": "Say hello in one sentence."}] }'The answer is a standard chat.completion object with one extra field, zabio, that tells you which model answered and what the call cost:
{ "id": "chatcmpl-...", "object": "chat.completion", "model": "gpt-5.4-nano", "choices": [{"index": 0, "message": {"role": "assistant", "content": "Hello! ..."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21}, "zabio": { "vendor": "openai", "model_served": "gpt-5.4-nano", "routing": {"line": "balanced", "task": "conversation", "task_type": "conversational_reply", "difficulty": 1, "band": "easy", "stakes": "normal", "cell": "conversation/easy", "confidence": 0.93, "reason": "short greeting", "trigger": "no_prior_decision"}, "cost_micros": 265, "cost": {"vendor_micros": 14, "service_fee_micros": 1, "call_fee_micros": 250, "savings_fee_micros": 0, "classifier_micros": 0, "direct_micros": 330, "saved_micros": 65}, "cache": {"read_tokens": 0, "write_tokens": 0, "ttl_applied": ""} }}Python (openai SDK)
Section titled “Python (openai SDK)”from openai import OpenAI
client = OpenAI(base_url="https://api.zabio.ai/v1", api_key="insert your zabio.ai key here")
stream = client.chat.completions.create( model="auto", messages=[{"role": "user", "content": "Say hello in one sentence."}], stream=True, extra_body={"zabio": {"session_id": "demo-1"}},)for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) if chunk.usage: print("\n", chunk.model_extra.get("zabio"))The Python SDK rejects unknown keyword arguments, so Zabio’s options travel in extra_body. Everything else is a normal argument.
Node (openai SDK)
Section titled “Node (openai SDK)”import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.zabio.ai/v1", apiKey: "insert your zabio.ai key here" });
const stream = await client.chat.completions.create({ model: "auto", messages: [{ role: "user", content: "Say hello in one sentence." }], stream: true, zabio: { session_id: "demo-1" },});for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); if (chunk.usage) console.log("\n", chunk.zabio);}The Node SDK passes unknown body fields through, so zabio can go straight in the request.
Zabio options at a glance
Section titled “Zabio options at a glance”Two fields you will use on almost every request, inside the zabio object (or as headers):
{ "model": "auto", "messages": [{"role": "user", "content": "Summarize this ticket."}], "zabio": { "session_id": "support-4711", "cache": {"ttl": "1h"} }}session_id groups the calls of one conversation so the routing decision is reused instead of recomputed, and escalation has the history. cache.ttl keeps your prompt prefix in the vendor’s cache for 5 minutes or 1 hour where the vendor offers it, so repeated turns pay the cached price; a long prompt sent once is not written. The same values travel as headers x-zabio-session-id and x-zabio-cache-ttl. The other options (vendors, fallback) and the three lines (auto/best, auto/balanced, auto/cheap) are in the API reference.
What to read next
Section titled “What to read next”- Models and routing: the three lines, how a job is classified, prices.
- Chat completions: every field Zabio accepts and returns.
- Errors: the error envelope and what each code means.
- Command line: the
zabioCLI.