BroadRouter

Input and output tokens

Updated

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, 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.

The usage block reports both:

"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 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.

On BroadNet Inference

Per 1M tokens, from the published price file:

Model Input Cached input Output
DeepSeek V4.1 Flash $0.175 $0.0055 $0.52
GLM 5.3 $0.78 $0.173 $3.46
Qwen3.8 27B $0.175 $0.0435 $2.17
BroadNet 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 removes the meter: Full Moon is $60 a month per session. Compare your own numbers in the pricing calculator or read flat rate vs pay per token.

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.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity