DeepSeek, GLM, and OpenCode
Cheap models, a $10–$18 coding lid, and the open-source agent that can run them. What they are, how they plug together, and what you pay.
There is no DeepSeek coding agent to install, and GLM is not the cheap Claude Code. OpenCode is the actual open-source agent in this picture. Wrong aisle, three times.
DeepSeek and Z.ai sell brains. OpenCode is the hands that will take almost any brain. Claude Code, Codex and Grok Build still exist as native seats glued to their own models. The cheap stack is: OpenCode as the harness, DeepSeek Flash or GLM-5.3 as the model, and a bill that is tokens or a $10–$18 lid instead of a $200 native seat.
If you already pay for Claude, ChatGPT or SuperGrok, this is still not a fourth religion. It is a cheaper engine, and now also a cheaper harness. OpenCode can wear DeepSeek and GLM without pretending to be Claude. It can also log into Claude Pro/Max or ChatGPT Plus/Pro the official way.
Prices and model IDs as of 16 September 2026. Prices move. The two pages that actually settle an argument are DeepSeek Models & Pricing and Z.ai's GLM Coding Plan overview.
DeepSeek is a Hangzhou model lab. Current API names:
deepseek-flash (V4.1-Flash) and deepseek-v4-pro. Pay-as-you-go. For coding, start on Flash.GLM is Zhipu AI / Z.ai. The coding product is the GLM Coding Plan, from $18/month, for officially supported tools. Current models: GLM-5.3 and GLM-5.3-Flash.
OpenCode is the open-source coding agent (MIT, anomalyco/opencode). TUI, desktop, IDE. Free. You bring a model. Optional OpenCode Go is $10/month for curated open models including DeepSeek Flash and GLM-5.3. Optional Zen is PAYG.
How they fit. Point OpenCode at DeepSeek or Z.ai with
/connect. Or keep Claude Code / Codex and point those at DeepSeek, GLM, or OpenCode Go. The agent and the model are different products.First buy. OpenCode + a few dollars of DeepSeek Flash, or OpenCode Go at $10, or GLM Coding Lite at $18. Keep native Claude / Codex / Grok when the diff has to be right.
Separate the four things
Most of the confusion is vocabulary. Four layers keep getting one product name.
DeepSeek and GLM compete on the brain and the bill. They do not ship the agent, except as one more supported client among many. OpenCode is the agent in this cheap stack. Z.ai's ZCode is a tool on their list, not a replacement for Claude Code or OpenCode. DeepSeek has official integration guides and no first-party coding CLI that matters. Community TUIs are not the product.
That is why this is not a bake-off against the three native seats. Those seats include a harness, a model, and a vendor who will still be there when the loop goes wrong. DeepSeek and GLM are what you point Claude Code or Codex at when the bill is the constraint. The trio itself is in Grok Joins the Party.
DeepSeek: tokens, two models, no coding SKU
DeepSeek is the lab that made a lot of people notice open-weight models could be cheap and still useful. The older names you still hear — V3, R1, DeepSeek Coder — were folded into the V4 family. There is no separate Coder SKU on the current API. If a gist still says to set deepseek-coder, throw the gist away. Coding work pays the same rates as everything else.
Two model names are live on the official pricing page:
Both support thinking and non-thinking modes; thinking is the default. Both do JSON, tool calls, the OpenAI Responses API, and an Anthropic-format endpoint. Fill-in-the-middle is beta, and only in non-thinking mode.
You pay per million tokens, with a cache-hit price that is the actual discount for agent loops — the system prompt and the repo prefix repeat, so most of the input should be cheap if the prefix is stable:
Off-peak is half of peak. Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday through Friday. The 04:00–06:00 UTC weekday gap is off-peak. Weekends have no peak window. Read the Flash cache-hit row last, not first: a cache miss is fifty times the cache hit, and off-peak output is two hundred times the cache-hit input. The cheap trick is boring — keep the system prompt and repo prefix stable, work off-peak, and do not run a thinking-mode novel for a mechanical edit. There is no monthly coding plan. You top up a balance on platform.deepseek.com.
Flash vs Pro
Same 1M window, same tool calls, same thinking mode, same two API dialects. Different products. The name Pro does not mean “use this for hard coding.”
Pricing, from the official rate card, USD per million tokens. Off-peak is half of peak. Peak is 01:00–04:00 and 06:00–10:00 UTC, Monday–Friday.
The 2M + 200k + 300k turn is the agent-shaped bill: a fat repeating prefix (cache hit), a small uncached diff, and a thinking-sized completion. Flash: 2 × $0.003 + 0.2 × $0.15 + 0.3 × $0.60 = $0.216. Pro: 2 × $0.022 + 0.2 × $0.66 + 0.3 × $1.98 = $0.770. Peak doubles both. Output is the expensive line on either SKU. Cache is why Flash loops stay cheap. A million cached tokens on Flash off-peak is three-tenths of a cent; on Pro it is 2.2 cents.
For coding, start on Flash. DeepSeek’s own Claude Code recipe pins Opus, Sonnet and Haiku at deepseek-flash. Codex setup option 1 is Flash (and the one that accepts images). Flash is cheaper, has 5× the concurrency, and is the only one with vision.
On 10 September they announced V4.1-Flash as a new architecture (552B MoE, 8B active on input, 16B on output), said third-party tests put it ahead of V4-Pro on performance, cost, speed and total runtime, and said they would route all deepseek-v4-pro traffic to Flash from 14 September until a future V4.1-Pro. Then they reversed. The pricing page now says they will keep serving V4 Pro after 14 September, billing unchanged, “in response to user demand.”
So Pro is the kept-alive SKU, not the default coding brain. Their launch post is vendor evidence, not an independent bake-off on my repos. What you can take to the bank is the invoice: Pro is about four times Flash on cache-miss input and output, it cannot see screenshots, and it will queue sooner.
When you still land on Pro, it is usually by accident. Leave a Claude Opus model name on the Anthropic endpoint and DeepSeek maps it to deepseek-v4-pro at Pro prices. If you actually want Pro, set deepseek-v4-pro[1m] yourself. Do not pick it because the name says Pro.
Two base URLs, and you have to pick the one your agent speaks:
OpenAI Chat / Responses: https://api.deepseek.com
Anthropic Messages: https://api.deepseek.com/anthropicClaude Code is the Anthropic one. Official snippet, from their Claude Code guide:
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API Key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432Read that twice. The copy-paste currently points Opus, Sonnet and Haiku at deepseek-flash. Separately, the same docs say that if you send a Claude Opus model name through the Anthropic endpoint, they map it to deepseek-v4-pro and bill Pro. If you want Pro on purpose, set ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro[1m]. If you leave Claude's default model names in place, you can get a surprise Pro invoice. Flash is the cheap default. Pro is the deliberate upgrade.
Codex talks Responses API. DeepSeek implemented that natively and ships a setup script that writes ~/.codex/models.json and a provider block in config.toml. It backs up what you had. Flash is the option that accepts images; Pro is text. Guide: Integrate with Codex.
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)OpenCode, Cline, Copilot CLI and a pile of others are documented the same way: base URL, API key, model name. DeepSeek's strategy is not "here is our agent." It is "here is how to point twenty other people's agents at us."
What you do not get: a first-party terminal agent, a flat monthly coding SKU, or a complete Anthropic clone. On the Anthropic endpoint, MCP server fields are ignored. Some tool-result types are unsupported. Treat it as a cheap brain with Claude's wire format, not as Claude with a discount sticker.
GLM: a coding plan that impersonates Claude
GLM is the model family. Zhipu AI is the company. Z.ai is the international brand. People say "GLM" the way they say "Claude" — as if it were one product. It is not.
Two doors, and they are not interchangeable:
The coding product is the plan. Official line: a subscription designed for AI-powered coding, starting at $18 a month. Live checkout is z.ai/subscribe. A 2026 migration notice illustrated Pro at $72 and Max at $160. Confirm the Pro/Max number at checkout. The credit table below is the durable fact from the docs.
Five-hour credits refresh five hours after you start consuming them. Weekly credits reset every seven days from subscribe. Credits are not tokens. The docs publish multipliers; output is the expensive coefficient on both rows:
GLM-5.3's default reasoning is max. That is a credit policy, not a virtue. Off-peak model usage costs half the credits. Peak is Monday–Friday, 14:00–18:00 Singapore time (06:00–10:00 UTC). Weekends are off-peak all day. Z.ai's own estimate: fully using off-peak can be up to 92% cheaper than calling GLM-5.3 on the metered API. That is their arithmetic, not a measurement from my repos. Agent loops on Lite with reasoning max and fat output will burn the 2,000 five-hour bucket in an afternoon. That is the meter working. Move a tier, move to Flash, move off-peak, or move the hard jobs back to a native model.
All three individual tiers currently run GLM-5.3 and GLM-5.3-Flash. Older names on the plan auto-route: 5.2 / 5.1 → 5.3, 4.7 → 5.3-Flash. GLM-5.3 is text-only, 1M context, 128K max output, reasoning always on (low / high / max, default max). Flash is the cheaper multiplier and the vision path via their plan MCP.
On the Coding Plan those two brains share the same monthly lid; Flash just burns fewer credits (output multiplier 8 vs 24). On the API, 5.3 output is almost 9× Flash. Do not use the API table to guess the plan bill.
Z.ai's own coding bench still places 5.3 behind Claude Fable 5 (they publish 34.5% against Fable's 39.5% at max effort) and ahead of their previous generation. Vendor benches are vendor benches. The useful sentence is not "it beats Claude." It is "it is close enough on a lot of agentic coding that the price becomes the decision."
The plan only meters officially supported tools. Wrong base URL, and you are not on the plan — you are either failing or accidentally on a different product. Three endpoints:
Anthropic Messages: https://api.z.ai/api/anthropic
OpenAI Chat Completions: https://api.z.ai/api/coding/paas/v4
OpenAI Responses: https://api.z.ai/api/v1Claude Code and Goose take the Anthropic URL. Codex takes Responses. Cline, OpenCode, Cursor and most of the rest take the Chat Completions coding URL. The supported list, from Z.ai's tool page, includes ZCode, Claude Code, Claude for IDE, Codex, OpenCode, Pi, Cursor, Cline, TRAE, Qoder, Droid, Kilo Code, Roo Code, Crush, Goose and Eigent, plus a best-effort general-agent group (AutoClaw, OpenClaw). That is the fence. Outside it, the plan key is the wrong key.
Claude Code config, from their Claude guide — Flash on Haiku, 5.3 on Sonnet and Opus, 1M compact window:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"API_TIMEOUT_MS": "3000000"
}
}Do not buy the Coding Plan and the metered API for the same coding session and expect them to share a bucket. Plan calls in supported tools use plan quota only. When the 5-hour window is empty, you wait. The wallet is not an overflow valve.
One more split: open.bigmodel.cn is the China console, priced in RMB. z.ai is the international one, priced in USD. Do not mix those tables.
OpenCode: the open-source agent
OpenCode is the thing DeepSeek and GLM are not: an actual coding agent. It is MIT-licensed, lives at anomalyco/opencode (the SST/Anomaly team), and ships as a terminal UI, a desktop app, and an IDE extension. The CLI is free. You bring a model.
That is the product. Claude Code is Anthropic's agent glued to Claude. Codex is OpenAI's agent glued to GPT. Grok Build is xAI's agent glued to Grok. OpenCode is a harness that speaks 75+ providers through the AI SDK and Models.dev, including DeepSeek, Z.ai, Anthropic, OpenAI, GitHub Copilot, xAI, and local runtimes like Ollama and LM Studio. Docs: opencode.ai/docs.
People collapse those three the same way they collapse GLM the company and the Coding Plan. You can run OpenCode forever without Zen or Go. Go is the cheap subscription if you want DeepSeek Flash and GLM-5.3 without juggling vendor consoles.
How it works
Install, connect a provider, open a repo, initialize project rules, then talk to it.
curl -fsSL https://opencode.ai/install | bash
# or: brew install anomalyco/tap/opencode
# or: npm i -g opencode-ai@latest
cd /path/to/project
opencodeInside the TUI: /connect stores keys in ~/.local/share/opencode/auth.json. /models picks a provider_id/model_id. /init writes or updates AGENTS.md in the project root — build/test commands, repo shape, conventions. Commit that file. Tab switches Plan (suggest, don't edit) and Build (make the diff). /undo / /redo revert or replay. Config lives in opencode.json (schema opencode.ai/config.json), globally under ~/.config/opencode/ or per project. It also reads AGENTS.md and, unless disabled, ~/.claude/CLAUDE.md.
Built-in agents include build (default, can edit) and plan (read-only). You can add subagents in JSON or as markdown under .opencode/agents/. Headless: opencode run "…" with --model provider/model and --auto to approve anything not explicitly denied.
How it integrates with models
Same TUI. Different sockets. Official provider directory: Providers.
Default model in config is provider_id/model_id. Go models use opencode-go/…. Zen models use opencode/….
Go, one key, their curated Flash:
{
"$schema": "https://opencode.ai/config.json",
"model": "opencode-go/deepseek-v4.1-flash"
}Or DeepSeek directly. Confirm the model ID in /models — do not guess it:
{
"$schema": "https://opencode.ai/config.json",
"model": "deepseek/deepseek-flash",
"provider": {
"deepseek": {
"options": { "baseURL": "https://api.deepseek.com" }
}
}
}Custom providers are the same pattern DeepSeek documents for OpenCode: @ai-sdk/openai-compatible, a baseURL, and model IDs. That is how a random OpenAI-shaped endpoint becomes a row in /models.
OpenCode Go
Go is not the agent. It is a $10/month subscription from the OpenCode team that serves open coding models they tested, with bulk capacity, so you are not hopping between Hangzhou, Beijing, and a GPU reseller. Official page: OpenCode Go. Optional. One member per workspace. Designed for international access.
The subscription is $10 a month. Usage caps on top of that are per-model dollar lids, not a second sticker price. On a model whose included usage lid is $60, the 5-hour window is 20% of that lid ($12) and the week is 50% ($30). Premium rows on the live Go page (GLM-5.3, DeepSeek V4 Pro, Grok 4.6, Kimi K3, GPT 5.6 Luna) are listed at $15 of included usage per month. DeepSeek V4.1 Flash has a 4× usage promo through 20 September 2026 — that date is four days from this article. Hit the lid and you can keep using free models, or fall through to a Zen credit balance. Quote lids from the live Go page, not from a screenshot of this post.
The Go roster on 16 Sep 2026 includes DeepSeek V4.1 Flash, V4 Pro, V4 Flash; GLM-5.3 and 5.3-Flash; Grok 4.6; GPT 5.6 Luna; Kimi K3; MiniMax; Qwen3.8; MiMo; and others. The list moves. Fetch https://opencode.ai/zen/go/v1/models rather than memorizing this paragraph.
Go is also a socket for other agents. OpenCode documents Claude Code and Codex as validated clients (they recognize native session headers). That is the inverse of the rest of this article: instead of pointing Claude Code at DeepSeek's Anthropic URL, you can point Claude Code at OpenCode Go and spend the $10 lid. Traffic must look like a coding agent, send a real user-agent, and carry a stable session ID.
Against Claude, Codex and Grok
The comparison people want is "which coding agent is cheapest." That is the wrong axis. Claude Code, Codex and Grok Build are agents with a native model. DeepSeek and GLM are models you can put inside those agents — or inside OpenCode and Cline, if you would rather not borrow Anthropic's or OpenAI's CLI.
I published my own three-seat bill in Grok Joins the Party: $200 Claude Max, $200 ChatGPT Pro, $300 SuperGrok Heavy. That is what a full-power native trio costs me, not a quote for every region. GLM Lite is about a tenth of a $200 Claude Max plan. The gap is real. So is the quality gap. GLM's own chart still has Fable 5.1 ahead. I have not run a controlled bake-off of V4.1-Flash or GLM-5.3 against Fable 5.1, Astra, or Grok 4.6. Vendor benches stay vendor benches.
The other cost, which Your Agents Eat Your Subscription already covered for the native seats: agent loops burn tokens whether the invoice says "subscription" or "balance." DeepSeek makes that visible because you watch a prepaid number fall. GLM makes it a 5-hour and weekly credit cap. Claude and Codex make it a shared allowance with the chat app. None of them are unlimited. Cheap just fails later in the month — or at peak hours, sooner.
Pricing
Three different invoices. DeepSeek sells tokens. GLM sells a monthly credit lid for coding tools, and a separate pay-as-you-go API. Claude, Codex and Grok sell a subscription that includes their agent. Dated 16 September 2026. Re-read the vendor pages before you subscribe to a number on this screen.
Cheap coding SKUs — what you actually pay:
Native agents — the bill if you keep the original brain:
Same agent-shaped turn on the metered APIs — 2M cached prefix + 200k new input + 300k output, off-peak. Arithmetic from the official per-million rates:
GLM-5.3-Flash API: 2 × $0.03 + 0.2 × $0.15 + 0.3 × $0.50 = $0.24. GLM-5.3 API: 2 × $0.26 + 0.2 × $1.40 + 0.3 × $4.40 = $2.12. The Coding Plan is not this table — it burns credits against a monthly lid, at 50% credits off-peak, and does not fall through to the API wallet. Checkout for GLM Pro/Max: z.ai/subscribe. DeepSeek rates: Models & Pricing. GLM API rates: Z.ai pricing.
Which package to buy
A decision tree, not a ranking.
A few anti-packages:
Do not treat a community DeepSeek TUI as if DeepSeek shipped Claude Code. They did not.
Do not point Claude Code at GLM with the general API base URL and expect Coding Plan credits to apply. The coding URL is part of the product.
Do not stack GLM Coding Plan and GLM API for the same session hoping one overflows into the other.
Do not point your production Claude Code at a third-party Anthropic endpoint and assume Anthropic will support the resulting mess. DeepSeek and Z.ai document this configuration. Anthropic does not have to.
The limits that are not pricing
Data leaves your machine and goes to China-origin companies. If the repo is not allowed to do that, this article is not a workaround. It is a different product.
Compatibility is incomplete by design. DeepSeek's Anthropic page is explicit about ignored MCP fields. GLM's plan is explicit about the supported-tool fence. Both will look fine in a hello-world and then drop a tool the native agent uses every day.
Peak hours are a real billing surface. DeepSeek doubles weekday UTC morning tokens. GLM doubles weekday Singapore-afternoon credits. If your "cheap" loop always runs in the expensive window, you bought a different product than the blog post described.
The honest position on 16 September 2026: these are credible agentic coding models at a fraction of frontier subscription prices, with vendor benches that still put Fable / Astra / Grok ahead, and with no substitute for running them on your own repo.
What the market actually grew
It grew cheaper brains, and one open-source agent that will wear them. DeepSeek and GLM still wear Claude's and OpenAI's faces when you want them to. OpenCode does not need the costume.
Use OpenCode when you want the harness to be yours. Use DeepSeek or GLM when the constraint is money per loop. Use Claude, Codex or Grok when the constraint is being able to defend the diff. Mixing them on purpose is reasonable. Mixing them by accident, because a base URL made Claude Code look like it was still Claude, is how you get a cheap week and an expensive incident.
DeepSeek models and prices: Models & Pricing. Claude Code: Integrate with Claude Code. Codex: Integrate with Codex. V4.1-Flash launch (and the Pro-routing plan they later reversed): 10 Sep announcement. Anthropic dialect: Using the Anthropic API.
GLM Coding Plan: overview, quick start, Claude Code, supported tools, subscribe. GLM-5.3: model docs. Metered API: Z.ai pricing.
Native-agent list prices cited as commonly published consumer tiers (Claude Pro/Max, ChatGPT Go/Plus/Pro, SuperGrok / Plus / Heavy). Confirm on each vendor's pricing page. My $200 / $200 / $300 trio is the bill I already published, not a universal quote.
OpenCode: intro, providers, Go, models, GitHub.
Grok Joins the Party — adding Grok Build next to Claude Code and Codex, and what that trio actually costs.
Your Agents Eat Your Subscription — agent loops burn the same allowance as chat, whatever the invoice is called.
I Love Trios — three assistants, one desk, same notes, still no bake-off.
The Context Wall — a million-token window does not fix a cheap model that cannot find the right file.