OpenCode is the best general-purpose harness in this cluster when you want broad providers, reusable agents, explicit permissions, and terminal/desktop/IDE/GitHub workflows. It is an open-source coding agent; OpenCode Zen is an optional hosted provider, not the product’s only way to run.
The old “best free IDE” framing is no longer accurate. Current Zen documentation describes an account with billing details, credits, per-request charging, and model-specific prices. Free or promotional model rows can exist, but they are moving offers rather than the definition of OpenCode.
Quick facts
| Question | OpenCode answer |
|---|---|
| Core product | Open-source coding agent |
| Interfaces | Terminal TUI, desktop beta, IDE extension and GitHub integration |
| Providers | Broad provider support plus custom/OpenAI-compatible paths |
| Hosted option | OpenCode Zen, an optional curated model gateway |
| Control | Primary agents, subagents, custom tools and granular permissions |
| GLM-5.2 | Zen, direct Z.AI PAYG, or Z.AI Coding Plan |
| Best for | A polished provider-neutral default with explicit controls |
Install OpenCode
The repository documents:
| |
It also publishes Homebrew, Chocolatey, Scoop, Arch, install-script, and desktop-app paths. Prefer a package manager you already trust and pin versions in managed environments.
Three GLM-5.2 Paths
These routes use different accounts and billing rules.
1. OpenCode Zen
Zen is OpenCode’s optional curated gateway:
| |
Current Zen docs list GLM-5.2 among available models. They also say users add billing details and credits and are charged per request. Check the live pricing table before use; do not rely on an old free-model roster.
2. Direct Z.AI PAYG
Use a Z.AI API key and choose the standard Z.AI provider:
| |
This is normal API billing. See GLM-5.2 for current list pricing.
3. Z.AI GLM Coding Plan
Z.AI documents OpenCode as an officially supported Coding Plan tool:
| |
Enter the relevant Z.AI key, then use /models to select GLM-5.2. Coding Plan five-hour/weekly quotas and supported-use rules apply; this is not general PAYG credit and not unlimited usage. See the Z.AI Coding Plan guide.
Agents and Permissions
OpenCode supports primary agents and subagents with per-agent prompts, tools, models, and permissions. Permission rules can allow, ask, or deny individual tools and shell-command patterns.
A read-only review agent can deny edits and network access while allowing repository search:
| |
Last-match precedence matters in command patterns. Keep the broad rule first and narrow exceptions after it, then test the policy on a disposable repository.
Context, Sharing, and Privacy
Provider choice controls much of the data path. A local OpenCode client with a BYO key still sends prompts and selected code to that provider unless you use a local model.
OpenCode’s session-sharing feature creates a public link and syncs conversation history to OpenCode’s servers. Treat sharing as an explicit publication step: review source, secrets, terminal output, and generated URLs before enabling it.
OpenCode’s Zen documentation says its standard hosted providers use zero retention and do not train on customer data. Its limited-time free rows are exceptions: some permit model-improvement use, North Mini Code may retain data, and Nemotron trial sessions are logged for security and product improvement. The roster and exceptions can change, so read the live model-specific terms before sending proprietary code. “Open source client” does not mean “local inference.”
Productive Starting Prompt
| |
For failing-test and multi-file prompts plus a same-model scorecard, use Pi vs ZCode vs OpenCode.
Choose OpenCode When
- You need to switch among providers without changing the whole harness.
- Explicit tool, shell, and subagent permissions are important.
- Terminal, desktop, IDE, and GitHub surfaces should share one workflow.
- You want a clear choice among Zen, BYO-provider PAYG, and supported Coding Plan access.
Choose ZCode for the most integrated GLM-5.2-native desktop test. Choose Pi for a smaller terminal core with highly programmable lifecycle hooks.
Related links
- /compare/pi-vs-zcode-vs-opencode/
- /tools/pi/
- /tools/zcode/
- /models/glm-5.2/
- /tools/zai/
- /value/smart-spend/
Sources
- OpenCode repository and installation (Archive)
- OpenCode agents and permissions (Archive)
- OpenCode Zen models and pricing (Archive)
- Z.AI OpenCode integration (Archive)
- Z.AI supported Coding Plan tools (Archive)
- Z.AI Coding Plan usage policy (Archive)
Last verified: July 2, 2026. Check live Zen prices, provider terms, and Coding Plan limits before spending or sending proprietary code.