code q&a
Resources About

Which AI model should I use?

The best models for coding, plus open models you can run yourself, with API prices

An AI model is the brain behind coding assistants like Claude Code, Codex, and Cursor. Your assistant picks a model for you, and most of them let you switch to another one. The best model for coding is the one that gets your work right, and most people pay for it through a subscription instead of per token.

Model Comparison

API prices are per million input and output tokens, for when you pay per use through the API. Scroll to compare all models side by side.

Feature Claude Opus 5.5 Claude Sonnet 5.5 Claude Fable 5.2 GPT-6.2 Astra GPT-6.2 Sol Gemini 4 Neon
Made by Anthropic Anthropic Anthropic OpenAI OpenAI Google
Coding leaderboards ✓ Top tier Close behind ✓ Top tier ✓ Top tier Close behind ✓ Top tier
Default in Claude Code Not a default Not a default Not a default Codex Antigravity
API input price $4 $2 $8 $8 $2 $3
API output price $20 $10 $40 $40 $10 $15
Context window 1M tokens 1M tokens 1M tokens 1.05M tokens 1.05M tokens 1M tokens
Best for Everyday agentic coding Side projects on a budget The hardest problems Codex users who want the best Balanced cost in Codex Antigravity and Google users

The Top Coding Models

These are the models worth knowing, and most of them are reasoning models that think before they answer.

Claude Opus 5.5

$4 / $20

The model I use every day

Best for: everyday coding in Claude Code, big multi-file changes, long agent sessions
  • Near the top of every coding leaderboard
  • The default model in Claude Code
  • Cheaper than the Opus models before it
  • Effort levels from Low to Max, starting at Medium
  • Only available through Anthropic, AWS, Google Cloud, and Microsoft
  • Costs twice as much as Sonnet 5.5
See Claude pricing → Included with Claude Pro and Max

Claude Sonnet 5.5

$2 / $10

Anthropic's balance of speed and smarts

Best for: side projects, everyday coding on a budget, quick back-and-forth
  • Half the price of Opus 5.5
  • Fast enough for quick back-and-forth
  • Same 1M-token context window as Opus
  • A step behind Opus on hard, multi-step changes
See Claude pricing → Included with every Claude plan

Claude Fable 5.2

$8 / $40

Anthropic's most capable model

Best for: the hardest bugs and designs, long tasks where getting it right matters more than cost
  • Tops several coding leaderboards
  • Built for long, demanding agent work
  • Twice the price of Opus 5.5
  • Single turns can run for many minutes
See Claude pricing → API and higher Claude plans

GPT-6.2 Astra

$8 / $40

OpenAI's flagship for reasoning and coding

Best for: Codex users who want the strongest OpenAI model
  • Close to the top of coding leaderboards
  • 1.05M-token context window
  • Available in Codex and ChatGPT
  • Prompts over 272K tokens cost twice as much to send
  • Not the default in Codex, so you have to pick it
See OpenAI pricing → Included with ChatGPT plans

Gemini 4 Neon

$3 / $15

Google's top coding model

Best for: Antigravity users, Google AI subscribers
  • Leads some coding leaderboards
  • The default model in Antigravity
  • Cheaper than Opus 5.5 and GPT-6.2 Astra
  • No free API tier for this model
  • Fewer coding tools offer it than Claude or GPT
See Gemini pricing → Included with Google AI plans

Open Models

Open models publish their weights, so you can run them on your own hardware or pick from many hosts. I haven't used these myself, but they're worth a look if privacy or cost matters more to you than having the very best model. Most of them are too big to run at home, so you'll usually reach them through an API like the others.

Feature DeepSeek V4 Pro Kimi K3 GLM 5.2 Qwen3-Coder-Next
Made by DeepSeek Moonshot AI Z.ai Alibaba
License ✓ MIT Custom, with limits for big companies ✓ MIT ✓ Apache 2.0
Size 1.7T parameters 2.8T parameters About 750B parameters 80B parameters
Run it at home ✗ Too big ✗ Too big ✗ Too big ✓ With about 48GB of memory
API input price $1.32, half off-peak $3 $1.40 Varies by host
API output price $3.96, half off-peak $15 $4.40 Varies by host
Best for Strong and cheap The biggest open model Coding agents on a budget Coding on your own machine

DeepSeek V4 Pro

$1.32 / $3.96

A strong open model at a low price

Best for: coding on a budget, teams that want the option to self-host later
  • MIT license, so you can use it for almost anything
  • Half price outside peak hours on the DeepSeek API
  • 1M-token context window
  • Far too big to run on your own computer
  • The DeepSeek API is a Chinese provider, which rules it out for some companies
See DeepSeek V4 Pro → Open weights on Hugging Face

Kimi K3

$3 / $15

The largest open model

Best for: hard tasks where you still want open weights
  • Close to the top closed models on many benchmarks
  • Weights are free to download
  • Big companies need a separate agreement to use it
  • Costs about the same as Gemini 4 Neon through the API
See Kimi K3 → Open weights on Hugging Face

GLM 5.2

$1.40 / $4.40

An open model built for coding agents

Best for: long coding tasks on a budget
  • MIT license with no regional limits
  • Built for coding and long-running agent work
  • 1M-token context window
  • Too big to run at home
See GLM 5.2 → Open weights on Hugging Face

Qwen3-Coder-Next

Free to run

A coding model you can run on your own computer

Best for: private coding with no API bill, working offline
  • Runs locally with tools like Ollama and LM Studio
  • Only 3B of its 80B parameters work on each token, so it runs fast
  • Apache 2.0 license
  • Needs about 48GB of memory for the smaller download
  • Not as strong as the big hosted models on hard tasks
See Qwen3-Coder-Next → Open weights on Hugging Face