LiteLLMLiteLLM/ MODELS

Claude Sonnet 5 vs Gemini 4 Carbon

As of November 10, 2026, Claude Sonnet 5 and Gemini 4 Carbon cost the same: $2.00 per 1M input tokens and $10.00 per 1M output tokens. Gemini 4 Carbon has the larger context window: 1,048,576 tokens versus 1,000,000.

Prices from LiteLLM's price fileChecked

Claude Sonnet 5 vs Gemini 4 Carbon side by side

Headline prices in US dollars per 1M tokens: each model's own lab where it sells it, otherwise its cheapest provider. Source: LiteLLM model price file, as of November 10, 2026.
Claude Sonnet 5Gemini 4 Carbon
Input, per 1M tokens$2.00$2.00
Output, per 1M tokens$10.00$10.00
Cache read, per 1M tokens$0.20$0.10
Cache write, per 1M tokens$2.50–
Context window1,000,000 tokens1,048,576 tokens
Max output128,000 tokens1,048,576 tokens
Image inputYesYes
Tool callingYesYes
Structured output (JSON)YesYes
Prompt cachingYesYes
ReasoningYesYes
Providers on LiteLLM112
Price shown is fromAnthropicGoogle AI Studio
Added to LiteLLMJune 30, 2026November 10, 2026

Cheapest provider for each

Benchmark scores

From the Epoch AI Benchmarking Hub (CC BY 4.0), data as of August 27, 2026. Some results were run by Epoch and others collected by Epoch from each benchmark's own leaderboard, linked in the first column. Each model's best reported reasoning setting is shown in brackets. Higher is better. Only benchmarks with a score for both models are shown.
BenchmarkClaude Sonnet 5Gemini 4 Carbon
Coding and agents
APEX-Agents54.5%84.2%

When to pick which

Pick Claude Sonnet 5 for

  • Available from 11 providers through LiteLLM, vs 2.

Pick Gemini 4 Carbon for

  • Returns up to 1,048,576 tokens per response, vs 128,000.

From differences in the data above only; where the data is equal, no reason is given.

Call Claude Sonnet 5 or Gemini 4 Carbon with LiteLLM

Both use the OpenAI format through LiteLLM, so switching is a model name change. Set each provider's API key in the environment first.

Python SDK
from litellm import completion

messages = [{"role": "user", "content": "Hello!"}]

# Claude Sonnet 5
response = completion(model="claude-sonnet-5", messages=messages)

# Gemini 4 Carbon
response = completion(model="gemini/gemini-4-carbon", messages=messages)

# Claude Sonnet 5, falling back to Gemini 4 Carbon if the call fails
response = completion(model="claude-sonnet-5", messages=messages, fallbacks=["gemini/gemini-4-carbon"])

FAQ

Which is cheaper, Claude Sonnet 5 or Gemini 4 Carbon?

They cost the same: $2.00 per 1M input tokens and $10.00 per 1M output tokens, as of November 10, 2026.

Which has the larger context window, Claude Sonnet 5 or Gemini 4 Carbon?

Gemini 4 Carbon has the larger context window: 1,048,576 tokens, versus 1,000,000 for Claude Sonnet 5.

Can I switch from Claude Sonnet 5 to Gemini 4 Carbon without changing my code?

Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "claude-sonnet-5" to "gemini/gemini-4-carbon", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.