---
title: "Reasoning model max_tokens calculator: avoid empty replies"
description: "Set max_tokens for reasoning models such as DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B from answer length, reasoning budget and margin, and see the cost."
url: https://broadrouter.com/tools/reasoning-token-budget/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# max\_tokens calculator for reasoning models

Updated 2026-11-16

**In short:** Reasoning models write hidden reasoning before the answer, and both count toward max\_tokens, so set max\_tokens = (answer tokens + reasoning tokens) × (1 + safety margin). BroadNet's docs say to allow 1,000 tokens or more on DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B, or set reasoning\_effort to low. A smaller limit can return an empty reply.

Free, no sign-up, runs in your browser: nothing you type is sent anywhere.

Answer, reasoning and marginExpected answerUnittokensEnglish wordsArabic wordsReasoning budget, tokensBroadNet's docs: leave 1,000 or more. Better: the high end of usage.completion\_tokens\_details.reasoning\_tokens in your logs.Reasoning effortNot set (model default)low (BroadNet's docs suggest it)Safety margin, %Prompt tokensRequests per monthModel for the codeDeepSeek V4.1 FlashGLM 5.3Qwen3.8 27B

Suggested max\_tokens

—

Answer, tokens

—

Answer + reasoning

—

**Python (OpenAI SDK)**

## Cost on BroadNet reasoning models

| Model | Fits context | Typical per request | Worst case (all of max\_tokens) | Typical per month |
| --- | --- | --- | --- | --- |

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-reasoning-token-budget&utm_content=tool) ·

The reasoning budget is your input, not a measurement: reasoning length varies by model, prompt and effort. Prices are BroadNet's pay-as-you-go rates, synced 2026-11-14, before tax; "typical" assumes the model uses your answer + reasoning estimate, with no cache hits.

[Report a wrong price or number](mailto:info@broadnet.ai?subject=Wrong%20price%20or%20number%20on%20max_tokens%20calculator%20for%20reasoning%20models&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Freasoning-token-budget%2F%0A%0AWhat%20looks%20wrong%20(model%2C%20figure%20shown%2C%20correct%20figure%20and%20a%20source%20link%20if%20you%20have%20one)%3A%0A) (email to info@broadnet.ai, with this page's link and your inputs filled in).

## How it works

1.  Enter the expected length of the visible answer in tokens, or in English or Arabic words.
2.  Enter the reasoning budget. BroadNet's docs say to leave 1,000 tokens or more; replace it with the high end of reasoning\_tokens you see in your own responses.
3.  Choose a safety margin and whether you will send reasoning\_effort low. Add your prompt size and monthly requests for the context check and cost.
4.  Copy the suggested max\_tokens and the code. Read the cost per request, worst case and per month on each reasoning model.

## Why reasoning empties the reply

A reasoning model writes its reasoning first and the visible answer second, and both come out of one `max_tokens` budget. With `max_tokens: 200`, a model that reasons for 600 tokens stops before the answer starts: the request succeeds, `choices[0].message.content` is empty and `finish_reason` is `length`. The full walk-through is in [why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/).

## The formula

```
answer tokens   = answer words × tokens per word   (or tokens directly)
max_tokens      = round_up_100( (answer + reasoning) × (1 + margin) )
                  and at least answer + 1,000 on reasoning models
context check   = prompt tokens + max_tokens ≤ context window
typical cost    = prompt × input_price + (answer + reasoning) × output_price
worst case      = prompt × input_price + max_tokens × output_price
```

## Worked example

A 300-token answer with a 1,000-token reasoning budget and a 20% margin gives max\_tokens = 1,600. On GLM 5.3 with a 2,000-token prompt, a typical request costs about $0.00606 and the worst case, if the model uses the whole limit, $0.0071.

## Reasoning models on BroadNet Inference

| Model | ID | Output per 1M | Context |
| --- | --- | --- | --- |
| [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) | `broadnet/deepseek-v4.1-flash` | $0.52 | 1,048,576 |
| [GLM 5.3](https://broadrouter.com/models/glm-5.3/) | `broadnet/glm-5.3` | $3.46 | 1,048,576 |
| [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) | `broadnet/qwen3.8-27b` | $2.17 | 262,144 |

BroadNet's docs list reasoning for these three models, not for BroadNet Gemma 4 VL 26B. Read `usage.completion_tokens_details.reasoning_tokens` when the model reports it; in a stream, send `stream_options: {"include_usage": true}` to get usage in the last chunk.

## Questions

### Why does a reasoning model return an empty reply?

It spent the whole max\_tokens budget on reasoning before the visible answer began. BroadNet's docs say DeepSeek V4.1 Flash, GLM 5.3, Qwen3.8 27B reason before they answer and the reasoning counts toward max\_tokens. The response then has empty content and finish\_reason "length". [Fixes and code](https://broadrouter.com/guides/reasoning-tokens-empty-response/).

### What max\_tokens should I set for a reasoning model?

Enough for the reasoning plus the answer, with a margin: (answer + reasoning) × (1 + margin). BroadNet's docs say to leave 1,000 tokens or more for reasoning. Measure your own reasoning tokens from `usage.completion_tokens_details.reasoning_tokens` and size for the long tail, not the average.

### Does a higher max\_tokens cost more?

No, not by itself. You pay for tokens the model actually generates, not for the limit. A higher limit only lets a long reasoning run finish, so the worst-case cost per request rises while the typical cost stays the same.

### Are reasoning tokens billed?

Yes, on pay-as-you-go they are part of the completion tokens and billed at the output price. On the Full Moon, Orbit, Meteor plans for DeepSeek V4.1 Flash there is no token meter, so they add time, not charges.

### What does reasoning\_effort do?

It asks the model to reason less (low) before answering. BroadNet's docs suggest low as the alternative to a larger max\_tokens for simple tasks. How many tokens it saves depends on the model and the prompt, so measure it on your own requests.

### Does BroadNet Gemma 4 VL 26B reason?

BroadNet's docs list reasoning for DeepSeek V4.1 Flash, GLM 5.3, Qwen3.8 27B only, so BroadNet Gemma 4 VL 26B is not priced here; for it, max\_tokens only needs to cover the answer.

## Go deeper

-   [Why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/)
-   [What reasoning tokens cost](https://broadrouter.com/blog/reasoning-tokens-cost/)
-   [Streaming chat completions (usage in the last chunk)](https://broadrouter.com/guides/streaming-chat-completions/)
-   [LLM API cost calculator](https://broadrouter.com/tools/llm-api-cost-calculator/)

## More free tools

-   [**LLM API cost calculator**Price a workload on every model at once, with cache hits, reasoning and a flat-plan check.](https://broadrouter.com/tools/llm-api-cost-calculator/)
-   [**Speech-to-text cost calculator**Hours, calls or voice notes to a monthly transcription bill, against your current provider.](https://broadrouter.com/tools/speech-to-text-cost-calculator/)
-   [**LLM token counter**Exact token counts with each model's real tokenizer, with a token view and cost.](https://broadrouter.com/tools/token-counter/)
-   [**Arabic token counter**Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.](https://broadrouter.com/tools/arabic-token-counter/)
-   [**Tokens to words converter**Tokens ↔ words ↔ characters ↔ pages, by language and content type.](https://broadrouter.com/tools/tokens-to-words/)
-   [**Context window calculator**Will it fit? Window used per model, room left for output, cost to send.](https://broadrouter.com/tools/context-window-calculator/)
-   [**Flat-rate vs per-token LLM cost calculator**Break-even between an unlimited plan and paying per token, per agent.](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/)
-   [**Prompt caching savings calculator**Bill with and without caching, by prefix share and hit rate.](https://broadrouter.com/tools/prompt-caching-calculator/)
-   [**Image token calculator**Tokens and cost per image under each model's documented rule. Drop an image; nothing is uploaded.](https://broadrouter.com/tools/image-token-calculator/)
-   [**Self-hosting vs API cost calculator**GPU rental against your current API and BroadNet per-token and flat-plan prices: cost per 1M tokens and break-even volume.](https://broadrouter.com/tools/self-hosting-vs-api-calculator/)
-   [**Embedding cost calculator**Index, update and query costs for a corpus at OpenAI, Google, Voyage, Mistral and Jina list prices.](https://broadrouter.com/tools/embedding-cost-calculator/)
-   [**LLM rate limit and concurrency calculator**Which limit binds first: RPM, TPM or concurrency, with Little's law.](https://broadrouter.com/tools/llm-rate-limit-calculator/)
-   [**JSON schema generator for LLM structured output**Sample JSON to strict schema, Pydantic, Zod and a ready request.](https://broadrouter.com/tools/json-schema-generator/)
-   [**OpenAI-compatible API request builder**One request, copied as curl, Python, Node or the OpenAI SDKs.](https://broadrouter.com/tools/api-request-builder/)
-   [**Audio file splitter for speech-to-text limits**Chunk count, overlap and copy-ready ffmpeg commands to fit a transcription file-size limit.](https://broadrouter.com/tools/audio-splitter-ffmpeg/)
-   [**Agent run cost estimator**Context growth per step, total tokens and cost of one agent run, with a DeepSeek session comparison.](https://broadrouter.com/tools/agent-run-cost-estimator/)
-   [**OpenAI to BroadNet migration helper**Paste OpenAI SDK code; get base URL, key and model edits, a diff and the checks that remain.](https://broadrouter.com/tools/openai-to-broadnet-migration/)
-   [**Arabic text normalizer**Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.](https://broadrouter.com/tools/arabic-text-normalizer/)
-   [**RAG chunking calculator**Chunks, embedding tokens, input per query, context check and monthly LLM cost for a RAG pipeline.](https://broadrouter.com/tools/rag-chunking-calculator/)
-   [**LLM batch job planner**Run time, binding limit, cost per model and the flat sessions needed to finish a big job by a deadline.](https://broadrouter.com/tools/llm-batch-job-planner/)
-   [**LLM JSON output validator**Parse errors by line and column, safe repairs, cut-off detection and JSON Schema checks for model output.](https://broadrouter.com/tools/llm-json-output-validator/)
-   [**Prompt token diff**Two prompt versions side by side: changed lines, exact token delta and the monthly cost difference.](https://broadrouter.com/tools/prompt-token-diff/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-reasoning-token-budget&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-reasoning-token-budget&utm_content=sources)
-   [BroadNet Inference API reference: reasoning counts toward max\_tokens; leave 1,000 tokens or more (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-reasoning-token-budget&utm_content=sources#models)
-   [BroadNet Inference prices](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-reasoning-token-budget&utm_content=sources)
