One AI Request Costs $0.004: The Receipt Math
01 / Price one request before you price a feature
Most beginners start with the wrong question. They ask what an AI subscription costs, then hope the math works out. Skip that. On a tiny budget the only number that matters is the price of a single request, because a request is the smallest unit you can actually measure, log, and charge for.
Take a simple chat feature. A typical request carries about 2,000 input tokens, which is roughly 1,500 words of system prompt, user message, and retrieved context, and produces about 400 output tokens, roughly 300 words of answer. Those two numbers are your starting line. Everything else is arithmetic.
Now attach prices. Rates differ per model and change over time, so use the ones printed on your provider's page, not a number you half remember from a blog post. For this walkthrough, keep it simple and use a clearly illustrative pair: 1.00 dollar per 1 million input tokens and 5.00 dollars per 1 million output tokens. These are placeholder figures for the exercise. Replace them with real prices before you make any decision.
The request cost is then 2,000 divided by 1,000,000 times 1.00, which is 0.002 dollars, plus 400 divided by 1,000,000 times 5.00, which is another 0.002 dollars. Total: 0.004 dollars, or four tenths of a cent, per request. That is the receipt line this article is built around. If you cannot reproduce that number on paper, you are not ready to build the feature.
02 / Count input, output, cache write and cache read tokens separately
The four token categories are where beginners lose money. Providers that bill per real token count all four, including cache reads and cache writes. Ignoring the cache lines gives you a bill that surprises you in month two.
Here is what each category means in practice. Input tokens are fresh tokens the model has to process. Output tokens are the text the model generates, and they usually cost several times more than input. Cache write tokens are tokens you store in a cache so that a later request can reuse them, and writing normally costs slightly more than plain input. Cache read tokens are the reused portion of your prompt, and they are normally the cheapest category of all.
Your own feature decides the split. A chat app with a long system prompt and a short user message is cache friendly, because the system prompt is identical across requests. A search feature that injects fresh documents into every prompt is cache hostile, because nearly every token is new. Both can be cheap, but only if you measure them separately.
Log four counters per request from day one: input, output, cache write, cache read. It is thirty lines of code. Without those counters you are estimating costs with a spreadsheet and a feeling, and feelings do not scale to a thousand users.
03 / Turn four tenths of a cent into a monthly user cost
Cost per user is just request cost multiplied by requests per user. Decide what a realistic month looks like. Suppose a light user sends 10 requests a day and uses the feature 20 days a month. That is 200 requests per user per month.
At 0.004 dollars per request, one user costs 200 times 0.004, which is 0.80 dollars per month. Now invert it. With a 20 dollar monthly budget, you can serve 20 divided by 0.80, which is 25 users. That is the honest answer for the warm-cache-free version of the feature.
Write that calculation down in this exact shape every time you revisit it: request cost, requests per user, users per budget. If any of the three moves, the other two move with it. A user who sends 50 requests a day instead of 10 costs 4.00 dollars a month, and your 20 dollar budget suddenly supports only 5 users. Usage distribution matters more than averages, so also track your heaviest user, because that one account can swallow a third of a small budget.
Set a hard per-user ceiling in your code, not just in your head. A daily request cap or a token cap per user is the cheapest insurance a bootstrapped product can buy. It converts an unbounded bill into a predictable one.
04 / Let cache reads rewrite the receipt line
Now revisit the same feature with caching enabled, keeping the illustrative rates but adding cache pricing: 1.25 dollars per 1 million cache write tokens and 0.10 dollars per 1 million cache read tokens. Suppose the 2,000-token prompt contains a 1,600-token block that stays constant across requests.
The first request of a session is the cold one. It writes 1,600 tokens to the cache at 1.25 dollars per million, which is 0.002 dollars, processes the remaining 400 tokens as fresh input at 1.00, which is 0.0004 dollars, and generates 400 output tokens at 5.00, which is 0.002 dollars. Cold request total: 0.0044 dollars.
Every later request in that session is warm. It reads 1,600 tokens at 0.10 per million, which is 0.00016 dollars, processes 400 fresh input tokens for 0.0004 dollars, and generates the same 400 output tokens for 0.002 dollars. Warm request total: 0.00256 dollars. That is about 36 percent cheaper than the uncached 0.004 dollars, and the saving comes entirely from reading instead of reprocessing.
Mix them the way real traffic does: one cold request and nine warm ones per day. That is 0.0044 plus 9 times 0.00256, which equals 0.0272 dollars per day. Over 20 active days a month, one user costs about 0.54 dollars. Your 20 dollar budget now covers roughly 36 users instead of 25, with no change to the feature itself. Same product, better billing hygiene.
05 / The four levers that actually move cost per user
Once the receipt math works, optimize in this order, because the earlier levers are cheaper to pull.
- ■ Prompt size. Every token of system prompt you delete is paid on every single request. Trimming 400 tokens from a 2,000-token prompt cuts input cost by a fifth forever. Rewrite it once and the saving compounds.
- ■ Output cap. Set a maximum output length. A runaway answer that produces 2,000 tokens instead of 400 costs five times more on the output line, and output is your most expensive category.
- ■ Model tier. Route routine work to a smaller model and reserve a larger one for the hard cases. Start your prototype on something inexpensive such as Claude Haiku 4.5 or DeepSeek V4 Flash, measure, then promote requests to a bigger tier only where quality demands it.
- ■ Retry and error behavior. Failed calls, timeouts, and double submissions still bill for the tokens they consume. One retry policy that is too aggressive can quietly double your usage.
Two traps deserve a warning. First, streaming changes when you see tokens, not how many you pay for, so it never lowers the bill. Second, a cheap price per million tokens does not mean a cheap feature, because the number of tokens you send is under your control and the price is not.
For the measurement work itself, a pay-as-you-go relay keeps the experiment cheap. CheapRelay gives you one key across Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok and more, works with Claude Code, Codex, Gemini CLI and any OpenAI SDK, and bills per real token including cache reads and writes, with no monthly fee and no subscription. OpenAI-compatible routes sit under /v1 and Gemini native routes under /v1beta, so your counters can point at a single base URL. Sign up at CheapRelay and run your own 200-request measurement instead of trusting anyone's example.
06 / Write the receipt line down and check it every month
Finish with a one-line summary you can paste into your dashboard. Mine reads: 2,000 input, 400 output, 1,600 cached, 0.00256 dollars per warm request, 200 requests per user, 0.54 dollars per user per month. That single line tells a stranger what the feature costs and tells me when something has changed.
Review it monthly against your actual logs. If the measured cost per user drifts above the modeled cost, one of three things happened: prompts grew, output lengths grew, or the cache hit rate fell. Each has an obvious fix. If the drift is below the model, you have room to raise your usage cap or serve more users on the same budget.
Tiny budgets reward discipline, not cleverness. Four tenths of a cent per request sounds like nothing until you multiply it by ten thousand requests, and 0.54 dollars per user sounds like nothing until you multiply it by a user base. Keep the receipt math honest, cap the worst-case user, and let the feature grow into the budget rather than the other way around.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-30 | Spend less | EN | Two Receipts, 2 Million Tokens, $0.80 Saved Two receipts for the same 2 million tokens: one bills input and output, the other caches. Same results, $0.80 cheaper per cycle. |
| 2026-10-30 | Spend less | EN | Two Chatbot Receipts: $0.03 and $0.31 per Resolved Ticket Two support chatbot bills side by side, judged only on price per useful result, with the routing and caching math that cut spend. |
| 2026-10-30 | Spend less | EN | Software 0 Cents, AI Capped at 40,000 Tokens A beginner weekend plan for a receipt-sorting CLI: free tools, one API key, and a hard cap of 40,000 tokens. |
| 2026-10-30 | Spend less | EN | Tag 10,000 Feedback Lines for About $0.66 A beginner walkthrough: tag 10,000 feedback lines with a cheap model for roughly $0.66, plus batching, caching and a human review plan. |
| 2026-10-30 | Spend less | EN | 50k tokens, one key, under $1: a fair price check A beginner, tiny-budget walkthrough for comparing official list prices with relay prices using per-token math, cache lines and a real receipt. |
| 2026-10-30 | Spend less | EN | $0.0031 per accepted answer: rank models by the receipt A beginner walkthrough of cost per accepted answer, run on a $10 budget with two toy price schedules and a real receipt line. |