Claude Sonnet 4.6 vs GPT 5.4

Direct comparison between anthropic and openai for chat models. Specs, prices, strengths, weaknesses — decide on facts.

At a glance

  • · Cheaper: GPT 5.4
  • · Longer context window: GPT 5.4 at 400,000 tokens
  • · Claude Sonnet 4.6: Best-in-class for code refactoring and multi-step pull requests
  • · GPT 5.4: Better tool-use accuracy than GPT-5.3 with shorter outputs

Spec comparison

SpecClaude Sonnet 4.6GPT 5.4
Provideranthropicopenai
Input per 1M tokens$3.00 / 1M$2.50 / 1M
Output per 1M tokens$15.00 / 1M$15.00 / 1M
Context window200,000 tok400,000 tok
Max output64,000 tok16,384 tok
Knowledge cutoff2025-072026-01
Vision
Tool calling
JSON mode
Structured output
Reasoning

Claude Sonnet 4.6 — strengths

  • +Best-in-class for code refactoring and multi-step pull requests
  • +Very stable tool-use loops — low hallucination on arguments
  • +64k output tokens fit whole files in one response

GPT 5.4 — strengths

  • +Better tool-use accuracy than GPT-5.3 with shorter outputs
  • +Native vision for screenshots, charts, and documents
  • +400k context — fits code repos and long conversations

Claude Sonnet 4.6 — weaknesses

  • Knowledge cutoff July 2025 — no recent web knowledge
  • No native JSON mode — schema enforcement via tool-call trick

GPT 5.4 — weaknesses

  • Pricier per token than Sonnet 4.6 at comparable coding quality
  • Reasoning mode noticeably increases latency over standard calls
Details: Claude Sonnet 4.6Details: GPT 5.4