Change one line.
Pay less for the same model.
TokenZero sits between your code and OpenAI, Anthropic or Gemini. Your API key passes straight through — we never hold it and never spend it. On the way we make your prompts cache-friendly, serve exact repeats from the edge in under 10 ms, and hand you a signed receipt for every dollar saved.
from openai import OpenAI
client = OpenAI(
base_url="https://tokenzero.sh/v1", # ← the only change
api_key=os.environ["OPENAI_API_KEY"], # your key, passed straight through
)
r = client.chat.completions.create(model="gpt-6.1-sol", messages=[...])from anthropic import Anthropic
client = Anthropic(
base_url="https://tokenzero.sh", # ← the only change
api_key=os.environ["ANTHROPIC_API_KEY"],
)
r = client.messages.create(model="claude-opus-5-5", max_tokens=16000, system=SYSTEM, messages=[...])
# cache_control breakpoints are injected for you; usage.cache_read_input_tokens goes up on the 2nd callimport { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";
const openai = createOpenAI({ baseURL: "https://tokenzero.sh/v1" }); // ← the only change
const { text } = await generateText({ model: openai("gpt-6.1-sol"), prompt });from langchain_openai import ChatOpenAI from langchain_anthropic import ChatAnthropic llm = ChatOpenAI(model="gpt-6.1-sol", base_url="https://tokenzero.sh/v1") llm = ChatAnthropic(model="claude-sonnet-5-5", base_url="https://tokenzero.sh")
# Most SDKs read these; nothing in your code changes. export OPENAI_BASE_URL="https://tokenzero.sh/v1" export ANTHROPIC_BASE_URL="https://tokenzero.sh" export GOOGLE_GEMINI_BASE_URL="https://tokenzero.sh" # google-genai SDKs (native API); keep GEMINI_API_KEY
from google import genai
client = genai.Client(http_options={"base_url": "https://tokenzero.sh"}) # ← the only change
r = client.models.generate_content(model="gemini-4-argon", contents="Summarize: ...")# Claude Code claude mcp add --transport http tokenzero https://tokenzero.sh/mcp # Cursor / Windsurf / Cline — add to mcp.json { "mcpServers": { "tokenzero": { "url": "https://tokenzero.sh/mcp" } } } # then: "audit this repo for token waste" / "make this prompt cache-friendly"
Four engines, zero trust required
Everything below is deterministic and inspectable. Nothing is on by default that could change what your model sees.
1 · Prompt-cache formatter on by default
Providers discount input tokens they can match as a prefix of an earlier request — Anthropic needs explicit cache_control breakpoints, OpenAI's older models a stable prompt_cache_key. Most code never sets them. We add them to the static part of the request (tools → system) without changing a single token. Cache reads are 75–97% cheaper than fresh input depending on model.
2 · Exact & semantic edge cache exact on by default
Byte-identical, deterministic requests (temperature: 0 or a seed) are served from our cache at $0 and <10 ms. Responses with tool calls are never cached. Near-duplicate matching (SimHash on the dynamic part of the prompt, same system/tools) is opt-in with X-TokenZero-Semantic-Cache: true.
3 · Cascade router opt-in
A deterministic classifier scores how simple each request is (extraction, classification, JSON formatting, short summaries). By default it only tells you — X-TokenZero-Cascade-Recommendation on the response. With X-TokenZero-Cascade: auto it routes confident cases to the model's cheaper sibling. Nothing about output parity is promised; an opt-in shadow monitor that measures it on your own traffic is coming.
4 · Signed savings ledger always
Every request logs the list-price baseline for the model you asked for and the actual cost from the provider's own usage report. The difference is signed with Ed25519; the public key is at /.well-known/tokenzero.json, so anyone can verify a badge. Streams are measured from the stream's own usage events.
Simulator
Paste a system prompt and a typical user message, or start from a preset. Same tokenizer, pricing table and classifier as the live gateway.
Results appear here. Try a 1,500-token system prompt with a classification-style user message to see all three engines engage.
Pricing
You cannot lose money on this: every paid plan is a share of savings the signed ledger proves, with a 3x-ROI-or-$0 rule, and two of them have a hard ceiling. Plans can be chosen today; nothing is charged until billing goes live.
Free
$0. Up to $500/month of routed LLM spend, all four engines, signed receipts, badge, CLI, MCP, GitHub Action. No card.
Performance
15% of verified savings above the free tier, $0 base. If a month's savings are not at least 3x the fee, the fee is $0. Saved $4,700? You pay $705 and keep $3,995.
Pro Cap
15% of verified savings, never more than $199/month, for up to $25k/month of routed spend. Annual prepay $1,790 (25% off). Saved $4,000? You pay $199.
Scale Cap
15% of verified savings, never more than $999/month, for up to $150k/month of routed spend; SSO/SAML, custom SLA, consolidated receipts. Annual prepay $8,990 (25% off).
LLM FinOps leaderboard
Workspaces by verified savings over the last 30 days. Anonymous workspaces are listed by suffix.
| # | Workspace | Requests | Baseline | Saved | % |
|---|---|---|---|---|---|
| Loading… | |||||
Badge
Add it to a README. It reads live from the ledger and links to the verification page.
[](https://tokenzero.sh/v1/ledger/stats?workspace=<workspace_id>)
Open-source tools
Find token waste before it ships. Apache-2.0, run on your machine or CI runner, no account, and your code is never uploaded. github.com/tokenzero-ai/tokenzero
CLI
npx -y @tokenzero/cli audit .
Scans for uncached static prompts, frontier models on simple tasks and LLM calls in loops. --fail-over 30 turns it into a CI gate.
MCP server
claude mcp add tokenzero -- npx -y @tokenzero/mcp
Lets your coding agent audit the repo it is working in and price model choices before writing the call.
GitHub Action
- uses: tokenzero-ai/tokenzero/action@v0
Keeps one cost-check comment up to date on each pull request. Setup
Fast by measurement
+1.52 ms median overhead when the request goes to the model; cache hits answered in 1.08 ms instead of a model call.
Audit a public repo
Static analysis of prompt and SDK patterns — no account, no key, read-only.