Command line
zabio signs you in with your browser, lets you pick an organization and an API key, shows usage and prices, manages keys, projects and vendor keys, and chats through the router from the terminal.
Install
Section titled “Install”The CLI is a single Go binary. Build it from the source repository:
go build -o bin/zabio ./cmd/zabioThen put bin/zabio on your PATH.
First run
Section titled “First run”zabio login # prints a URL and a code, opens the browser, waits for approvalzabio orgs # your organizationszabio use acme # select one (done for you when there is exactly one)zabio keys create --name laptopzabio keys use key_... # paste the key once; it is stored in the config file (mode 0600)zabio chat "Summarize the OpenAI chat completions API in one line"zabio usagezabio keys use zb_live_... right after keys create also works: the CLI finds the key by its prefix.
Commands
Section titled “Commands”usage: zabio [--config PATH] [--json] COMMAND [ARGS]
Commands: login sign in with the browser (device flow) logout revoke the session token and forget it whoami show the signed-in user orgs list your organizations use ORG_SLUG select the organization for later commands keys list|create|revoke|use manage API keys of the selected organization (list --project P: one project's keys) projects list|create manage projects (only the owner creates them) members list list members of the selected organization members invite EMAIL [--role member|admin] [--project P]... invite someone, optionally limited to projects members projects EMAIL [--project P]... limit a member to projects (none: all of them) usage [--month YYYY-MM | --days N] [--project P] spend summary and by-model breakdown models models and prices billing [show|ledger|topup] credits, ledger, add credits through Stripe vendor-keys [list|add|remove] your own vendor API keys (BYOK) conversations [list|show|delete] stored conversations (metadata only) chat --new | --conversation conv_... stateful chat through /v1/responses chat [--model M] [--system S] [--session ID] [MESSAGE] chat through the router (interactive without MESSAGE) tokens list|create|revoke manage your CLI tokens version print the version
Flags: --config PATH config file (default ~/.config/zabio/config.json) --json print the raw response JSON instead of tables
Environment: ZABIO_API_BASE, ZABIO_INFERENCE_BASE override the config file.Sign in and identity
Section titled “Sign in and identity”| Command | What it does |
|---|---|
login [--no-browser] |
device flow: prints a verification URL and a code, opens the browser, waits for approval and stores a user token (zbu_...) |
logout |
revokes the token on the server and forgets it locally |
whoami |
your user, how you are signed in, your organizations, the selected organization and key |
tokens list, tokens create --name N [--scopes a,b], tokens revoke ID |
your CLI tokens. Create prints the token once |
Organizations, keys, projects, members
Section titled “Organizations, keys, projects, members”| Command | What it does |
|---|---|
orgs |
lists your organizations; the selected one is marked with * |
use ORG_SLUG |
selects the organization. Switching clears the selected API key, because keys belong to one organization |
keys list [--project P] |
keys of the organization, or of one project; the one in use is marked with *. A member limited to projects sees only theirs |
keys create --name N [--project P] |
creates a key and prints it once. P is a project id (prj_...), slug or name |
keys revoke KEY_ID |
revokes a key |
keys use KEY_ID [--key PLAINTEXT] [--yes] |
stores a key locally for zabio chat. Asks for the key with hidden input unless --key is given, checks it against the key’s prefix, and asks for confirmation unless --yes |
projects list, projects create --name N |
projects; only the organization’s owner creates them |
members list |
members with role, projects, monthly quota and spend this month |
members invite EMAIL [--role member|admin] [--project P]... |
invites someone by email. Each --project limits a member to that project; without one they see the whole organization |
members projects EMAIL [--project P]... |
changes the projects a member is limited to; with no --project the member sees the whole organization again |
zabio chat --model auto/balanced --system "Answer in Spanish" "What is prompt caching?"zabio chat --session support-42 "Second question in the same routing session"zabio chat # interactive; Ctrl-D or "exit" leaveszabio chat --new "Start a stored conversation"zabio chat --conversation conv_... "Continue it"chat streams the answer and then prints one dim line on stderr: model served, vendor, cost, cached tokens and elapsed time. Without a message it runs a prompt loop that keeps the history in memory and resends it each turn. --new and --conversation use the Responses API instead: the server keeps the history, the CLI prints the conversation id the first time, and the status line adds escalated from ... or compacted when those happened.
Usage, models and billing
Section titled “Usage, models and billing”| Command | What it does |
|---|---|
usage [--month YYYY-MM | --days N] [--project P] |
billed, direct cost, saved, calls, tokens, average latency, and a by model table, for the organization or one project. Default: current month to date, UTC |
models |
every model with your organization’s list prices in USD per million tokens |
billing or billing show |
balance, low balance warning, lifetime top-ups, whether the trial was credited, plan and minimum top-up |
billing ledger [--limit N] |
the credit ledger, newest first (1 to 500 rows) |
billing topup --amount USD [--no-browser] |
creates a Stripe Checkout link for that amount and opens it. The balance updates when the payment completes |
vendor-keys list, vendor-keys add --vendor anthropic|openai|google [--label L], vendor-keys remove vk_... |
your own vendor keys (Own keys). add reads the key with hidden input and verifies it with the vendor |
conversations list [--key key_...] [--limit N], conversations show conv_..., conversations delete conv_... |
stored conversations, metadata only. delete uses the selected API key and is permanent |
Output
Section titled “Output”--json on any command prints the raw response body instead of the human view. Commands that make two calls print one object with both bodies (whoami: {"me", "session"}; usage: {"summary", "by_model"}). chat --json prints one raw event payload per line.
zabio usage --days 7 --json | jq .summary.totals.saved_microszabio keys list --json | jq -r '.data[] | [.id, .name] | @tsv'Configuration
Section titled “Configuration”The config file is ~/.config/zabio/config.json (mode 0600; $XDG_CONFIG_HOME is honored). It holds the API base URLs, your user token, the selected organization and the selected API key. --config PATH or ZABIO_CONFIG selects another file. ZABIO_API_BASE and ZABIO_INFERENCE_BASE override the two base URLs for one invocation and are never written back.
No command prints your user token or API key except tokens create and keys create, which show the new secret exactly once.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | success |
| 1 | the server answered with an error; printed as error: <message> (<code>) |
| 2 | the server could not be reached or answered something unreadable |
| 64 | bad arguments; the usage text follows |