Most agent bills are not output problems. They are input problems wearing an output costume.
A coding agent reads a repo, a tool schema, a diff, a stack trace, and twelve previous turns before writing twenty lines. An eval harness replays the same prompts every run. A browser agent re-sends page state on every step. In all three, the ratio of input to output tokens is roughly 4:1, and sometimes worse. Optimizing the output side is optimizing the cheap side.
This post is about the bill math at that shape, the two wire protocols that let an existing client move without a rewrite, and a routing policy that puts each kind of traffic on the model that fits it.
The bill at 4:1
Here are list prices per million tokens, and what a 4:1 read/write block — 4M input + 1M output — costs. The baseline is OpenAI GPT-6.2 Sol at $2.00 input / $10.00 output.
| Model | Input $/1M | Output $/1M | 4:1 block (4M in + 1M out) | vs GPT-6.2 Sol |
|---|---|---|---|---|
| GPT-6.2 Sol | 2.00 | 10.00 | 18.00 | — |
| DeepSeek-V4.1-Flash | 0.30 | 1.20 | 2.40 | −86.7% |
| GLM-5.3 | 1.20 | 4.20 | 9.00 | −50.0% |
| Qwen3.8-Max | 2.00 | 6.00 | 14.00 | −22.2% |
| Kimi K3.1 Pro | 2.00 | 10.00 | 18.00 | 0.0% |
Two rows are deliberately unflattering. Kimi K3.1 Pro is at parity with GPT-6.2 Sol on a 4:1 mix. Qwen3.8-Max is only 22% cheaper. If you route everything to the most expensive Chinese model, you have changed vendors, not economics.
The savings come from routing, not from a single model being magic. A realistic agent mix — 55% DeepSeek-V4.1-Flash, 25% GLM-5.3, 12% Qwen3.8-Max, 8% Kimi K3.1 Pro — lands at $6.69 per 4:1 block, or −62.8% against the same mix on GPT-6.2 Sol. Push more volume to DeepSeek and GLM and it goes lower; push more to Kimi and it converges back to the baseline.
At a monthly shape of 1B input tokens + 250M output tokens, the same arithmetic looks like this:
| Route | Monthly bill | vs GPT-6.2 Sol |
|---|---|---|
| GPT-6.2 Sol | $4,500 | — |
| All DeepSeek-V4.1-Flash | $600 | −86.7% |
| All GLM-5.3 | $2,250 | −50.0% |
| All Qwen3.8-Max | $3,500 | −22.2% |
| All Kimi K3.1 Pro | $4,500 | 0.0% |
| 55/25/12/8 routed mix | $1,672.50 | −62.8% |
That is the argument in one table. The 40–65% range is a property of the mix, not of a model.
Two protocols, one catalog
The client surface is already standardized, so this is routing, not a rewrite. Two shapes matter:
-
OpenAI shape:
POST /v1/chat/completions, used by the OpenAI SDKs, Cline, Roo Code, OpenCode, and most in-house agent loops. -
Anthropic shape:
POST /v1/messages, used by Claude Code and anything built on the Messages API, includingtool_use.
Both are native here, not translated at the edge. The same API key and model catalog serve both.
OpenAI SDK:
from openai import OpenAI
client = OpenAI(base_url="https://flintapi.ai/v1", api_key="<key>")
resp = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Refactor this function and run the tests."}],
tools=[...],
stream=True,
)
Anthropic SDK, including tool use:
import anthropic
client = anthropic.Anthropic(base_url="https://flintapi.ai", api_key="<key>")
msg = client.messages.create(
model="glm-5.3",
max_tokens=2048,
messages=[{"role": "user", "content": "Extract the clauses into this JSON schema."}],
tools=[...],
)
For Claude Code, the environment variable is the whole migration:
export ANTHROPIC_BASE_URL="https://flintapi.ai"
export ANTHROPIC_AUTH_TOKEN="<key>"
What matters in an agent loop is not the happy-path 200: real SSE frames, tool_use / tool_calls preserved end to end, chain-of-thought kept out of the visible answer, reasoning tokens in their own field, and usage on both protocols. In our compatibility pass, both surfaces returned 45/45 successful streaming responses on the three models tested, and the Anthropic path produced its first SSE frame at 1.88s. Typical first-token latency on the current fleet is 1.3–2.5s, with frontier reasoning models at the higher end.
The routing policy
The policy is boring: classify, pick one primary, keep one fallback, never let the expensive model win by default.
| Traffic | Primary | Fallback | Why |
|---|---|---|---|
| Tool-loop coding, repo edits, test-fix cycles | deepseek-v4.1-flash |
glm-5.3 |
Input-heavy, latency-sensitive, cost per solved task dominates |
| Long-context review, 100k+ token specs | kimi-k3.1-pro |
glm-5.3 |
Only slice where the long-context premium pays for itself |
| Bilingual / schema-constrained extraction | glm-5.3 |
qwen3.8-max |
Strict JSON and mixed-language inputs |
| Multilingual analysis, general chat | qwen3.8-max |
glm-5.3 |
Capability tier, not the cost play |
| Anything unmatched | deepseek-v4.1-flash |
glm-5.3 |
Explicit default; never implicit |
A minimal router is a function over three signals: estimated input tokens, whether the request carries tools, and the CJK ratio of the prompt. If tokens > 100_000, try Kimi. If tools is non-empty and the task is code, use DeepSeek. If the response must match a schema, use GLM. Otherwise default to DeepSeek.
Two rules keep it from becoming a latency lottery: one pinned upstream per key, so prompt caches survive mid-session, and billing that follows the model that actually served the call.
What we measured, and what we did not
The numbers above are list-price arithmetic, not a benchmark of answer quality. What we actually measured is narrower: protocol compatibility (45/45 on each surface), first-token latency (1.88s on the Anthropic path; 1.3–2.5s typical), tool-call round trips, and per-request usage. We did not run a head-to-head quality eval against GPT-6.2 Sol for your workload, and we would not pretend a list-price table proves one.
Prompt caching is passed through only when the upstream reports cached tokens; otherwise the field is null, not 0 — a missing measurement is not a zero.
Where this does not fit
Three cases, stated plainly.
Low-end traffic. If your workload runs on GPT-6 Luna-class models at low per-token prices, the migration overhead is larger than the savings. The 4:1 math still holds, but the absolute dollars are too small to justify a compatibility pass. Stay where you are.
You need OpenAI-only features. Moderation, batch, realtime audio, and fine-tuning are not part of this surface. If they are load-bearing, this is not a drop-in.
You need cross-provider failover. deepseek-v4.1-flash and glm-5.3 have primary/standby upstreams; the gateway switches on primary failure. It never retries a stream mid-way. qwen3.8-max / kimi-k3.1-pro are single-upstream. If your SLA needs cross-provider DR for all models, this is not yet the right layer.
Check your own ratio: if generation dominates, the table stops being useful. Recompute before migrating.
The $0, 24-hour Go-No-Go
Send one real agent workflow. We run it against the four models at your token shape, compare it to your current bill, and return one page: cost per task, the routing mix that holds quality, and the compatibility issues. If it does not hold, the answer is no.
It is $0, it takes 24 hours, and it does not require a meeting. That is the whole offer: flintapi.ai.
Top comments (0)