# Token Usage

> How many tokens a call used. Input and output are each counted.

**Field:** Software Development  
**Category:** AI Engineering  
**Also known as:** Token Count, LLM Usage, Input and Output Tokens

## Think of it like

Think of it like a taxi meter. It counts the trip, and you pay for what it counts.

## Definition

Token usage is how many tokens a call to a language model used, split into input and output. Input tokens are all you sent: the system prompt, the chat so far, any files and the new question. Output tokens are the reply the model wrote. The API sends back both counts with each answer. They set the cost of the call, and show how close it came to the model's limits.

## Example

Emma logs the usage of every call. She finds one chat sends 9,000 input tokens of old history each time for a 50-token reply, and trims it.

## Example code

```json
"usage": {
  "input_tokens": 1240,
  "output_tokens": 312
}
```

The usage block that comes back with each reply.

## Why it matters

Usage is what you pay for. Watching it is how you find calls that are slow or cost too much.

## Common mistake

Counting only the reply. In a long chat the input, which repeats the history each turn, is often most of the bill.

## Three principles

- **Input and output.** Counted apart.
- **Comes with each reply.** Log it.
- **History adds up.** Each turn resends it.

## Related terms

- [Token (AI)](https://learn.benibix.com/term/ai/token)
- [Token Pricing](https://learn.benibix.com/term/development/token-pricing)
- [Context Window](https://learn.benibix.com/term/ai/context-window)
- [Max Tokens](https://learn.benibix.com/term/ai/max-tokens)
- [LLM API](https://learn.benibix.com/term/development/llm-api)

![One request split into two bars. The input bar holds the system prompt, the history and the new question. The output bar holds the reply. Both are counted in tokens.](https://learn.benibix.com/diagrams/dev-token-usage.svg)

---

Source: https://learn.benibix.com/term/development/token-usage
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
