Zero to a GLM coding agent in one command
A coding agent on an open model, governed by BharatRouter — in one command. The installer putsOpenCode on your machine, writes the config, prompts for and verifies your keys, and runs a first query so the very first thing you see is the agent working.

Before you begin
Have two keys ready — the installer prompts for both and verifies them, so keep them on the clipboard:
- A BharatRouter key (
br-…) — sign up (new orgs get ₹100 credit), mint a key, and keep it handy. The installer asks for it first and smoke-tests it. - A GLM provider key for BYOK — from Baseten (the fast first-party GLM host — 1.5s in our benchmark), Zhipu (z.ai) (looks like
<id>.<secret>) or OpenRouter. Ifglm-4.7doesn't already route on your org, the installer detects it, prompts for this key, and saves it via/me/byok. (Already have GLM serving on your org? It skips this automatically.)
Install
macOS / Linux
curl -fsSL https://bharatrouter.com/install/glm.sh | bashWindows (PowerShell)
irm https://bharatrouter.com/install/glm.ps1 | iexThe installer is idempotent and cross-platform — macOS (arm64/x64), Linux (x64/arm64) and Windows. It quietly handles the rough edges that usually eat an afternoon:
- the broken
opencode-ainpm postinstall — it installs the platform binary and shims it onto yourPATH; - a non-writable or root-owned
~/.cache— it redirectsXDG_CACHE_HOME; - sudo-less
PATHon Linux — it falls back to~/.local/bin; - first-time keys — a hidden prompt, stored
600outside your shell rc, then smoke-tested; - GLM access — if
glm-4.7doesn't route on your org yet, it prompts for a Baseten, Zhipu or OpenRouter BYOK key and saves it via/me/byok.
Your first query, automatically
Once the keys check out, the installer immediately asks GLM“how much can a team save on coding-agent token costs versus a frontier model?” — so you watch the tool-loop run and the answer stream back, metered through your own gateway, before you type anything.

Then use it from anywhere
The installer leaves you an oc-glm launcher:
oc-glm # interactive TUI
oc-glm run --model bharatrouter/glm-4.7 "<task>" # one-shotSwap the brain by changing one string — bharatrouter/glm-5.2(frontier-grade, 99.4%), bharatrouter/gpt-oss-120b (cheapest near-perfect, ₹0.014/task) or bharatrouter/glm-4.5-air (lighter) — on the same BharatRouter key. All benchmarked in GLM vs frontier.
Why route a coding agent through BharatRouter
- Governance — per-org/team/model ₹ budgets and caps on a loop that burns tokens fast.
- Metering — every turn logged with provider, model and token usage (streamed usage included).
- Routing & failover — add fallback routes without touching the harness.
- No lock-in — open MIT-licensed GLM models, one API, swap models freely.
Full recipe, installer scripts and config:View on GitHub → · Manual walkthrough: Run an open coding agent on GLM
Next in the series: which GLM host is fastest or cheapest · can open GLM match a frontier model? (we benchmarked it)
Go live in a few clicks. Install a governed GLM coding agent in one command — Codex- or Claude-Code-style, routed & metered through your own key.BharatRouter Code →