---
title: "Input vs output tokens in LLM APIs, and how they are billed"
description: "Input tokens are what a model reads, output tokens are what it writes. What counts as each, where usage reports them, and how the two prices shape an LLM bill."
url: https://broadrouter.com/glossary/input-and-output-tokens/
lang: en
updated: 2026-11-14
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Input and output tokens

Updated 2026-11-14

Input tokens are the tokens a language model reads in a request, including the system prompt, conversation history, tool definitions and images. Output tokens are the tokens it generates in reply, including any reasoning. LLM APIs usually price them separately, and output usually costs more.

Also called: prompt tokens, completion tokens, input tokens, output tokens

Every LLM request has two sides: what you send and what comes back. APIs count both in [tokens](https://broadrouter.com/glossary/token/), and most bill them at different rates.

## How it works

**Input** is everything in the request: the system prompt, every earlier message, tool definitions, tool results, documents and images. A multi-turn chat resends the whole history each turn, so input grows with the conversation.

**Output** is everything the model generates: the visible answer, tool calls and, on reasoning models, the hidden [reasoning tokens](https://broadrouter.com/glossary/reasoning-tokens/).

The usage block reports both:

```json
"usage": {
  "prompt_tokens": 18000,
  "completion_tokens": 900,
  "prompt_tokens_details": { "cached_tokens": 15000 },
  "completion_tokens_details": { "reasoning_tokens": 600 }
}
```

The cost of one request is:

`(new input × input price) + (cached input × cached price) + (output × output price)`, with each price per 1M tokens.

## Why it matters

The ratio between the two decides which price matters. A chat assistant may produce a few hundred tokens for a short question. A coding agent resends a large repository context on each turn and writes a short patch, so input can outnumber output by 20 to 1 or more. For agents, the input price and the [cached input](https://broadrouter.com/glossary/cached-input-tokens/) price drive most of the bill.

Output is still worth watching. Reasoning models can spend more tokens thinking than answering, and those are billed as output. Across the models we track, the typical output-to-input price ratio is in the [LLM API price index](https://broadrouter.com/data/llm-api-price-index/).

## On BroadNet Inference

Per 1M tokens, from the published price file:

| Model | Input | Cached input | Output |
| --- | --- | --- | --- |
| [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) | $0.175 | $0.0055 | $0.52 |
| [GLM 5.3](https://broadrouter.com/models/glm-5.3/) | $0.78 | $0.173 | $3.46 |
| [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) | $0.175 | $0.0435 | $2.17 |
| [BroadNet Gemma 4 VL 26B](https://broadrouter.com/models/gemma-4-vl-26b/) | $0.10 | — | $0.22 |

In BroadNet’s worked example, a full-time coding agent sends 1,000 million input tokens a month with 80% cache hits and gets 50 million output tokens back. On DeepSeek V4.1 Flash per token, that costs $65.40. A [flat-rate plan](https://broadrouter.com/glossary/flat-rate-llm-plan/) removes the meter: Full Moon is $60 a month per session. Compare your own numbers in the [pricing calculator](https://broadrouter.com/pricing/) or read [flat rate vs pay per token](https://broadrouter.com/blog/flat-rate-vs-pay-per-token-llm-api/).

## Common mistakes

-   Pricing only the visible answer and forgetting reasoning tokens.
-   Ignoring how fast history grows. Turn 30 of a chat can carry 30 turns of input.

## Questions

### What is the difference between prompt tokens and input tokens?

None. The Chat Completions format calls them prompt\_tokens and completion\_tokens. Newer APIs, such as OpenAI's Responses API and Anthropic's Messages API, call them input\_tokens and output\_tokens.

### Why is output more expensive than input?

A model reads the whole prompt in one parallel pass, but generates output one token at a time, so each output token takes more GPU time.

### Are tool definitions billed?

Yes. Tool schemas and tool results are part of the prompt, so they are input tokens on every request that includes them.

## See also

-   [Token](https://broadrouter.com/glossary/token/) (term)
-   [Cached input tokens](https://broadrouter.com/glossary/cached-input-tokens/) (term)
-   [Reasoning tokens](https://broadrouter.com/glossary/reasoning-tokens/) (term)
-   [Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/) (term)
-   [Tokenizer](https://broadrouter.com/glossary/tokenizer/) (term)
-   [Stream chat completions and handle dropped connections](https://broadrouter.com/guides/streaming-chat-completions/) (guide)
-   [Why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/) (guide)
-   [Flat-rate vs pay-per-token LLM API: the break-even math](https://broadrouter.com/blog/flat-rate-vs-pay-per-token-llm-api/) (article)
-   [Cached input tokens: how to cut an LLM API bill](https://broadrouter.com/blog/cached-input-tokens-explained/) (article)

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=glossary-input-and-output-tokens&utm_content=page-cta) ·

**Sources**

-   [OpenAI API reference, chat completion usage fields](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create)
-   [Anthropic, context windows (what counts toward input and output)](https://platform.claude.com/docs/en/build-with-claude/context-windows)
-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-input-and-output-tokens&utm_content=sources)
