Benchmarks

Claude Code Alternatives: OpenCode With DeepSeek, GLM, Kimi and Qwen, Priced per Task

Claude Code alternatives, priced per finished task: OpenCode with DeepSeek cost about a cent, GLM-5.3 cost what Sonnet did, and the host set the bill.

MesmerTools•November 4, 2026•5 min

The cheapest Claude Code alternative in my tests was OpenCode running DeepSeek V4.1 Flash through OpenRouter. It passed all eight of my coding tasks for about a cent each, a twelfth of what Sonnet 5.5 cost in Claude Code. Claude Code pointed at the same DeepSeek model passed all eight for a cent and a half, so the saving came from the model, not the tool.

Open models aren't automatically cheap, though, and the reason is a line nobody puts in the headline: cached input. An agent resends its whole conversation on every step, so about nine in ten of the tokens it sends are ones the host has already seen and bills at a separate cached rate. Anthropic's is 10 cents per million for Sonnet 5.5, and as of October 2026 almost every host serving GLM-5.3 or Kimi K3 charges more, so cached input was over half of what GLM-5.3 cost me and it landed at Sonnet's 14 cents a task. That makes the host matter about as much as the model: the same model costs very different amounts depending on who serves it.

A minimal terminal window with an amber cursor, a long receipt of identical gray blocks unrolling from it and ending in one short amber block, under the headline Claude Code Alternatives
An agent's bill is mostly the same context sent again on every step. The new work is the short bit at the end.

Everything passed, so these runs compare cost and time

The tasks are the eight from my Opus vs Sonnet comparison: bug fixes, a CSV export, a payments feature, a refactor, a SQLite migration and a test-writing job on a small TypeScript invoicing API, each graded by tests the agent never saw. I ran four open models in OpenCode through OpenRouter, plus DeepSeek inside Claude Code, once per task, and paid what OpenRouter billed.

Nothing failed: every setup passed every task it ran, so these tasks can't say which model is smarter. With one run per task, read the bars as what these runs cost, not as averages.

What a finished task cost

Claude CodeOpenCode
Cost per taskTime
DeepSeek V4.1 FlashOpenCode
1.2¢
65 s
DeepSeek V4.1 FlashClaude Code
1.6¢
66 s
Haiku 5.5Claude Code
1.7¢
65 s
Qwen3.8 27BOpenCode
7.0¢
2.1 min
GLM-5.3OpenCode
14¢
2.1 min
Sonnet 5.5Claude Code
14¢
42 s
Kimi K3OpenCode, 3 of 8 tasks
21¢
3.0 min
Sonnet 5.5Claude Code, same 3 tasks
9.7¢
28 s
GLM-5.3 lands next to Sonnet on cost and takes three times as long. Open models are what OpenRouter billed; Sonnet and Haiku are Claude Code's own list-price figure from that earlier comparison. Time is the mean per task.

Kimi K3 only got three of the eight tasks before my budget ran out, so its bar covers different work. It averaged 21 cents on those three; Sonnet averaged 10 cents on the same three.

Why a model that's cheap per token can cost as much as Sonnet

Anthropic's 10 cents is the bar. GLM-5.3's seven hosts charged between 6 and 23 cents per million cached tokens, and in seven of my eight runs the host charged more than 10 cents. The three that served Kimi K3 charged 25 to 55 cents. DeepSeek V4.1 Flash's hosts charged a tenth of a cent to 3 cents, and its output is cheap too, which is why it wins.

Cached input was 57% of GLM-5.3's bill. On DeepSeek, Qwen and Kimi it was 26 to 37%, with output tokens close behind or ahead. The open models also took more steps: Sonnet averaged 7 requests and 170,000 input tokens per task, GLM-5.3 19 requests and 470,000, Qwen3.8 27B 20 and 600,000. Reading nearly three times as much at a higher price per cached token is how GLM-5.3 ended up with Sonnet's bill.

On OpenRouter, the host sets the price as much as the model does

OpenRouter (what it is and what people pay on it) hands each request to one of the companies that run the model and, by default, spreads requests across them. My eight GLM-5.3 runs landed on seven hosts. Priced at each host's list rates, the same work comes to 8 cents a task on the cheapest, 21 on the one the model's maker runs and 45 on the dearest. Pinned to the cheapest, GLM-5.3 would have undercut Sonnet; left to the router, it didn't.

Qwen3.8 27B shows the same spread, 7 cents as billed against about 1.4 on its cheapest listed host. OpenRouter lets you sort hosts by price or pin one, but some of the cheap ones serve 4-bit builds and I didn't test whether quality differs by host.

OpenCode's own cost readout won't catch any of this. It came in under what OpenRouter billed in 21 of my 27 runs, by as much as 2.5 times, and on GLM-5.3 it showed about two thirds of the real bill, so read costs off your OpenRouter activity page instead.

OpenCode vs Claude Code: does the smaller prompt matter?

Before you type anything, Claude Code sends about twice as much as OpenCode. With the same model on both, so the counts compare directly, Claude Code's first request was about 16,400 tokens and OpenCode's about 8,300, mostly because Claude Code describes 20 tools to OpenCode's 10.

Tokens in the first request, before any work (DeepSeek V4.1 Flash)

Claude Code
16.4k
OpenCode
8.3k
OpenCode, loading Claude Code skills
14.1k
Median first request across the eight tasks, with the repo's instructions file and the task prompt included, which is why Claude Code sits a little above the 15.7k in my Codex comparison. OpenCode also picks up skills installed for Claude Code; the last bar is one run on my machine.

That prefix rides along on every step, but it's cached after the first one, so it costs less than it looks. Across the eight tasks Claude Code read 14% more input tokens than OpenCode on the same DeepSeek model, about 11% more money at a fixed price. The gap was widest on the smallest tasks (Claude Code read 266,000 tokens on the rounding fix against OpenCode's 91,000) and narrower on bigger ones, where Claude Code sometimes took fewer steps. In these runs, changing the tool moved the bill by about a tenth and changing the model moved it tenfold.

Two OpenCode defaults are worth changing if you go that way. It loads the skills you installed for Claude Code, which OPENCODE_DISABLE_CLAUDE_CODE=1 turns off. And it names each session by sending your first message to Claude Haiku through your OpenRouter key, so if you chose an open model to keep your work away from Anthropic, set small_model in opencode.json to the model you actually want.

You can keep Claude Code and swap the model

If you like Claude Code and only mind the bill, point it at OpenRouter and give every model slot the cheap model. This setup passed all eight tasks with DeepSeek:

export ANTHROPIC_BASE_URL=https://openrouter.ai/api
export ANTHROPIC_AUTH_TOKEN=$OPENROUTER_API_KEY
export ANTHROPIC_API_KEY=""
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek/deepseek-v4.1-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek/deepseek-v4.1-flash
claude --model deepseek/deepseek-v4.1-flash

DeepSeek is the only open model I ran this way. Anthropic's own cheap model lands in the same place: Haiku 5.5 in plain Claude Code also passed all eight, at 1.7 cents a task.

Which Claude Code alternative I'd use

If you already pay for a Claude plan with room to spare, none of this beats it, and Sonnet was the fastest thing I tested: half again as quick as DeepSeek and three times as quick as GLM-5.3 or Qwen. If you pay per token, I'd run routine tickets on DeepSeek V4.1 Flash, in whichever of the two tools you prefer, and switch to Sonnet when the wait costs you more than the extra 13 cents.

I wouldn't pick GLM-5.3 or Kimi K3 through OpenRouter to save money. Their case would be quality on harder work than these tasks measure, and I can't show that here. If what you want is another company's agent on a flat plan, that's Codex, which I compared with Claude Code separately.

Before you commit to any cheap model, send one real ticket through it and look at which host OpenRouter used. The host is on your activity page, and it explains the number.

More from the Blog