Models & comparisonsComparison
Agent session cost: 50 steps on GLM, DeepSeek or MiniMax
Work out what a 50-step agent session costs when the history is re-sent every step, then pick between GLM-5.3-Flash, DeepSeek-V4-Flash and MiniMax-M2.7.

On this page
Your agent ran for ten minutes, and the bill is bigger than the task. Nothing odd happened: every step re-sends the whole history, so the input side grows with each step and ends up as most of the cost. With the numbers below, a 50-step session sends 885,000 input tokens and writes 40,000. Pick the model by how far the history will grow and how long one answer has to be, then check the total in the table.
Why step 50 costs more than step 1#
A model remembers nothing between calls. To continue a task, the agent sends everything again: the instructions, every earlier step, and what the last step produced. Step 1 sends the starting context. Step 50 sends the starting context plus 49 steps of history. If the idea is new to you, why AI agents use so many tokens walks through a 20-step example.
Say the agent starts with 3,000 tokens (system prompt, task, a few files) and every step adds about 600 tokens to the history: the agent keeps a trimmed note of what it did and saw, and drops the rest. Step 50 then sends 3,000 + 600 × 49 = 32,400 tokens. The answer stays around 800 tokens a step. The question keeps growing; the answer doesn't.

The 50-step sum#
Before the arithmetic, take a guess.
Guess the number
How many input tokens does the whole 50-step session send?
Your guess
02,000,000
Show answer
Answer: 885,000
About 885,000. Step k sends 3,000 + 600 × (k − 1) tokens, and over 50 steps that adds up to 885,000 — more than twenty times the 40,000 tokens the agent writes.
The sum, in the order you would do it on paper:
- The starting context goes out 50 times: 50 × 3,000 = 150,000.
- The step numbers 0 to 49 add up to 49 × 50 ÷ 2 = 1,225, and each unit is 600 tokens of history: 600 × 1,225 = 735,000.
- Input in total: 150,000 + 735,000 = 885,000.
- Output in total: 50 × 800 = 40,000.
The history is 735,000 of the 885,000, and it grows faster than the step count. Double the task to 100 steps: 99 × 100 ÷ 2 = 4,950, so the history is 600 × 4,950 = 2,970,000 and the starting context is 100 × 3,000 = 300,000, which makes 3,270,000 input tokens in all. Twice the steps, almost four times the input. Output only doubles: 100 × 800 = 80,000.
What the session costs on each model#
A request is billed for input and output together, so compare the total. Counted that way, all three models come out cheaper than OpenRouter in total for this load; the OpenRouter column in the table shows it. Prices are live, so the table stays current.
| Model | Input $/1M | Output $/1M | Cost | OpenRouter |
|---|---|---|---|---|
| GLM-5.3-Flash | $0.02 | $0.04 | $0.0193 | $0.033 |
| DeepSeek-V4-Flash | $0.015 | $0.10 | $0.0173 | $0.0676 |
| MiniMax-M2.7 | $0.05 | $0.15 | $0.0503 | $0.603 |
885,000 input and 40,000 output tokens in total. Prices per 1M tokens are current and change together with our tariffs; the OpenRouter column shows reference prices for the same workload.
Read it from the input side. About 96 of every 100 tokens in this session are input, so the input price decides most of the total. Input per 1M tokens today: DeepSeek-V4-Flash $0.015, GLM-5.3-Flash $0.02, MiniMax-M2.7 $0.05.
And the doubling, on DeepSeek-V4-Flash:
Now your own load. The average step in our example sends 885,000 ÷ 50 = 17,700 input tokens and writes 800. Five such tasks in a day are 5 × 50 = 250 steps. Change the numbers to yours; the calculator sums over the steps with live prices.
Cost calculator
Five 50-step tasks in one day
Input tokens per request: 17,700 · Output tokens per request: 800 · Requests per day: 250
| Model | Per day | Per month |
|---|---|---|
| GLM-5.3-Flash$0.02$0.04 | $0.0965 | $2.90 |
| DeepSeek-V4-Flash$0.015$0.10 | $0.0864 | $2.59 |
| MiniMax-M2.7$0.05$0.15 | $0.251 | $7.54 |
Does the history fit in the window?#
Cost is one limit. The other is the window: a request bigger than the model's context cannot be sent at all. The CheapTokens model catalog (4 November 2026) lists these limits:

With our growth of 600 tokens a step, the history alone gets near the window after many steps: MiniMax-M2.7 at about step 290 (3,000 + 600 × 289 = 176,400), DeepSeek-V4-Flash at about step 620 (3,000 + 600 × 619 = 374,400), GLM-5.3-Flash at about step 640 (3,000 + 600 × 639 = 386,400). A 50-step session uses a small part of any of them.
Real sessions are rougher. If a step pastes a big log and adds 6,000 tokens instead of 600, MiniMax-M2.7's 180K ends around step 30: 3,000 + 6,000 × 29 = 177,000. The same task fits the larger windows for much longer.
The answer limit works the other way round. GLM-5.3-Flash and MiniMax-M2.7 write up to 8,192 tokens per answer, DeepSeek-V4-Flash up to 32,768. Say one step has to produce a 10,000-token report. On the 8,192 limit the reply stops at the cap and finish_reason says length; on DeepSeek-V4-Flash it fits in one answer.
The same sum for a support bot#
A support bot is the same loop with a person in it. Say a conversation runs 30 turns, the system prompt and rules take 1,000 tokens, and each turn adds 300 tokens to the history (100 from the customer, 200 from the bot).
- Starting context, 30 times: 30 × 1,000 = 30,000.
- History: 29 × 30 ÷ 2 = 435 units of 300 tokens, so 300 × 435 = 130,500.
- Input in total: 30,000 + 130,500 = 160,500.
- Output in total: 30 × 200 = 6,000.
One such conversation costs $0.0035 on GLM-5.3-Flash, $0.003 on DeepSeek-V4-Flash and $0.0089 on MiniMax-M2.7. The shape is the same: about 96 of every 100 tokens are input. A bot with thousands of conversations a day feels this in the first week, and trimming the history is the lever. Sliding window or summary shows how.
Measure your own session#
The assumptions above are round numbers. Your agent has its own, and the API tells you exactly: every response carries a usage object with the input and output tokens of that call. This loop has the same shape as an agent without the tools: the history grows, the whole list is re-sent. It is an example; swap the prompt for your task.
import os
import requests
URL = 'https://api.cheaptokens.dev/v1/chat/completions'
HEADERS = {'Authorization': 'Bearer ' + os.environ['CHEAPTOKENS_API_KEY']}
messages = [{'role': 'system', 'content': 'You are a research agent. Work in small steps.'}]
total_in = total_out = 0
for step in range(1, 51):
messages.append({'role': 'user', 'content': f'Step {step}: continue the task.'})
r = requests.post(URL, headers=HEADERS, timeout=120, json={
'model': 'deepseek-ai/DeepSeek-V4-Flash-0731',
'messages': messages,
'max_tokens': 800,
}).json()
messages.append(r['choices'][0]['message'])
total_in += r['usage']['prompt_tokens']
total_out += r['usage']['completion_tokens']
print(step, r['usage']['prompt_tokens'], r['usage']['completion_tokens'])
print('session:', total_in, 'input,', total_out, 'output')The middle number on each printed line is the input of that call, and it climbs every step. That climb is the history. Put the two totals from the last line into the cost calculator above in place of 885000 and 40000 and you have the price of your session. The base URL, keys and model ids are described in the CheapTokens docs.
Which model for your session#
Price per session is in the table. What it can't show is whether the session fits, so choose by your case:
Pick your case
What does your agent look like?
Choose an option to see the answer
Short answers, history stays under 180K
Any of the three fits. MiniMax-M2.7's 180K window holds hundreds of steps like the ones above, so choose by the cost table. Details on MiniMax-M2.7.
Long history, no trimming
GLM-5.3-Flash has the largest window of the three, 390K, with DeepSeek-V4-Flash close behind at 380K. Both leave room for sessions with big tool or log pastes. Details on GLM.
Steps that write long files or reports
DeepSeek-V4-Flash: up to 32,768 tokens in one answer against 8,192 on the other two, plus a 380K window. Details on DeepSeek.
Overnight batch, nobody watching
Prices on all three are the same at any hour, with no peak-hour pricing, so an overnight run costs what the table says. Size the window and the answer limit from the sections above and put a step limit in the loop.
All three models sit on one CheapTokens balance behind the same OpenAI-compatible address, so after a trial run switching is a change of model id. Current prices are on the pricing page; a side-by-side of strengths is in GLM vs DeepSeek vs MiniMax.



