What Are Tokens in AI and Why Do They Matter for Your Bill?
Understand how tokens work, how they're calculated, and how to optimize their usage.
PromptRouter Team
AI Experts
What Are Tokens in AI and Why Do They Matter for Your Bill?
If you use AI APIs, you'll hear a lot about "tokens." Let's explain what they are and why they're so important.
What is a Token?
A token is the basic unit of text that language models process. It's not exactly a word:
- "Hello" = 1 token
- "Intelligence" = 2-3 tokens
- "PromptRouter" = 2 tokens
- A space also counts
General rule: 1 token ≈ 4 characters in English, or ¾ of a word.
Why Do They Matter?
Because you pay for them. AI providers charge per million tokens:
| Model | Input (per 1M) | Output (per 1M) |
|---|---|---|
| GPT-4 Turbo | $10 | $30 |
| Claude Opus | $15 | $75 |
| GPT-3.5 | $0.50 | $1.50 |
| Claude Haiku | $0.25 | $1.25 |
Input vs Output Tokens
- Input tokens: Your question + system context
- Output tokens: The model's response
Output tokens are usually more expensive because they require more computation.
Practical Example
Imagine this prompt:
System: You are a customer service assistant.
User: What is your return policy?
- Input: ~20 tokens
- Estimated output: ~100 tokens
With GPT-4 Turbo:
- Input: 20 × $0.00001 = $0.0002
- Output: 100 × $0.00003 = $0.003
- Total: $0.0032 per request
If you have 100,000 requests/month: $320/month
With an economical model like GPT-3.5:
- Total: $0.0002 per request
- 100,000 requests/month: $20/month
How to Optimize Token Usage
- Concise prompts: Eliminate unnecessary words
- Limit responses: Use
max_tokensto control output - Choose the right model: Don't use a cannon to kill a fly
- Use intelligent routing: Let PromptRouter choose for you
Savings with PromptRouter
PromptRouter analyzes each request and decides:
- Is it a simple question? → Economical model
- Does it require complex reasoning? → Premium model
Result: You use premium tokens only when you really need them.
Optimize every token. Get started with PromptRouter.