TokenZero
v0.2.2LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
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": "..."}.
| 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 for LLM token waste
No API key needed. Static-analyze a public GitHub repo (e.g. {"repo": "owner/name"}) or a set of source files for LLM token waste: uncached static prompts, frontier models on extraction tasks, hot loops, non-deterministic repeat calls, 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). Returns findings with fixes and an estimated recoverable percentage.
| Parameter | Type | Description |
|---|---|---|
files | array | Alternative to repo: files to analyze |
repo | string | GitHub owner/name (public) |
optimize_prompt_payload Make a request body cache-friendly
No API key needed. Rewrite an OpenAI Chat/Responses or Anthropic Messages request body so its static prefix is provider-cacheable (Anthropic cache_control breakpoints, OpenAI prompt_cache_key). Returns the optimized body, what changed, the token profile and the projected per-request saving. Never changes the tokens the model sees.
| Parameter | Type | Description |
|---|---|---|
body * | object | The request body |
endpoint | string | |
strategy | string |
calculate_model_arbitrage Price a workload across models
No API key needed; only `model` is required (e.g. {"model": "gpt-6.1-sol"}, defaults 2,000 tokens in and 400 out). Price a workload at list prices across models: cost per request and per month for the requested model, its cheaper sibling, and the effect of prompt caching. The result names the pricing table version it used.
| 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) |
provision_workspace Create a free TokenZero workspace
Create a TokenZero workspace and key with no form. Returns the key once, the base URLs that route through it (OPENAI_BASE_URL / ANTHROPIC_BASE_URL), the one-click dashboard link and the badge URL. Free up to the monthly free tier; nothing is billed.
| Parameter | Type | Description |
|---|---|---|
name | string | workspace name (default mcp-agent) |
workspace_metrics Read a workspace savings scorecard
Live value scorecard for a TokenZero workspace: hard savings and net ROI per window, the four engines' contribution, speed, parity, availability and privacy posture, per-model breakdown and one-click recommendations. Needs the workspace key (tz_live_…); pass demo: true for a labelled sample.
| Parameter | Type | Description |
|---|---|---|
demo | boolean | return the sample scorecard instead |
key | string | workspace key (tz_live_…) |
window | string |