Nine levers cut an LLM bill without changing what the product does, and the first four cost nothing to pull: pick the cheapest model that passes your tests, route each request by task, bill repeated input at the cached rate, and cap the output; the other five are below, each with the catalog figure it moves. Every price on this page renders live from the keyless GET https://api.uplinkswitch.com/v1/catalog, with the developer's list price beside ours.
1. Pick the cheapest model that passes your tests
The biggest lever, and the one this page will not repeat: the method, the input-to-output ratio and the lowest-priced ids per use case are on /cheapest-llm-api-provider. In one line: test your hardest prompts against the cheapest two or three ids, keep the cheapest that passes, and price a month of traffic in the cost calculator rather than one request.
2. Route by task instead of sending everything to one model
Most products pay a frontier model for every request because one request in twenty needs it. Send model: "auto" and the gateway sorts each request into one of the three tiers published in the catalog's auto_router object by looking at the request itself, with no extra model call: reasoning requests and code-with-tools land in frontier; tool use, code, images, schema answers and long prompts (the OpenAPI document puts the line at 16,000 tokens) land in balanced; short plain prompts land in fast. The request bills at the price of the model that answered, and the body's model field names it.
The spread between tiers is the saving. One or two ids from each tier on the reading date:
| Tier | Example id | Our price, in / out per 1M | List |
|---|---|---|---|
| fast | glm-5.3-flash | $0.0873 / $0.1455 | $0.15 / $0.50 |
| fast | deepseek-v4.1-flash | $0.0564 / $0.1692 | $0.30 / $1.20 |
| balanced | claude-sonnet-5-5 | $1.164 / $2.91 | $2.00 / $10.00 |
| balanced | gpt-6.1-sol | $0.582 / $2.91 | $2.00 / $10.00 |
| frontier | claude-opus-5-5 | $2.716 / $9.70 | $4.00 / $20.00 |
| frontier | gpt-6-astra | $3.00 / $15.00 | $10.00 / $50.00 |
auto.tier_max caps the tier ("auto": {"tier_max": "balanced"} never spends frontier money), and a session id keeps one model on a conversation for 30 minutes. For an app whose model name you cannot change, an auto router key sends every request on that key as auto; the setting is on the key's create form and on POST/PATCH /v1/keys. Live tier lists are on /auto-router.
The request field routing is not a cost lever: it orders the routes one model is tried on, and the OpenAPI document is explicit that the charge does not depend on which route answered.
3. Bill repeated input at the cached rate
An agent loop or a long chat resends the same system prompt and history every turn. Where a model has a pricing.cache_read price in the catalog, tokens read from the prompt cache bill at that rate; a model with no cached rate bills them at the input rate, so check the field before you pick. A 20,000-token turn where 18,000 tokens repeat:
| Model | Input rate | Cached rate | 20,000 in + 500 out, nothing cached | 2,000 fresh + 18,000 cached + 500 out |
|---|---|---|---|---|
claude-sonnet-5-5 | $1.164 | $0.075 | $0.0247 | $0.0051 |
gpt-6.1-sol | $0.582 | $0.0582 | $0.0131 | $0.0037 |
deepseek-v4.1-flash | $0.0564 | $0.00625 | $0.0012 | $0.0003 |
Keep the prefix byte-identical and the developer's cache does the rest. On the Anthropic format a large system prompt that several organizations send also gets a cache breakpoint added by the gateway, so that prefix is charged at the cached-read price, with no cache-write premium; only a hash of the prompt is kept, and a request with its own cache_control is left alone.
4. Cap the output
Output is the dear side of every price pair above. max_tokens (or max_completion_tokens) caps what the model may write and also sizes the hold taken from your balance while the request runs; without it, the OpenAPI document says, the hold assumes 4,096 output tokens, which on a frontier model ties up money you will not spend. Set it to what the product can display.
response_format with json_object or json_schema is stricter: the answer is billed only if it matches. A miss is retried once for free, so a parser failure never reaches the bill. The ids whose supported_parameters include response_format are the ones the catalog has verified for it.
5. Turn on the response cache, and let long chats fit
Two savings live on /features/caching. The response cache is opt-in and scoped to your organization: an exact repeat of a request inside the time to live gets the stored answer back with no model call, billed at a tenth of the original charge. Switch it on per request, or as a response_cache_ttl default on the key (60 to 86,400 seconds).
Middle-out compression is the other half: "transforms": ["middle-out"] on the request, or context_overflow on the key, drops whole messages from the middle of a chat that would otherwise overflow the context window; what survives is the system prompt, the opening user message and the newest turn, with each tool call kept beside its result. Dropped messages are never sent, so never billed, and a request that would have failed now succeeds.
6. Price the request before you send it
POST /v1/estimate prices a prompt, a system message or a full messages array on every model at once, with output_tokens as a parameter (default 1000). Without a key it uses public prices; with your key, your organization's own prices and price lock. Input is counted at 4 characters per token plus 4 per message unless you pass input_tokens.
curl https://api.uplinkswitch.com/v1/estimate \
-H "Content-Type: application/json" \
-d '{"system": "You are a support agent for Acme.", "prompt": "Where is my order?", "output_tokens": 300, "models": ["glm-5.3-flash", "gpt-6.1-sol"]}'7. Re-price last month's bill before you move anything
The bill re-pricer at /savings reads a usage CSV exported from OpenAI or Anthropic in your browser, matches each model name to the catalog (exactly, then without a provider prefix, date suffix or -latest) and shows the same tokens at our price beside what you paid. Cached tokens are handled per export format so nothing is counted twice; nothing is uploaded, and files over 25 MB are refused.
8. Find the tokens you did not mean to send
A response's headers carry a waste share once at least a tenth of the prompt is text the model already saw earlier in the same request, or an inline base64 payload. Proper file, image or audio parts are excluded from the share, so a high share means your code is stuffing the prompt with something it should have sent as a part or not at all. The usual culprits are a retry loop re-appending the history and a screenshot pasted as text.
9. Make the worst month a number you chose
None of the above helps if a bug runs overnight, so every key can carry monthly_cap_usd with a spend_limit_period of daily, weekly or monthly, counted on settled charges plus open holds and checked at admission, so parallel bursts stay under it. A key can also carry budget_usd, a one-off budget carved from the balance that does not reset. Budget autopilot is the soft version: a key with a monthly limit can be told which cheaper model from the same developer should take over as spend approaches the cap, instead of refusing; the body's model field shows which model answered.