How LLM API Pricing Works: Tokens, Caching and Batch Discounts
LLM APIs charge per token, with separate prices for input and output, and discounts for cached input and batch jobs.
Tokens, not words
APIs bill by tokens. In English one token is roughly three-quarters of a word, so 1,000 words is about 1,300 tokens. Prices are quoted per 1 million tokens.
Input and output are priced separately
Input (your prompt, files and chat history) is usually several times cheaper than output (the model's reply). Long prompts with short answers are cheap; long generated answers are not.
Cached input
Many providers charge much less for input they have seen recently (prompt caching). Some also charge extra to write to the cache. Re-sending the same long system prompt is where caching saves most.
Batch discounts
Batch APIs process requests within hours instead of seconds, often at about half price. Good for evaluations, classification and back-office jobs.
Long-context surcharges
Some models charge a higher rate once a single request goes above a threshold such as 200,000 tokens.
Reasoning tokens
Reasoning models may spend hidden 'thinking' tokens that are billed as output. Your real output cost can be higher than the visible reply suggests.
Compare real prices on the model comparison or estimate a bill with the cost calculator.