TokenZero
v0.3.0Ledger of record for AI spend: verifiable receipts, waste auditor & model arbitrage MCP.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
try_tokenzero Try TokenZero (no key needed)
Call this first: no API key, no signup, no setup. Shows what TokenZero would do to one of your LLM calls: it runs the four savings engines (prompt-cache formatting, edge cache, cascade advice, signed receipt) on a sample or your own prompt and model, and returns the list-price saving, the signed receipt and a copy-paste keyless curl that makes a real call on a free model. Pass {} for the default, or {"model": "gpt-6.1-sol", "system": "...", "prompt": "..."}. Runs in the TokenZero service; send no secrets in the prompt.
| Parameter | Type | Description |
|---|---|---|
model | string | a priced model id; default gpt-6.1-sol |
prompt | string | your user message (optional) |
system | string | your system prompt (optional) |
audit_repo_token_waste Audit a repo or directory for LLM token waste
No API key needed. Static audit for LLM token waste: uncached static prompts and prompt templates, frontier models on extraction/classification prompts, calls in loops, unpriced models, and prompt-caching mis-integration (caching gated on model names, volatile values in the system prompt, random ids in history, wrong-provider cache markers, misplaced breakpoints, cost math that ignores cached tokens). Give `path` for a local directory (scanned on this machine, nothing uploaded; defaults to the working directory), `repo` (owner/name) for a public GitHub repo, or `diff` for a unified diff. Resul…
| Parameter | Type | Description |
|---|---|---|
diff | string | unified diff text, e.g. from git diff |
path | string | local directory; defaults to the current working directory |
repo | string | public GitHub owner/name |
calculate_model_arbitrage Price a workload across models
No API key needed; only `model` is required (defaults 2,000 tokens in and 400 out). Price a workload at list prices for the requested model, its cheaper sibling and any extra models, with and without prompt caching. Runs locally.
| Parameter | Type | Description |
|---|---|---|
model * | string | model id, e.g. gpt-6.1-sol or claude-sonnet-5-5 |
compare_to | array | |
input_tokens | number | per request; default 2000 |
output_tokens | number | per request; default 400 |
requests_per_month | number | |
static_tokens | number | portion of input_tokens that is a fixed prefix (system + tools) |
optimize_prompt_payload Make a request body cache-friendly
Rewrite an OpenAI Chat/Responses or Anthropic Messages request body so its static prefix is provider-cacheable, and project the saving. Sends the body you pass to the TokenZero service (set TOKENZERO_URL); do not pass secrets in it.
| Parameter | Type | Description |
|---|---|---|
body * | object | |
endpoint | string | |
strategy | string |
workspace_metrics Read a workspace savings scorecard
Live value scorecard for a TokenZero workspace (GET /v1/workspaces/me/metrics): hard savings and net ROI per window, per-engine contribution, speed, parity, availability, privacy posture, per-model breakdown and one-click recommendations. Uses TOKENZERO_KEY unless a key is given; demo: true returns a labelled sample.
| Parameter | Type | Description |
|---|---|---|
demo | boolean | |
key | string | workspace key (tz_live_…); defaults to TOKENZERO_KEY |
window | string |
provision_workspace Create a free TokenZero workspace
Create a TokenZero workspace and key with no form (POST /v1/workspaces on the TokenZero service). Returns the key once, the base URLs that route through it, the one-click dashboard link (key in the URL fragment, never sent to the server) and the badge URL. Free up to the monthly free tier; nothing is billed.
| Parameter | Type | Description |
|---|---|---|
name | string | workspace name (defaults to "mcp-agent") |