A 10,000-Token Bill, Line by Line
01 / The four lines on a small AI API bill
When you use an AI API, the bill can show more than one token category. The names may look technical, but each line answers a simple question: what information did you send, what did the model generate, and did previously sent information come from a cache?
CheapRelay uses pay-as-you-go billing. There is no monthly fee or subscription, and billing is based on real token usage. That makes the distinction important when your budget is small. A request that feels like one conversation can contain several separately billed parts.
02 / Input tokens are the words and instructions you send
Input tokens are the text and other request content sent to the model. This can include your prompt, system instructions, conversation history, tool definitions, file contents, and selected settings represented as text.
Input is not counted by words exactly. A token may be part of a word, a whole short word, punctuation, or a piece of code. The same prompt can therefore use a different number of tokens depending on its language and formatting.
For a tiny budget, the practical rule is simple: long history and large pasted files increase input usage every time they are sent. Asking a short question after sending 20,000 tokens of context is still a large request.
03 / Output tokens are the model’s answer
Output tokens are generated by the model. They include the visible answer and, depending on the API and response format, generated tool calls or structured output.
Output is usually easier to control than input. Set a sensible maximum output length, ask for a specific format, and avoid requesting a full essay when a list will do. A model that generates 2,000 tokens can cost more than one that generates 200 tokens, even when both received the same prompt.
Input and output are separate bill lines because providers price them separately. CheapRelay passes through the applicable model pricing, so check the current price for the model you select rather than assuming every token category has the same rate.
04 / Cache writes are the first storage pass
A cache write happens when eligible input is stored so a later request can reuse it. Imagine sending a stable system prompt, project instructions, or a large document for the first time. The service may write that material to a cache.
A cache write is not free simply because the text may be reused later. The tokens written to the cache are billed as cache-write tokens under the model’s current pricing. This charge represents processing and storing that reusable context.
Cache writes are most useful when the same large context will be used repeatedly. They are less useful for a one-off request, because there may be no later request to benefit from the stored context.
05 / Cache reads are reused context
A cache read happens when a later request reuses input that is already cached. Instead of treating the entire repeated section as ordinary fresh input, the service recognizes the cached portion and reports it separately.
Cache reads are also billed. They commonly have a different price from ordinary input and cache writes, but the exact amount depends on the model and current rate. “Cached” means reused efficiently, not “zero cost.”
For a small budget, cache reads can still be valuable. If you repeatedly send the same large instructions, paying the cache-read rate may cost less than paying the ordinary input rate each time. The saving depends on the model’s published rates and how much context is actually reused.
06 / A 10,000-token example without invented prices
Suppose your request contains 8,000 tokens of stable project context and 2,000 tokens of new instructions. The model generates 500 tokens.
- ■ On the first request, the 8,000 stable tokens may appear as cache writes, while the 2,000 new tokens appear as input.
- ■ On a later request, the reused 8,000 tokens may appear as cache reads, while the new 2,000 tokens remain input.
- ■ The generated 500 tokens appear as output on both requests.
The bill is calculated by multiplying each category by its applicable rate, then adding the results. You should not add token counts and apply one assumed price unless the pricing table explicitly says those categories share a rate.
07 / Keeping a tiny API budget under control
Start with short prompts and a low output limit. Watch the token breakdown after real requests, especially when using coding tools that automatically include files, history, or tool instructions. Remove stale conversation context when it is no longer needed.
Before choosing a model, compare its input, output, cache-write, and cache-read rates. CheapRelay provides one key for models including Claude Haiku 4.5 and Gemini 2.5 Flash, along with OpenAI-compatible and Gemini-native API routes. You can sign up for CheapRelay and begin with pay-as-you-go usage instead of committing to a subscription.
The key habit is to read every line as a different kind of work: input is context received, output is text generated, cache write is context stored, and cache read is context reused. Once those four meanings are clear, a small bill becomes much easier to predict.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-27 | Spend less | EN | $2 for a Small RAG App, With a Stop at $1.90 Build a tiny document Q&A app with local retrieval, bounded prompts, and a prepaid request ledger that stops spending before your $2 ceiling. |
| 2026-10-27 | Spend less | EN | ¥20 Buys a Real Prompt-Cache Test A beginner's prompt-caching walkthrough using a ¥20 budget, real token math, and a simple receipt-style test. |
| 2026-10-27 | Spend less | EN | $10 a Month Is a Budget, Not a Chatbot Guarantee Build a low-budget support chatbot with token math, narrow answers, short context, spending limits, and a clear handoff to a human. |
| 2026-10-27 | Spend less | EN | $0.024 a Request: Read the Whole Token Price A tiny-budget guide to input, output, cache charges and retries, with sample math for turning per-million-token prices into real costs. |
| 2026-10-27 | Spend less | EN | $3.06 to Tag 100,000 Feedback Messages—On Paper A hypothetical token receipt for feedback tagging, with retries, human review, and the assumptions that can break a cheap classification budget. |
| 2026-10-27 | Spend less | EN | $0.13 per Active User: An AI Feature Cost Receipt A concrete AI cost receipt: tokens, retries, infrastructure, and the difference between a $0.08 API bill and a $0.13 user budget. |