Every time you use an AI model, you're consuming two very different things: the words you send it, and the words it sends back. They look identical in a chat window, but behind the API they're priced separately — and the difference can be 5x, 10x, or in extreme cases 50x. Output tokens are almost always the expensive ones, and understanding why is the single fastest way to stop overpaying for AI.
This guide explains input tokens vs output tokens from the ground up: what they are, why they're priced so differently, and how to use that knowledge to cut your API bill dramatically.
What Is a Token, Exactly?
Before the input/output split makes sense, you need the token itself. Models don't read letters or words — they read tokens, which are chunks of text produced by a tokenizer. A common English word is usually one token. A rare word might split into two or three. A line of code can be a dozen tokens. As a rough rule:
- 1 token ≈ 4 characters in English
- 100 tokens ≈ 75 words
- A page of dense code ≈ 800–1,200 tokens
Every model family has its own tokenizer, so the same sentence can cost slightly different amounts on different models. That's why serious cost optimization starts with picking models with efficient tokenizers for your language and domain.
Input Tokens: What You Send
Input tokens (also called prompt tokens) are everything in your request:
- Your system prompt
- The user's message
- Conversation history
- Documents or code you paste in
- Tool definitions and few-shot examples
Here's the crucial property: input tokens are read by the model. Reading is computationally cheap per token, because the model processes your entire prompt in one massive parallel pass. GPUs excel at this — thousands of tokens consumed simultaneously, once.
Output Tokens: What the Model Generates
Output tokens (completion tokens) are what the model writes back — and they're generated one at a time. Each new token requires a full forward pass that re-attends to everything generated so far. The model literally cannot write token 50 until it has finished token 49.
This is the autoregressive bottleneck, and it's why output is expensive in three separate currencies:
- Compute — generating N tokens means N sequential passes; reading N tokens means roughly one pass.
- Latency — users wait for every output token; input is nearly instantaneous by comparison.
- Infrastructure — output occupies GPU memory (the KV cache) for the entire generation, blocking other requests.
Why the Price Gap Can Be 10x or More
Pull up any model's API pricing and you'll see the pattern. Real numbers from the Qubax AI catalog make it concrete (prices per million tokens):
| Model | Input | Output | Output ÷ Input |
|---|---|---|---|
| Claude Sonnet 5 | $0.675 | $3.375 | 5.0x |
| GLM 5.1 | $0.208 | $0.653 | 3.1x |
| Grok 4.5 | $1.03 | $3.10 | 3.0x |
| Claude Opus 5 | $1.875 | $9.375 | 5.0x |
The ratio isn't arbitrary — it tracks the underlying cost structure. Every provider prices output at a multiple of input because generation is inherently sequential and memory-bound while prompting is parallel and cheap.
The Hidden Cost Multipliers Most Teams Miss
Knowing the ratio is step one. Step two is recognizing how modern AI workloads quietly become output-heavy:
Agentic loops multiply everything
A coding agent that reads a 50k-token repository (input) and writes a 2k-token patch (output) seems input-heavy — until it loops 40 times. Each iteration re-sends growing context as input AND generates fresh output. Agent frameworks can easily produce 10–50x more total tokens than the visible conversation.
"Thinking" models bill their thoughts
Reasoning models generate internal chains-of-thought — and most providers bill for those tokens as output even though you never see them. A model that "thinks" for 3,000 tokens before answering a question that needs 50 output tokens bills like a 3,050-token response. Check whether your provider exposes reasoning-token accounting; it changes model selection entirely.
Conversation history is re-billed every turn
Chat isn't stateless from the provider's perspective. Turn 10 of a conversation re-sends turns 1–9 as input. Long conversations inflate input costs quadratically without careful trimming or summarization.
Seven Practical Ways to Pay Less
With the mental model in place, here's the optimization playbook, ordered roughly by impact:
- Cap max output tokens. The simplest win. Set
max_tokensto what the task actually needs. Most "write a summary" tasks never need more than 500 output tokens, yet run with defaults of 4,000+. - Ask for shorter answers. Genuinely. "Respond in under 100 words" is a cost optimization with a prompt-engineering interface. Structured outputs (JSON schemas, bullet constraints) work even better because they eliminate conversational padding.
- Route by task difficulty. Classification, extraction, and formatting don't need frontier models. Route easy tasks to cheap models like DeepSeek V4 Flash or GLM 5.2, and reserve expensive ones for hard reasoning. A model router can automate this — see the Qubax docs for building one.
- Compress your prompts. Strip boilerplate, prune few-shot examples, and move static instructions into cached system prompts where the provider supports prompt caching (cache hits can cost 10% of normal input price or less).
- Trim or summarize conversation history. Keep the last N turns verbatim; summarize older context into a compact block. This turns quadratic growth into linear.
- Stop verbose models from rambling. Some models pad answers with restatement and caveats. Temperature and instruction tweaks ("no preamble, no summary paragraph") routinely cut output 30–50% with zero quality loss for utility tasks.
- Measure per-feature token mix. Log input/output/reasoning tokens per endpoint. Teams are routinely shocked to learn one feature generates 60% of their output tokens. You can't optimize what you don't measure.
A Worked Example: The Same Task, Two Ways
Task: summarize customer support tickets daily, 500 tickets/day, each ~400 input tokens, target ~100-token summary.
Naive configuration — frontier model, default settings, chatty 300-token average output:
- Input: 500 × 400 = 200k tokens/day
- Output: 500 × 300 = 150k tokens/day
Optimized configuration — budget model, max_tokens=150, terse instruction, compact few-shot example:
- Input: 500 × 450 = 225k tokens/day (slightly more, from the instruction)
- Output: 500 × 120 = 60k tokens/day
Same business value. The optimized version cuts output tokens by 60% and — once you factor in the cheaper model — typically cuts total cost by 80–90% for this class of task. Summarization quality at 100 vs 300 tokens is indistinguishable for ticket digests.
How Qubax AI Fits In
Qubax AI gives you one OpenAI-compatible API in front of hundreds of models, with live per-model pricing that's often far below retail. That makes the input/output optimization loop practical:
- Compare true per-task costs across models with real input/output prices side by side
- Switch models per request without re-plumbing your codebase, so routing by task difficulty is a config change, not a migration
- Watch your token mix per model and shift volume toward the models where your workload's input/output ratio is cheapest
The catalog spans everything from ultra-budget options like GLM 5.2 and DeepSeek V4 Flash to frontier models like Claude Opus 5 and Grok 4.5 — browse the full list here.
Key Takeaways
- Input tokens are what you send; output tokens are what the model generates — and output is priced 3–5x higher because generation is sequential and memory-bound.
- Agentic loops, reasoning tokens, and conversation history are the three hidden multipliers that blow up bills.
- Cap output, constrain verbosity, route easy tasks to cheap models, and measure your token mix per feature.
- A model-agnostic API layer makes cost optimization a routing decision instead of a vendor lock-in problem.
FAQ
What's the difference between input and output tokens?
Input tokens are everything you send in a request: system prompt, messages, history, documents, and tool definitions. Output tokens are everything the model generates in response, including any hidden reasoning tokens. They're billed at separate rates, with output typically 3–5x more expensive per token.
Why are output tokens more expensive than input tokens?
Generating output is sequential — the model produces one token at a time, each requiring a full computation pass, and holds growing state (the KV cache) in GPU memory throughout. Input is processed in parallel in roughly one pass. The pricing gap reflects that fundamental asymmetry in compute and infrastructure cost.
What are reasoning tokens?
Reasoning tokens are the internal chain-of-thought a "thinking" model generates before producing its visible answer. Most providers bill them as output tokens. A model that thinks for 3,000 tokens to answer with 50 visible tokens bills as a 3,050-output-token request, so reasoning-heavy models can cost far more than their sticker price suggests.
How can I reduce output token costs?
Set a tight max_tokens limit, instruct the model to be terse, use structured output formats like JSON schemas, route easy tasks to cheaper models, and enable prompt caching for repeated input. Logging per-feature token usage will show you where output volume actually concentrates.
Do all models price input and output differently?
Essentially all major API providers split input/output pricing, though ratios vary. Budget models like GLM 5.2 or DeepSeek V4 Flash have very low absolute prices on both sides, while frontier models like Claude Opus 5 carry premium rates on both. Compare live prices across models at qubax.ai/models.
Is a bigger context window better for costs?
Not necessarily. A large context window lets you send more input, but you pay for every token on every request. Long conversations re-bill history each turn, so unbounded context is a cost risk. Trim, summarize, and cache to keep input growth linear.
How do I calculate my API costs from token counts?
Cost = (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price), with prices expressed per million tokens. Add reasoning tokens to the output side if your model bills them. The Qubax docs include token accounting details for every model.