Cost optimizationBreakdown
How many tokens does an API request use? Measured on 3 tasks
Real usage numbers from DeepSeek-V4-Flash: a short question, a paragraph summary and email-to-JSON, with the cost of 1,000 requests and a script for your own prompts.

On this page
Ask what one request to an AI API costs and you'll usually hear "it depends". It does, but you can't plan a budget around that. So we took three everyday jobs, sent them to DeepSeek-V4-Flash through the CheapTokens API on 23 October 2026, and wrote down what the usage field said each time.
The short version: a quick question came to 110 tokens, a paragraph summary to 396, and turning an email into JSON to 299. Below is what each request looked like, what came back, and what it costs.
A quick question#
We started with something people ask chat assistants all the time: the difference between git merge and git rebase, in two or three sentences.

The question took 23 tokens, the answer 87. That's the first thing worth noticing: the reply is almost four times longer than the question, and output is the side that costs more, on MiniMax-M2.7 right now it's $0.15 per 1M output tokens against $0.05 for input. Priced at those rates, one request like this costs $0.000014. A thousand of them, $0.0142.
Here's that exact request, if you'd like to see the numbers on your own screen:
curl https://api.cheaptokens.dev/v1/chat/completions \
-H "Authorization: Bearer $CHEAPTOKENS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMaxAI/MiniMax-M2.7",
"messages": [
{"role": "user", "content": "What is the difference between git merge and git rebase? Answer in two or three sentences."}
],
"max_tokens": 2048,
"temperature": 0.2
}'The counts sit in the usage block at the end of the response: prompt_tokens is what you sent, completion_ is what the model wrote, total_tokens is both together.
A summary, and the tokens you don't read#
Second job: boil a short incident report down to two sentences. Teams run this kind of thing through a model all day long: tickets, reports, long email threads. Here's the prompt:
Summarize this incident report in two sentences.
On Tuesday between 14:05 and 14:50 UTC the checkout API returned errors for about 6% of requests. The cause was a configuration change deployed at 13:58 that lowered the database connection pool from 50 to 5 connections per instance. Under normal load nobody noticed, but when the afternoon traffic peak arrived, requests queued for a free connection and timed out after 30 seconds. The on-call engineer saw the growing p99 latency at 14:12, found the change in the deploy log at 14:31 and rolled it back at 14:44. To prevent a repeat, the pool size is now validated in CI against a minimum value, and an alert fires when more than 20 requests wait for a connection for two minutes.And the answer:
On Tuesday, a configuration change that reduced the database connection pool from 50 to 5 caused checkout API errors for about 6% of requests during the afternoon peak, until it was rolled back at 14:44. To prevent recurrence, the pool size is now validated in CI and an alert triggers when connection wait times exceed thresholds.
Two sentences, 331 characters, and 146 output tokens. That looked like a lot for so little text, and the response explained why: usage had one more field, reasoning_. Before answering, the model spent 76 tokens thinking it through. They're part of the 146 (250 in + 146 out = 396 in total), so about half of the output went into reasoning that isn't part of the answer text, and it's billed like any other output token.
Good to know when you plan a budget: on tasks where the model stops to think, the output can be noticeably bigger than the text you get back. A thousand summaries like this cost $0.0344.
An email in, clean JSON out#
Third job: an order confirmation that needs to become a database record.

The model returned exactly the keys we asked for and nothing around them, no "Here is your JSON". The total matches the email, and the delivery date came back as 2026-11-03, already in the format we asked for. 199 tokens in, 100 out.
What stands out is the density: 100 tokens for 276 characters of JSON, while the git answer took 87 tokens for 421 characters of plain text. Quotes, braces and commas are tokens too, so structured output costs more per character than prose. A thousand emails like this: $0.025.
All three side by side#
Scroll the table right →
| Task | Tokens in | Tokens out | 1,000 requests |
|---|---|---|---|
| Quick question | 23 | 87 | $0.0142 |
| Summary | 250 | 146 | $0.0344 |
| Email to JSON | 199 | 100 | $0.025 |
The costs are calculated from these token counts at the current MiniMax-M2.7 price, so they stay right when prices change.
Output wins in every task, even the summary, where we sent more than we got back. So the easiest lever on your bill is the length of the answer: "in two or three sentences" or "return only JSON" does real work.
For scale: a support bot that answers 2,000 quick questions a day, each like the first one, spends about $0.852 a month on MiniMax-M2.7. A real chat resends its history every turn, so the input grows with each message, but for one-off questions that's the whole bill.
Try it on your own prompts#
Your prompts will land on different numbers, and it takes a minute to find out. This script sends each prompt, skips answers that were cut off, and prints the tokens and the cost of 1,000 requests:
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.cheaptokens.dev/v1", api_key=os.environ["CHEAPTOKENS_API_KEY"])
MODEL = "MiniMaxAI/MiniMax-M2.7"
PRICE_IN, PRICE_OUT = 1.00, 4.00 # USD per 1M tokens: example values, use the current ones from the price list
PROMPTS = [
"What is the difference between git merge and git rebase? Answer in two or three sentences.",
# add your own prompts here
]
for prompt in PROMPTS:
r = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user", "content": prompt}],
max_tokens=2048,
temperature=0.2,
)
if r.choices[0].finish_reason != "stop":
print("cut off at max_tokens, raise the limit:", prompt[:40])
continue
tin, tout = r.usage.prompt_tokens, r.usage.completion_tokens
per_1000 = (tin * PRICE_IN + tout * PRICE_OUT) * 1000 / 1_000_000
print(f"{tin} in, {tout} out, 1,000 requests = ${per_1000:.4f} | {prompt[:40]}")Put the current prices into PRICE_IN and PRICE_OUT: for MiniMax-M2.7 that's $0.05 per 1M input tokens and $0.15 per 1M output tokens. The first prompt is the one from our test; token counts differ a little between models, so expect numbers in the same range as 23 in and 87 out. You'll need the openai package (pip install openai) and your key in CHEAPTOKENS_.
If a number looks odd: finish_ means the answer hit max_tokens (why answers stop mid-sentence); a large reasoning_tokens explains output that's bigger than the text; and the full formula for input and output prices is in input vs output tokens.
Where to start#
In total, with input and output counted together, MiniMax-M2.7 on CheapTokens is cheaper than OpenRouter's reference price for all three tasks above. It has a 180K context, answers of up to 8,192 tokens and one price at any hour. Top up your balance, create a key and send the curl request from the top of this page: the docs cover the key and the base URL, the DeepSeek page has the model catalog, and pricing has the live price list.



