Model comparison

Claude Sonnet 5 vs Gemini 3.1 Pro Preview

Compare Claude Sonnet 5 vs Gemini 3.1 Pro Preview API pricing: input/output token costs, cache pricing, context windows, workload estimates, and routing fit.

Claude Sonnet 5

anthropic · claude-sonnet-5

Input
$2
Output
$10
Context
1M

Gemini 3.1 Pro Preview

gemini · gemini/gemini-3.1-pro-preview

Input
$2
Output
$12
Context
1M

Quick take

Claude Sonnet 5 has the lower input price at $2 per 1M input tokens. Claude Sonnet 5 is cheaper for the example blended workload below. Gemini 3.1 Pro Preview has the larger context window at 1M tokens.

Choose Claude Sonnet 5 if...

  • Claude Sonnet 5 is the better default for cost-sensitive traffic and repeated high-volume calls.
  • Claude Sonnet 5 gives more room for long generated answers, reports, or code output.

Choose Gemini 3.1 Pro Preview if...

  • Gemini 3.1 Pro Preview is safer for long documents, repository analysis, and RAG prompts because it has the larger context window.

Example workload cost

Estimates use input tokens plus 20% output tokens. They exclude provider discounts, cache hits, and tool/search surcharges.

Workload Claude Sonnet 5 Gemini 3.1 Pro Preview Cheaper
1M input + 200K output $4.00 $4.40 Claude Sonnet 5
10M input + 2M output $40.00 $44.00 Claude Sonnet 5
100M input + 20M output $400.00 $440.00 Claude Sonnet 5

Context, output, and capability fit

Gemini 3.1 Pro Preview provides the larger context window. Check max output separately when the task needs long reports, code generation, or full-document rewrites.

Claude Sonnet 5 max output
128K
Gemini 3.1 Pro Preview max output
65.5K
Claude Sonnet 5 features
prompt caching, function calling, vision
Gemini 3.1 Pro Preview features
prompt caching, function calling, vision

Risk notes for Claude Sonnet 5

  • No major capability risk is flagged in this snapshot, but provider pages should still be verified before production routing.

Risk notes for Gemini 3.1 Pro Preview

  • Preview or beta model: verify availability and pricing before production rollout.

Routing tags

frontierreasoningcodingagentsenterprise-raglong-contextmultimodalcache-friendlyragpreview

Related comparisons