Which AI is best for programming depends on what you hand it. For everyday edits we would start with mid-tier models, for heavy agentic work with flagships, for bulk small jobs with the cheapest ones, and we would pick the winner by measuring on your own repository. Below: a task-to-model table with prices, selection criteria, a benchmarking method with a script, and the free and local options.
Best AI for programming: a table by task
The codexkey catalog held 44 text models on 29 October 2026. Prices in the table come from the codexkey price list of 29 October 2026, and the models page shows current ones. Each model's purpose is described in the vendor's own words: Anthropic, OpenAI, Google. That is the maker's positioning, not the result of our measurements.
| Task | Models for a first test | Basis | Price per 1M tokens, input / output, USD |
|---|---|---|---|
| Long agentic tasks, complex refactoring | claude-opus-5-5, gpt-6.1-sol | Anthropic recommends Opus 5.5 for long agentic coding; OpenAI describes 6.1 Sol as a model close to Astra for less money | 0.86 / 4.32 and 0.28 / 1.42 |
| Everyday code: features, bug fixes, tests | claude-sonnet-5-5, gpt-6-sol, gemini-3.8-flash | Anthropic calls Sonnet 5.5 the best mix of speed and intelligence; Google designed 3.8 Flash for long engineering work; gpt-6-sol is in as a price-driven candidate | 0.52 / 2.6; 0.14 / 0.68; 0.2 / 0.96 |
| The hardest work, where Opus failed | claude-fable-5-1, gpt-6-astra | Anthropic suggests Fable 5.1 when Opus 5.5 at high effort fails your checks; OpenAI calls Astra its most powerful model | 7.48 / 37.44 and 0.68 / 3.3 |
| Bulk small jobs: review comments, commit messages, classification | claude-haiku-5.5, gpt-6-luna, deepseek-v4.1-flash | Anthropic positions Haiku 5.5 for high-volume, low-latency work; OpenAI calls Luna the most efficient for bulk narrow tasks; DeepSeek V4.1 Flash has the lowest output price | 0.08 / 0.32; 0.04 / 0.22; 0.04 / 0.16 |
| Budget agent | deepseek-v4-pro, qwen3.8-max, glm-5.3, kimi-k3.1-pro, minimax-m3 | Price. For DeepSeek, the documentation confirms tool calling and a 1M context; check the others yourself | 0.12 / 0.34; 0.28 / 0.86; 0.2 / 0.6; 0.42 / 2.06; 0.06 / 0.2 |
| Free | deepseek-v4.1-flash-1017-free, minimax-m3-free, qwen3.8-flash-free | Zero price in the price list, terms on the models page | 0 / 0 |
In the codexkey price list Fable 5.1 costs about 8.7 times as much as Opus 5.5, on input and on output. Move up to it only when Opus at high reasoning effort fails your checks.
Most models in the catalog have a 1M-token context. The exceptions: grok-4.5, grok-4.6 and grok-4.7 give 256K, kimi-k2.7-code 262K, claude-haiku-4.5 200K. If a whole repository has to fit in one request, read that column of the catalog.
A model that is missing from the catalog is missing from the table. Google's documentation names Gemini 4 Argon as its flagship and OpenAI shows GPT-6.1 Terra, but neither is in the codexkey catalog as of 29 October 2026. For Opus 5.5, Sonnet and Fable compared on price and scenarios, see Opus 5.5, Sonnet and Fable.
What to compare when you choose
This article carries no public quality numbers, on purpose. The Aider polyglot leaderboard (225 Exercism tasks in six languages, page aider.chat/docs/leaderboards) was last updated on 20 November 2025, as of 29 October 2026. Its top ten holds gpt-5, o3, Gemini 2.5 Pro and Grok 4, and none of the catalog's recent models. So we lean on criteria you can check yourself:
- Price per solved task. The token price misleads: a cheap model that needs three attempts instead of one can end up costing more than an expensive one. Count money per task, not per million tokens.
- Tools. An agent breaks where the model mixes up the tool-call format or forgets to read a file before editing it. For agentic work, test exactly that.
- Context. A whole monorepo or three files: both the model and the bill depend on it.
- Speed. If you sit waiting for an answer in the editor, latency matters more than a few extra points of quality. A background agent does not care.
- Your stack. Test a rare language or 1C (the Russian business-software platform) separately: on a niche stack the same model can behave noticeably worse than on a popular one.
- Hand edits. How many lines you rewrote after the model. No ranking will show you that number.
Test a model on your own code in one evening
The method takes an evening and tells you more than anyone else's ranking.
- Take 10-20 tasks from your project's history: fixed bugs and small features. Each needs a test that failed before the fix and passes after it.
- Run every model on every task with the same prompt. Twice is better, because answers are not deterministic.
- Record whether the task was solved, how many input and output tokens it took, and how many hand edits it needed.
- Work out the price per solved task: total spend on all attempts divided by the number solved.
A hypothetical example with assumed inputs. One attempt burns 400 thousand input tokens and 30 thousand output tokens, across ten tasks. We set the number of solved tasks ourselves; it is not a measurement result:
| Model | Price of ten attempts | Solved (assumed) | Per solved task |
|---|---|---|---|
claude-haiku-5.5 | $0.42 | 4 | about $0.10 |
claude-sonnet-5-5 | $2.86 | 7 | about $0.41 |
claude-opus-5-5 | $4.74 | 9 | about $0.53 |
The cheapest model wins on money per solved task, but six tasks out of ten will need finishing by hand, and your time is not in the formula. A real table needs one more column: time spent on rework.
The benchmarking script runs through the OpenAI-compatible address of codexkey. Each task needs a tasks/<name> folder holding prompt.txt, solution.py and a test_*.py test that runs under pytest:
import re
import subprocess
import sys
from pathlib import Path
from openai import OpenAI
client = OpenAI(base_url="https://api.codexkey.online/v1", api_key="sk_cdx_YOUR_KEY")
PRICES = {
"claude-sonnet-5-5": (0.52, 2.6),
"gpt-6-sol": (0.14, 0.68),
"deepseek-v4.1-flash": (0.04, 0.16),
}
def run_attempt(model: str, task: Path) -> dict:
prompt = (task / "prompt.txt").read_text(encoding="utf-8")
source = (task / "solution.py").read_text(encoding="utf-8")
reply = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": f"{prompt}\n\n{source}\n\nReturn the whole new file."}],
)
code = re.sub(r"^```\w*\n|\n```$", "", reply.choices[0].message.content.strip())
(task / "solution.py").write_text(code, encoding="utf-8")
passed = subprocess.run([sys.executable, "-m", "pytest", "-q", str(task)]).returncode == 0
(task / "solution.py").write_text(source, encoding="utf-8")
price_in, price_out = PRICES[model]
usage = reply.usage
cost = (usage.prompt_tokens * price_in + usage.completion_tokens * price_out) / 1_000_000
return {"model": model, "task": task.name, "passed": passed, "cost": cost}
if __name__ == "__main__":
for model in PRICES:
results = [run_attempt(model, task) for task in sorted(Path("tasks").iterdir())]
solved = sum(r["passed"] for r in results)
total = sum(r["cost"] for r in results)
print(model, f"solved {solved}/{len(results)}", f"total ${total:.3f}", f"per solved ${total / max(solved, 1):.3f}")
We ran the script against a stub client: it computes cost from usage, runs the tests and restores the original file after every attempt. No network calls to models were made in that check.
Free and local AI for programming
Free almost always means "with limits". What exists as of 29 October 2026:
- The codexkey catalog has three zero-price models:
deepseek-v4.1-flash-1017-free,minimax-m3-free,qwen3.8-flash-free. Check the models page for limits and terms; we do not make them up. - The Gemini API free tier includes Gemini 3.8 Flash, while Gemini 3.1 Pro Preview is not available there (pricing page
ai.google.dev/gemini-api/docs/pricing). Google notes that free-tier data may be used to improve its products, so do not send private code there. - Qwen3-Coder 30B runs locally: in the Ollama library it is
ollama run qwen3-coder:30b, a 19 GB file with a 256K context and 30 billion parameters in total, 3.3 billion of them active (model page). Ollama puts the 480-billion version at 250 GB of memory at minimum. How to size memory for weights and context is covered in Qwen 3.8 27B locally.
We did not compare a local model with the cloud flagships, so we give no quality numbers. Your own task set from the previous section will show the gap more accurately.
AI for Python, 1C and rarer stacks
Python is the easiest to test: a pytest test gives an objective criterion, and the script above is already built on it. Ask for types and tests along with the code, and you will make fewer hand edits.
1C is different. Claude works with a configuration through its text export, and code like that does not go into a production database without a mandatory manual check. We walked through the setup in Vibe coding for 1C. For a general overview of AI for vibe coding there is The best AI for vibe coding, and a comparison of Claude and GPT by type of task sits in Claude or GPT for code.
Connecting your chosen model through codexkey
codexkey gives API access to models, not subscriptions to the vendors' apps. One key, sk_cdx_..., works in two formats: an OpenAI-compatible address, https://api.codexkey.online/v1, and an Anthropic-compatible one, https://api.codexkey.online without /v1. You can pay with a Russian card, through SBP (the Russian Faster Payments System) or with crypto, and you need no VPN and no vendor account.
- Claude Code. Set
ANTHROPIC_BASE_URLand the key, and switch models with the/modelcommand. The full settings block is in the Claude Code guide. - Codex.
~/.codex/config.tomldefines a provider withbase_url = "https://api.codexkey.online/v1"andwire_api = "responses"; for a quick model choice usecodex --model gpt-6.1-sol. The steps are in the Codex guide, and the choice between Sol, Astra and Luna is covered in Codex models. - OpenCode. Two providers in
~/.config/opencode/opencode.json; a model is written ascodexkey/gpt-6-astra.
GET https://api.codexkey.online/v1/models returns every ID. To compare other candidates, replace the PRICES dictionary in the benchmarking script with your own models and prices from the catalog.
FAQ
Which AI is best for programming in 2026?
There is no single best. For daily work we would start with mid-tier models such as Claude Sonnet 5.5 or GPT-6 Sol, for hard agentic tasks with Opus 5.5, GPT-6.1 Sol or Astra, and for bulk small jobs with Haiku 5.5, GPT-6 Luna or DeepSeek V4.1 Flash. Make the final call by measuring on your own tasks.
Which AI is best for programming for free?
In the codexkey catalog deepseek-v4.1-flash-1017-free, minimax-m3-free and qwen3.8-flash-free carry a zero price; the terms are on the models page. Beyond those there is the Gemini API free tier for Gemini 3.8 Flash and a local Qwen3-Coder 30B through Ollama. Free tiers are limited, and on some of them your data may be used to improve the product.
Which AI models for programming run locally?
Of what we checked: Qwen3-Coder 30B in Ollama, a 19 GB file with a 256K context. Leave memory headroom for the weights and the context. Check quality against the cloud flagships on your own tasks.
Which AI should I choose for programming in Python?
Any model from the table will do, and the choice is best made by tests: write pytest tests for your tasks, run two or three models and compare the price per solved task. The script in this article follows exactly that scheme.
Is there AI for programming in 1C?
General-purpose models work with 1C through a text export of the configuration. Check the result by hand before loading it into the database. The detailed setup is in Vibe coding for 1C.
Can I trust rankings of AI for programming?
Only with caveats. Public tables lag behind the models, their tasks are not yours, and the way they run a model may differ from yours. Aider polyglot, for example, was last updated on 20 November 2025, and its top ten has no model from the current codexkey catalog. A small test on your own code is the safest route.
How much does it cost to program with AI?
It depends on the model and the volume. By the codexkey price list of 29 October 2026, a million input tokens cost $0.04 for DeepSeek V4.1 Flash, $0.52 for Sonnet 5.5 and $7.48 for Fable 5.1. Count the price per solved task, not the price per token.