//
Search across all documentation pages
6 pages in this section.
Understand why input, output, cached-read, and cache-creation tokens carry different per-model prices.
Count tokens with the Messages API and estimate a request's cost before you send it.
Compare per-million-token pricing and real task costs across Sonnet 5, Opus 4.8, and Fable 5.
Wire messages.count_tokens into your pipeline to price requests before they hit the API.
Design a router that sends classification work to Haiku and reasoning work to Opus.
A field guide to picking models, caching aggressively, and batching for maximum savings.