API Credits
AI Token Costs Guide
How LLM API pricing works as a billing database: tokens vs words, input vs output rates, context length effects, and how to estimate a real workload before you compare providers.
By AI Credits Editorial · Content updated 2026-08-28
What token costs measure
LLM APIs bill in tokens — sub-word pieces — not whole words or characters. English text is often ~0.75 words per token, but code, non-English text, and structured JSON can differ. Providers quote separate per-million rates for input (prompt) and output (completion). Treat published $/1M figures as the unit of comparison across models.
Input vs output pricing
Output tokens almost always cost more than input tokens. Chat and agent apps that stream long answers therefore cost more than classify/extract jobs with short replies. When you model a feature, estimate prompt size and expected completion length separately — using a single “average tokens” number hides the expensive half of the bill.
Context length and hidden input
Long contexts raise cost even when the user message is short: system prompts, tool schemas, retrieved documents, and chat history all count as input. A 100k-token context at a mid-tier rate can dominate spend before the model writes a single sentence. Prefer retrieval that returns only the needed chunks, and cap history windows.
How to estimate a workload
A practical estimate: (input_tokens / 1e6 × input_rate) + (output_tokens / 1e6 × output_rate). Multiply by daily requests for monthly burn. Use the same sample workload (for example 1M input + 500K output) when ranking models so differences come from price, not from inconsistent assumptions.
List price vs effective cost
List price is not the whole story: free tiers, startup grants, volume discounts, and relays change effective cost. Still, you need the token math first — otherwise “cheaper provider” comparisons mix billing units. After you understand tokens, use calculators and ranked lists for decisions.
Related tools on this site
This page explains the pricing unit. Use /ai-api-cost-calculator or /openai-api-cost-calculator to run numbers, /cheapest-llm-api for a ranked leaderboard, /llm-cost-optimization for reduction tactics, and /api-credits for live model price tables.