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

QuestionOpenCode answer
Core productOpen-source coding agent
InterfacesTerminal TUI, desktop beta, IDE extension and GitHub integration
ProvidersBroad provider support plus custom/OpenAI-compatible paths
Hosted optionOpenCode Zen, an optional curated model gateway
ControlPrimary agents, subagents, custom tools and granular permissions
GLM-5.2Zen, direct Z.AI PAYG, or Z.AI Coding Plan
Best forA polished provider-neutral default with explicit controls

Install OpenCode

The repository documents:

1
2
npm i -g opencode-ai@latest
opencode

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:

1
2
3
/connect
# Select OpenCode Zen and enter the Zen API key
/models

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:

1
2
3
opencode auth login
# Select: Z.AI
opencode

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:

1
2
3
opencode auth login
# Select: Z.AI Coding Plan
opencode

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
  "$schema": "https://opencode.ai/config.json",
  "agent": {
    "review": {
      "mode": "subagent",
      "permission": {
        "edit": "deny",
        "webfetch": "deny",
        "bash": {
          "*": "ask",
          "git diff*": "allow",
          "git log*": "allow",
          "rg *": "allow"
        }
      }
    }
  }
}

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

1
2
3
4
Audit this repository for untrusted input reaching shell execution.
Use the read-only review agent. Do not edit, install, or use the network.
Return file:line evidence, reachable data flow, severity, and uncertainty.
Separate confirmed findings from hypotheses.

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.

Sources


Last verified: July 2, 2026. Check live Zen prices, provider terms, and Coding Plan limits before spending or sending proprietary code.