By the end of this lesson you will turn any AI request into rupees, step by step, and you will know why a coding agent spends most of your money on input.
You need: a calculator (your phone is fine) and, if you have one, any coding agent you already use · Time: 8 minutes
You met tokens in What an AI agent does: the AI reads and writes text in small pieces called tokens. Now we put a price tag on them.
How many tokens is normal text? Roughly:
- A page of English (about 500 words, around 3,000 characters): DeepSeek's own rule of thumb is about 0.3 token per English character, so about 900 tokens. The other common rule (one token is about three-quarters of a word) gives about 670. Plan with 700 to 900 tokens per page.
- A page of Hinglish in Roman script: same letters, but words like "dikhayenge" or "karwaana" are rarer, so the model cuts them into more pieces. Expect more tokens than an English page of the same length. The exact number depends on the model; the usage numbers your provider shows are the real count.
- Code: a 200-line file is roughly 2,000 tokens.
Prices are written per 1 million tokens (1M). That is about a thousand pages of English, so one page costs a tiny fraction of a rupee. The money comes from volume: agents move hundreds of thousands of tokens for one task.
Why?You can't control a bill you can't read. Once "tokens" means "money" to you, long chats and big pasted logs start to look expensive, because they are.
Open any model's price list and you will see three rates:
- Input: everything sent to the model: your message, the whole conversation so far, the files the agent read, the rules file.
- Output: everything the model writes back: answers, code, and its thinking.
- Cache read (also called cached input or cache hit): input the provider has seen very recently, word for word, at the start of the request. It is billed at a much lower rate. Lesson 3 shows how to get more of it.
Here is one real example, DeepSeek V4.1 Flash on AllModelAPI (prices checked 19 Nov 2026; current prices are on /pricing):
Token type USD per 1M tokens Input $0.15 Output $0.60 Cache read $0.003 Output costs 4 times more than input per token, and cache read costs 50 times less than input. Every provider publishes rates like these; the numbers change, the three kinds stay.
Match them Match each word with what it means for your bill
Tap an item on the left, then its meaning on the right.
Why?Many beginners look only at the output price, because that's the "answer". For coding agents, input is usually the bigger number, as you will see in two steps.
The formula is the same for every model and every provider:
cost = tokens × price per 1M ÷ 1,000,000
Example: one agent request that sends 200,000 input tokens and gets 5,000 output tokens back, on DeepSeek V4.1 Flash:
- Input: 200,000 × $0.15 ÷ 1,000,000 = $0.03
- Output: 5,000 × $0.60 ÷ 1,000,000 = $0.003
- Total: $0.03 + $0.003 = $0.033
- In rupees: the US dollar was about ₹93 on 19 Nov 2026, so $0.033 × 93 ≈ ₹3.07
Three rupees sounds harmless. The next step shows why a weekend of building is hundreds of these.
You can ask the AI to check your maths. Ask it to show every step, so you can spot a wrong zero:
Prompt · copy it into your AI agentCalculate the cost of one AI request and show every step of the maths. Input tokens: [200,000] at $[0.15] per 1M tokens. Output tokens: [5,000] at $[0.60] per 1M tokens. Then convert the total to rupees at ₹[93] per US dollar. Write each line as: tokens × price ÷ 1,000,000 = result.
Why?Dividing by 1,000,000 is where most people slip by a factor of ten or a thousand. Writing each line out makes the mistake visible.
You type one prompt: "Add a fees-due list to my coaching institute fee tracker." The agent does not answer in one go. It reads files, edits one, runs the app, sees an error, fixes it. Each of those moves is a separate request to the model, and each request sends the whole conversation so far again, because the model remembers nothing between requests.
A simplified version of that one task, with 10 requests. Each request adds about 10,000 tokens (files read, command results, the model's replies), and the model writes about 2,000 tokens each time:
Request Input sent Output 1 20,000 2,000 2 30,000 2,000 3 40,000 2,000 5 60,000 2,000 10 110,000 2,000 All 10 650,000 20,000 The cost on DeepSeek V4.1 Flash, without any cache discount:
- Input: 650,000 × $0.15 ÷ 1,000,000 = $0.0975
- Output: 20,000 × $0.60 ÷ 1,000,000 = $0.012
- Total: $0.1095, about ₹10. Input is 89% of the bill, even though output costs 4 times more per token.
One prompt, ten requests. Every request carries the whole bucket again. The bucket has a size limit, the context window. Most models on AllModelAPI hold about 1 million tokens. When a conversation gets close to the limit, a tool like Claude Code summarises the older part (this is called compacting) or the request fails. A big window does not make anything cheaper: a fuller bucket means more input tokens on every request.
Why?This one picture explains most "why is my bill so high?" moments: long sessions, big files and pasted logs all sit in the bucket and get paid for again on every request.
- Tokens are priced per 1M. A page of English is roughly 700 to 900 tokens; Hinglish usually needs more.
- Every model has three rates: input, output and cache read (much cheaper).
- Cost = tokens × price per 1M ÷ 1,000,000. Write each step; convert at today's rate (about ₹93 per $1 on 19 Nov 2026).
- An agent sends the whole conversation on every request, so input is usually most of the bill.
- Next: The right model for each task.
Create a free account to save your progress and open every lesson. Create free account