Accurate AI budgets start with pricing every LLM request correctly

Budgets and cost limits depend on the cost of each LLM request. If a gateway does not price every request by provider, region and pricing dimension, the budgets and limits built on that cost will be wrong.

Rahul Singh, Founder, Multi-Router 8 min read

LLM request pricing is not simple

Every LLM provider publishes a price per million tokens for each model, but the amount on the invoice depends on much more than the token count. The same model costs different amounts depending on which provider serves it and in which region. Cached content is billed at different rates depending on how long the cache is kept. A long prompt can move the whole request to a higher rate, the service tier that handled the request changes its price, and server-side tools such as web search are charged per call. To know what a request actually cost, a gateway has to read each of these details from the provider's response and price them from a catalog that records every model's rates by provider, region and pricing dimension.

Every budget depends on the cost of each request

Budgets, limits and alerts all depend on the cost of each request. A budget caps what a team, an app or a person can spend in a period. A limit stops requests when that cap is reached, and an alert warns someone before it is. When the cost figure is wrong, the budget blocks people too early, lets spend run past the cap, or sends alerts nobody trusts.

Pricing an LLM request looks simple: count the tokens and multiply by the model's price. The provider's invoice does not work that way, and a gateway that prices requests this way produces a cost figure that drifts from the bill, sometimes high and sometimes low. The sections below cover each detail that changes the price of a request, and how Multi-Router calculates it.

A model can have many different prices

Anthropic serves its Claude models directly, and AWS Bedrock and Google Vertex serve the same models in several regions each. Each of those offerings has its own price list. Each price list has separate rates for input, output, cache reads, cache writes and batch requests, and some models add higher rates for long prompts.

The region a request runs in is part of its price. Anthropic's US data-residency endpoint, Bedrock's geography-scoped endpoints and Vertex's regional endpoints cost about 10% more than the global endpoint for the same model. A team that sends traffic to a US-only endpoint for compliance pays that difference on every request.

Many gateways store prices as a flat list of key-value pairs for each model. The customer has to work out which key applies to which provider, which region and which kind of request. Multi-Router's model catalog is structured instead. Each model lists the providers that offer it, each provider lists its regions, and each region holds a named rate for every pricing dimension. Every request is matched to exactly one provider, one region and one set of rates.

Structured catalog

Claude Sonnet 5 anthropic/claude-sonnet-5
  • Anthropic Standard global $2.00 in · $10.00 out
  • Anthropic Standard us (data residency) $2.20 in · $11.00 out
    Input
    $2.20
    Output
    $11.00
    Cache read
    $0.22
    Cache write, 5 minutes
    $2.75
    Cache write, 1 hour
    $4.40
    Batch input
    $1.10
    Batch output
    $5.50
    Web search, per 1,000 searches
    $10.00
  • AWS Bedrock Global 33 regions $2.00 in · $10.00 out
  • AWS Bedrock Geo 18 regions $2.20 in · $11.00 out
  • AWS Bedrock In-region 2 regions $2.20 in · $11.00 out
  • Google Vertex Standard global, us, eu $2.00 to 2.20 in · $10.00 to 11.00 out

Flat list of keys

claude-sonnet-5: {
  input_cost: 0.000002
  output_cost: 0.00001
  cache_read_cost: 0.0000002
  cache_write_cost: 0.0000025
  cache_write_cost_1h: 0.000004
  input_cost_batch: 0.000001
  output_cost_batch: 0.000005
  region: ?
  provider: ?
}

One set of numbers per model name. Which provider, region and request type each key applies to is not recorded.

Figure 1. Claude Sonnet 5 in Multi-Router's catalog, priced per provider offering and region, with named rates for each pricing dimension (USD per million tokens; web search per 1,000 searches). On the right, the same kind of data as a flat list of keys.

Several details change the price of a request

Cache writes are priced by how long the cache is kept

Prompt caching lets a provider store a long prefix, such as a system prompt or a codebase, and charge much less to read it on later requests. Writing content to the cache costs more than normal input, and the extra cost depends on how long the cache is kept.

Anthropic offers two cache lifetimes. A 5-minute cache write costs 1.25 times the input rate, and a 1-hour cache write costs 2 times the input rate. Newer OpenAI models add a 30-minute cache write with its own rate. A gateway that records a single cache-write figure and prices it at one rate undercounts every 1-hour write by 37.5%.

Multi-Router reads the split by lifetime from the provider's usage report and records the tokens and cost for each lifetime separately.

Providers count input tokens differently

Anthropic reports input_tokens as new tokens only, and reports cache reads and cache writes separately. OpenAI reports prompt_tokens as the total, with cached tokens counted inside it. A gateway that treats both reports the same way either counts cached tokens twice or leaves them out. Multi-Router converts both reports to the same accounting before it prices the request.

Long prompts are billed at a higher rate

Some models charge more for long prompts. On those models, once a prompt reaches a set size, every token in the request is billed at the long-context rate, including the output. The threshold depends on the model, and is 200,000 tokens on some models and 272,000 on others.

The price does not rise gradually. It jumps when the prompt crosses the threshold. On Claude Sonnet 4.5 served by Vertex in its US region, a 199,000-token prompt with a 2,000-token answer costs about $0.69. A 201,000-token prompt with the same answer costs about $1.38. One percent more input doubles the price of the request.

Multi-Router compares the full prompt size, including cached tokens, with the model's threshold, and applies the long-context rates to the whole request once the threshold is reached.

The service tier is set by the provider's response

Some providers sell faster or cheaper service tiers for the same model. The tier that is billed is the one the provider reports in its response, which is not always the one the request asked for. A request that asks for a priority tier can be served, and billed, at the standard tier. Multi-Router prices each request at the tier reported in the response. It detects Anthropic's fast mode, which has its own higher rates, in the same way.

Tool calls are charged separately

Providers charge for server-side tools per call, on top of tokens. Anthropic's web search and OpenAI's web search and file search each have a fee per call. Multi-Router counts the calls reported in the response and adds the fee for each one. Failed file searches are not charged.

An example coding agent session

A coding agent works on a repository. Every request carries the same 80,000-token context of system prompt, instructions and files, cached with a 1-hour lifetime. Each request also sends 5,000 new tokens of conversation and receives a 1,000-token answer. The model is Claude Sonnet 5 on Anthropic's global endpoint, at catalog rates at the time of writing: $2 per million input tokens, $10 per million output tokens, $0.20 per million cache-read tokens and $4 per million 1-hour cache-write tokens.

Pricing method Request 1 Requests 2–10, each Session of 10 requests
Tokens × input and output price $0.180 $0.180 $1.80
Cache priced at one write rate (5-minute) $0.220 $0.036 $0.54
Cache priced by lifetime (actual) $0.340 $0.036 $0.66

The simple calculation overstates the cost of this session by 2.7 times. Pricing the cache at a single write rate comes closer, but still undercounts by 18%, all of it on the first request. If the same session runs on Anthropic's US data-residency endpoint, the actual cost rises by 10%, to $0.73.

$0.00 $0.50 $1.00 $1.50 $2.00 12345678910 Request in the session Tokens × price, after request 1: $0.18 Tokens × price, after request 2: $0.36 Tokens × price, after request 3: $0.54 Tokens × price, after request 4: $0.72 Tokens × price, after request 5: $0.90 Tokens × price, after request 6: $1.08 Tokens × price, after request 7: $1.26 Tokens × price, after request 8: $1.44 Tokens × price, after request 9: $1.62 Tokens × price, after request 10: $1.80 One cache-write rate, after request 1: $0.22 One cache-write rate, after request 2: $0.26 One cache-write rate, after request 3: $0.29 One cache-write rate, after request 4: $0.33 One cache-write rate, after request 5: $0.36 One cache-write rate, after request 6: $0.40 One cache-write rate, after request 7: $0.44 One cache-write rate, after request 8: $0.47 One cache-write rate, after request 9: $0.51 One cache-write rate, after request 10: $0.54 Priced by lifetime (actual), after request 1: $0.34 Priced by lifetime (actual), after request 2: $0.38 Priced by lifetime (actual), after request 3: $0.41 Priced by lifetime (actual), after request 4: $0.45 Priced by lifetime (actual), after request 5: $0.48 Priced by lifetime (actual), after request 6: $0.52 Priced by lifetime (actual), after request 7: $0.56 Priced by lifetime (actual), after request 8: $0.59 Priced by lifetime (actual), after request 9: $0.63 Priced by lifetime (actual), after request 10: $0.66 $1.80 Tokens × price $0.66 Priced by lifetime (actual) $0.54 One cache-write rate
Figure 2. Cumulative cost of a 10-request coding agent session with an 80,000-token context cached for 1 hour, priced three ways. Claude Sonnet 5 on Anthropic's global endpoint, catalog rates at the time of writing.

A budget enforced on the first figure would stop this agent after about a third of the work its cap allows. A budget enforced on the second figure would let it overspend.

How Multi-Router prices a request

Prices come from Multi-Router's model catalog, which is versioned and structured by model, provider, variant, region and pricing dimension. Each request records the catalog version that priced it.

Every figure comes from the usage the provider reports in its response. This applies on every entry point: the OpenAI-compatible API, the Anthropic API, Bedrock and Vertex. Streaming responses are priced from their usage events, including streams that are cut short or cancelled.

The traffic log, the request detail and budget enforcement all use the same priced figure, so a budget always agrees with the Traffic page. Requests are priced even when request storage is turned off, so budgets still apply.

If a rate is missing from the catalog, the request is marked as unpriced and a warning is recorded. Multi-Router does not guess a missing rate or derive it from another rate.

Custom models hold your negotiated rates

Enterprise agreements often include prices that differ from the public price list. An account or organization admin can copy a catalog model as a custom model and edit every rate: standard, long context, batch, each service tier, each cache-write lifetime and each tool fee. The custom prices apply only to that account or organization, so each customer's traffic is priced at the rates it negotiated.

A custom price takes precedence over the catalog price, and each request records whether it was priced from the catalog or from a custom model.

Clone with new pricing
1Model
Claude Sonnet 5anthropic/claude-sonnet-5change
2Offering to copy
VendorVariantRegionsList pricing
AnthropicStandard2 regionsPrice varies by region
BedrockGeo18 regionsSame price in every region
BedrockGlobal33 regionsSame price in every region
BedrockIn-region2 regionsSame price in every region
Vertex AIStandard3 regionsPrice varies by region
Everything about the picked offering is copied — wire ids, regions, limits, lifecycle. Only the name and the prices change.
3Name and prices
Name
Anthropic (Enterprise Agreement)
Variant id anthropic-enterprise-agreement · shown wherever a variant is picked
Prices
StandardLong ContextBatchTools
USD per 1M tokens
RegionInputOutputCache readCache write 5mCache write 1h
global$1.70$8.50$0.2$2.5$4
us$1.87$9.35$0.22$2.75$4.4
Prefilled with every list price; edit what was negotiated. Every price shown is saved; an empty box is not charged.
Create custom variantCancel
Clone with new pricing: the Anthropic offering of Claude Sonnet 5 copied with negotiated input and output prices for each region. Edited prices are highlighted.

The cost of each request is shown in Traffic

Each request in Traffic has a Cost card that shows how the total was reached. It lists the service tier, whether long-context pricing was applied, and the cost of input, output and cache reads. It splits cache writes by 5 minutes, 1 hour and 30 minutes, and shows the number and cost of web searches and file searches. OpenAI-format responses also return the service tier and the cache-write token count to the caller.

req_8Fq2Lx7Nd4200anthropic/claude-sonnet-5anthropic
Full Request Payload →
Latency
9,412ms
Cost
$0.35
Tokens
85,000 → 1,000
TTFT
2,184ms
Attempts
1
Router overhead
1.4 ms
Request
Request ID
req_8Fq2Lx7Nd4
Timestamp
2026-11-11 14:32:07.412
Organization
org_7Tq2Wd9KxP
API key
claude-code (tok_4Rf8zLm2Qa)
Correlation ID
—
Customer
—
Session
—
Peer IP
203.0.113.24
Routing
Alias
—
Router ID
rt_4Kd9Qm2WxT
Model requested
anthropic/claude-sonnet-5
Model served
anthropic/claude-sonnet-5
Vendor
anthropic
Variant
standard
Region
global
Wire id
claude-sonnet-5
Prompt binding
Prompt ID
—
File path
—
Revision
—
Latency
Total
9412ms
TTFT
2184ms
Request upload
2.1 ms
Router overhead
1.4 ms
Upstream
9407ms
Router response
0.3 ms
Tokens
Prompt
85,000
80,000 cache-write
80,000 at 1 hour
Completion
1,000
Request bytes
341,882
Response bytes
5,214
Cost
Total
$0.35
Input
$0.01
Output
$0.01
Cache read
$0
Cache write
$0.32
$0.32 at 1 hour
Web search
$0.01
1 search
The first request of the example session in Traffic: an 80,000-token cache write at the 1-hour rate and one web search.

Accurate cost makes budgets reliable

Budgets, limits and alerts are only as accurate as the cost figure behind them. Multi-Router prices every request by provider, region and pricing dimension, using the provider's own usage report, and enforces budgets on that same figure.

Start for free

Create a router, set your SDK base URL to Multi-Router and see the cost of every request.