Side-by-side technical and economic comparison between Anthropic's Claude Sonnet 5 and Google's Gemini 3.1 Pro Preview.
| Metric | Claude Sonnet 5 | Gemini 3.1 Pro Preview | Advantage |
|---|---|---|---|
| Provider Organization | Anthropic | — | |
| Standard Input / 1M | $2.00 | $2.00 | Identical |
| Cached Input / 1M | $0.20 | $0.20 | Gemini 3.1 Pro Preview lower |
| Output / 1M | $10.00 | $12.00 | Claude Sonnet 5 lower |
| Context Window | 1M | 1.05M | Gemini 3.1 Pro Preview (1.05M) |
| Max Generation Tokens | 16.4k | 16.4k | Claude Sonnet 5 |
| Tokenizer Family | Anthropic Claude BPE (~65k vocabulary) | Google Gemini SentencePiece (256k vocabulary) | — |
| Workload (per month) | Claude Sonnet 5 | Gemini 3.1 Pro Preview |
|---|---|---|
| Chatbot10k requests · 500 in / 200 out | $30.00 | $34.00 |
| RAG app100k requests · 8,000 in / 1,200 out | $2,800.00 | $3,040.00 |
| Coding agent100k requests · 12,000 in / 2,000 out | $4,400.00 | $4,800.00 |
Standard rates, no caching or batch discounts. Model your own numbers below.
Opt for Claude Sonnet 5 when your engineering requirements prioritize Anthropic's ecosystem, specific tokenizer efficiencies (Calibrated Claude Tokenizer (±3%)), or when your expected prompt-to-completion ratios favor its $2/M input rate.
Opt for Gemini 3.1 Pro Preview when looking for Google's tooling integration, specific context window depth (1.05M tokens), or when output generation volume favors its $12/M rate.
At a typical 3:1 input-to-output token mix, Claude Sonnet 5 is about 11% cheaper than Gemini 3.1 Pro Preview. Claude Sonnet 5 costs $2 per 1M input and $10 per 1M output tokens; Gemini 3.1 Pro Preview costs $2 and $12.
Gemini 3.1 Pro Preview has the larger context window: 1.05M tokens vs 1M.
Claude Sonnet 5: yes, cached input costs $0.2/1M. Gemini 3.1 Pro Preview: yes, cached input costs $0.2/1M.