In short:
- Cost per request = input tokens × input rate + output tokens × output rate (+ cached tokens × cached rate). Rates are quoted per million tokens, and each request is rounded to the nearest $0.000002, the smallest amount we bill.
- Most estimates go wrong on input volume: system prompts, tool definitions and conversation history are re-sent on every request.
- Prompt caching can cut the input side of agent workloads dramatically; worked example below.
- Measure real requests, multiply by realistic volume, add a buffer, then cap spend with per-key limits.
“How much will this cost per month?” is the first question anyone asks before shipping an LLM feature, and the hardest to answer from a pricing page alone. Pricing is published per million tokens, but you think in requests, users and sessions. This guide shows how to bridge the two, using the current rates from our model catalogue. Every figure on this page is calculated from that same rate table, so if a rate changes, the examples update with it.
The formula
Every model on Relaykit has an input rate, an output rate and, for most models, a lower rate for cached input. For one request:
cost = (fresh input tokens × input rate
+ cached input tokens × cached rate
+ output tokens × output rate) / 1,000,000
Credits map one-to-one to dollars of usage at the published rates, so a dollar estimate is also a credit estimate. Here are the current rates in USD per million tokens:
| Model | Tier | Input | Cached input | Output |
|---|---|---|---|---|
| Claude Opus 5.5 | flagship | $4.40 | $0.22 | $22 |
| Claude Sonnet 5 | balanced | $2.20 | $0.22 | $11 |
| Claude Haiku 4.5 | fast | $1.10 | $0.11 | $5.50 |
| GPT-6.1 Sol | flagship | $2.20 | $0.11 | $11 |
| GPT-5.6 Sol | flagship | $5.50 | $0.55 | $33 |
| GPT-5.6 Terra | balanced | $2.20 | $0.22 | $13.20 |
| Grok 4.6 | balanced | $2.20 | $0.55 | $6.60 |
| Claude Sonnet 5.5 | balanced | $2.20 | $0.22 | $11 |
| Grok 4.7 | flagship | $2.20 | $0.55 | $6.60 |
| DeepSeek V4 Flash | fast | $0.24 | $0.0048 | $0.96 |
| DeepSeek V4 Pro | balanced | $1.32 | $0.044 | $3.96 |
Two things stand out. First, output is always the more expensive side. Second, cached input is a fraction of the normal input price for the models that support it. Both facts shape the examples below.
Step 1: understand what a token is
A token is a chunk of text produced by the model’s tokenizer. A widely used rule of thumb for English prose is roughly four characters, or about three quarters of a word, per token. Treat that as a rough guide only:
- Code usually produces more tokens per character than prose, because of symbols, indentation and identifiers.
- Non-English text often uses more tokens for the same meaning.
- Different model families use different tokenizers, so the same prompt can count differently on Claude, GPT and DeepSeek.
The reliable way to count is to send a real request and read the usage object in the response (prompt_tokens and completion_tokens in OpenAI format, input_tokens and output_tokens in Anthropic format). Your usage log in the console shows the same numbers per request.
Step 2: find the hidden input tokens
When people underestimate cost, it is almost always the input side. The user’s message is often the smallest part of what you send. Each request also carries:
- The system prompt, every time.
- Tool and function definitions. A dozen tools with detailed JSON schemas can be thousands of tokens.
- Conversation history. Chat APIs are stateless, so turn 20 of a conversation re-sends turns 1 to 19.
- Retrieved context in RAG apps: the documents you paste in.
- Files and tool results in coding agents: every file the agent reads goes into the context and stays there.
On the output side, watch for reasoning tokens. Models that think before answering bill that thinking as output, even when you only see the final answer.
Step 3: estimate volume, then multiply
With per-request token counts from real samples, multiply by expected volume. Start from something you can actually observe or forecast (requests per day, sessions per developer, documents per batch) rather than from “users”.
Then add a buffer for retries, prompt changes and growth. There is no universal number; we suggest leaving visible headroom and comparing against real usage after the first week.
Worked example 1: a chat feature
A support assistant inside a web app:
- 300 requests per day, over 30 days
- 1,500 input tokens per request on average (system prompt + short history + question)
- 400 output tokens per request
Monthly tokens:
- Input: 300 × 1,500 × 30 = 13.5 million
- Output: 300 × 400 × 30 = 3.6 million
On Claude Sonnet 5: 13.5 × $2.20 + 3.6 × $11 = $29.70 + $39.60 = $69.30 per month.
The same workload across the catalogue (no caching assumed):
| Model | Input cost | Output cost | Monthly total |
|---|---|---|---|
| Claude Opus 5.5 | $59.40 | $79.20 | $138.60 |
| Claude Sonnet 5 | $29.70 | $39.60 | $69.30 |
| Claude Haiku 4.5 | $14.85 | $19.80 | $34.65 |
| GPT-6.1 Sol | $29.70 | $39.60 | $69.30 |
| GPT-5.6 Sol | $74.25 | $118.80 | $193.05 |
| GPT-5.6 Terra | $29.70 | $47.52 | $77.22 |
| Grok 4.6 | $29.70 | $23.76 | $53.46 |
| Claude Sonnet 5.5 | $29.70 | $39.60 | $69.30 |
| Grok 4.7 | $29.70 | $23.76 | $53.46 |
| DeepSeek V4 Flash | $3.24 | $3.456 | $6.696 |
| DeepSeek V4 Pro | $17.82 | $14.256 | $32.076 |
Totals are what the gateway bills: each request is rounded to the nearest $0.000002 before the requests are added up, so on the cheapest models a total can differ from input plus output by a fraction of a cent.
The spread between tiers is the main lever. Many support questions are simple enough for a fast-tier model such as Claude Haiku 4.5; you can route only the hard ones to a larger model.
Worked example 2: a coding agent session, with and without caching
Coding agents are where costs surprise people, because the context grows with every step and is re-sent on every turn. Assume one session:
- 40 model turns
- an average of 50,000 input tokens per turn (instructions, tool definitions, files read so far, previous turns)
- 1,500 output tokens per turn
That is 2 million input tokens and 0.06 million output tokens for one session.
Without caching, on Claude Opus 5.5: 2 × $4.40 + 0.06 × $22 = $10.12 per session.
With caching. Most of each turn’s input is the same prefix as the previous turn. Agent tools such as Claude Code mark that prefix for caching, so repeated tokens are billed at the cached rate. If 90% of input tokens are cache reads:
- Fresh input: 0.2M × $4.40 = $0.88
- Cached input: 1.8M × $0.22 = $0.396
- Output: 0.06M × $22 = $1.32
- Total: $2.596 per session
| Model | Per session, no cache | Per session, 90% cached | Per month (66 sessions, cached) |
|---|---|---|---|
| Claude Opus 5.5 | $10.12 | $2.596 | $171.336 |
| Claude Sonnet 5 | $5.06 | $1.496 | $98.736 |
| Claude Haiku 4.5 | $2.53 | $0.748 | $49.368 |
The monthly column assumes 3 sessions a day over 22 working days. Two honest caveats:
- Cache hit rates vary. 90% is an assumption for illustration, not a measurement. Editing an early part of the context, switching models mid-session, or long pauses (caches expire) all lower it. The
usageobject in each response reports cached tokens, so check your real rate after a few sessions. - Cache writes can cost more than normal input. On Claude models, writing a prefix into the cache is billed at 1.25× the standard input rate for those tokens (2× for a 1-hour cache) when the provider reports the write. That adds a little to the cached figures above. See the pricing page for how cache usage is billed.
Even with those caveats, the lesson holds: for agent workloads, caching changes the cost by a large factor, so a tool that caches well is worth more than a small difference in per-token rates.
Worked example 3: a one-off batch job
Summarising an archive of 10,000 documents, each about 3,000 tokens, into 300-token summaries:
- Input: 10,000 × 3,000 = 30 million tokens
- Output: 10,000 × 300 = 3 million tokens
| Model | Calculation | Total |
|---|---|---|
| DeepSeek V4 Flash | 30 × $0.24 + 3 × $0.96 | $10.08 |
| Claude Haiku 4.5 | 30 × $1.10 + 3 × $5.50 | $49.50 |
| Claude Sonnet 5 | 30 × $2.20 + 3 × $11 | $99.00 |
For a job like this, run the first 50 documents on two or three candidate models, compare the summaries yourself, and pick the cheapest one that meets your quality bar. On Claude Sonnet 5 that pilot costs about $0.495, and less on the cheaper models: a small price for replacing guesswork with evidence.
How to bring the number down
- Pick the tier per task, not per app. Use a fast model for classification, extraction and sub-agent work, and a flagship only where quality visibly improves. Our post on choosing a model for coding agents covers this in detail.
- Cap
max_tokens. It limits the expensive side and stops runaway answers. - Keep the prefix stable. Put static content (system prompt, tool definitions, reference documents) first and the changing parts last, so caching can work.
- Trim history. Summarise old turns instead of re-sending them forever.
- Send only the tools you need. Unused tool schemas are paid input on every request.
- Ask for shorter output. “Answer in at most three sentences” is the cheapest optimisation there is.
Put guard rails on the estimate
An estimate is a forecast, not a limit. With prepaid credits you cannot be billed beyond your balance, and you can go further: give each key its own spending limit in the console, so a bug in one project cannot drain the balance that the others depend on. Our API key security guide explains how to set that up.
Next steps
- Compare all rates on the models page and see how credits work on the pricing page.
- Make your first request with the quickstart and read the
usageobject: it is the best input your estimate can have.