Token & API cost calculator
Estimate how many tokens your text uses and what it costs at your provider's prices.
Token counts are estimates (≈4 characters or ≈0.75 words per token for English). Enter your model's current prices from the provider's pricing page.
How token pricing works
AI APIs bill separately for the tokens you send (input) and the tokens the model writes (output), usually quoted per million tokens. Output tokens are typically several times more expensive than input tokens, so long answers cost more than long prompts. Reduce costs by trimming unnecessary context, caching repeated instructions where your provider supports it, choosing smaller models for simple tasks, and setting a maximum output length.