# Tokens and how LLM pricing works

> AI APIs charge by the token, a piece of text roughly four characters of English long. Each model has a price per million input tokens and a higher price per million output tokens; a request costs its input tokens times the input price plus its output tokens times the output price.

Source: https://digitspace.ai/learn/llm-token-pricing · Last checked: 2026-10-30

## Working out one request

claude-haiku-5-5 at $0.10 per million input tokens and $0.50 per million output tokens.

1. **Input.** 1,840 tokens × $0.10 / 1,000,000 = $0.000184
2. **Output.** 212 tokens × $0.50 / 1,000,000 = $0.000106
3. **Total.** $0.000290, or about $0.29 per thousand such requests

## Kinds of tokens

| Kind | What it is | Price |
| --- | --- | --- |
| Input | Everything you send: system prompt, messages, tool definitions | The model's input price |
| Output | What the model writes, including reasoning on reasoning models | The model's output price, usually higher |
| Cached input | Input the provider has already seen and kept | Much less than input, on providers that support it |
| Cache write | Input stored for later reuse | A little more than input, on some providers |

## Rules of thumb

A page of English is about 500 to 700 tokens. Code and other languages often use more tokens per character. Images are charged as a number of tokens that depends on their size.

## Questions

### Why do output tokens cost more?

The model generates them one at a time, which takes far more computing than reading input.

### How do I count tokens before sending?

The token cost calculator counts a prompt's tokens and prices it across models.

## Related

- [Token cost calculator](https://digitspace.ai/token-cost-calculator)
- [How to cut LLM API costs](https://digitspace.ai/learn/reduce-llm-costs)
- [Cost tracking](https://digitspace.ai/features/cost-tracking)
- [Models](https://digitspace.ai/models)

Start free: https://digitspace.ai/signup · Docs: https://digitspace.ai/docs · Pricing: https://digitspace.ai/pricing
