🎬 New — watch the 2-minute guide videos →

← Blog

One command, two coding agents: Codex- or Claude-Code-style on GLM

Zero to a GLM coding agent stood up an open harness in one command. BharatRouter Code is the next step: the same one-command install, now with a choice of two front-ends — a Codex-style open harness (OpenCode) or a Claude-Code-style agent (the real claude CLI) — both pointed at GLM-4.7, governed and metered through your own BharatRouter key.

Frontier coding quality at about a third the cost — open GLM scored 99% to Opus 4.8's 100% on our coding benchmark, at a fraction of the per-task cost.

One install, your pick of front-end

Same script, two harnesses. It asks one question at the top — Codex-style or Claude-Code-style? — and wires whichever you choose:

curl -fsSL https://bharatrouter.com/install/code.sh | bash

Already know which you want? Skip the prompt:

BR_FRONTEND=claude   curl -fsSL https://bharatrouter.com/install/code.sh | bash   # real Claude Code CLI
BR_FRONTEND=opencode curl -fsSL https://bharatrouter.com/install/code.sh | bash   # OpenCode (default)
The BharatRouter Code installer running in Claude-Code-style mode: ASCII banner, then steps 1 to 6 — Claude Code on PATH, cache set, key stored 600 and verified OK, glm-4.7 routes OK, launcher wired into the shell — then the first query begins on GLM-4.7 via BharatRouter.
One command, start to finish — it installs the harness, stores and verifies your key, confirms GLM-4.7 routes, wires the bharatrouter-code launcher, then runs the first query for you. Six steps, no config files to hand-edit.

Before you begin: one BharatRouter key, one BYOK

Two prerequisites, both on the dashboard — the installer prompts for the first and detects the second:

The rough edges it handles for you

The installer is idempotent and safe to re-run on macOS and Linux. It quietly absorbs the things that usually eat an afternoon:

Your first query, automatically — and it makes the case itself

Once the BharatRouter key checks out and GLM routes, the installer immediately asks GLM-4.7 “roughly how much can a team save on coding-agent token costs versus a frontier model — and is it fast enough?” through whichever front-end you picked. So the very first thing you see is the agent working, metered on your own gateway, before you type anything — answering, in effect, why you'd route a coding agent this way at all.

GLM-4.7 answering through BharatRouter: 'GLM-4.7 through BharatRouter is cost-efficient AND fast.' A benchmark table shows GLM-4.7 on Baseten at 99.9% accuracy, ₹0.033 per task, 1.5s — versus Claude Opus 4.8 (100%, ₹0.395, 2.9s) and GPT-5.5 (100%, ₹0.440, 2.5s) — roughly 12 times cheaper and faster at parity accuracy.
The first query, right after install — GLM-4.7 makes the cost-and-speed case itself. Figures from our 14-task, execution-checked benchmark (real measured tokens, FX ₹96/$).

And asked plainly, in a real run through BharatRouter, GLM-4.7 agrees:

A live run: bharatrouter-code -p asking whether GLM via BharatRouter is cost-efficient and fast. GLM-4.7 replies 'Yes, GLM via BharatRouter is designed to be both cost-efficient and fast.' Routed via z.ai (Zhipu) on BYOK with zero rupee debit, 553 tokens total, metered on the BharatRouter key.
An actual captured run — the GLM-4.7 response and token counts are real, routed and metered through BharatRouter (BYOK, ₹0 platform debit). Latency/cost figures in the footer are the benchmark's Baseten-host numbers.

Cost-efficient and fast — the numbers

The pitch isn't a vibe — it's measured. On the same execution-checked coding benchmark, all metered through one BharatRouter key:

Then use it from anywhere

Either front-end leaves you the same launcher — bharatrouter-code (with an oc-glm back-compat alias). Open a new terminal so the launcher loads:

bharatrouter-code                                          # interactive
bharatrouter-code -p "<task>"                               # one-shot (Claude-Code-style)
bharatrouter-code run --model bharatrouter/glm-4.7 "<task>"  # one-shot (Codex-style)

Swap the brain on the same key — bharatrouter/glm-4.7-flash (free tier, cheapest) or bharatrouter/glm-4.5-air (cheap) — and BharatRouter handles host failover (Baseten → Zhipu → OpenRouter) underneath, so a single host hiccup doesn't stall your loop.

Why route a coding agent through BharatRouter

A word on the names

BharatRouter Code is a thin, branded wrapper — it configures and launches OpenCode and the unmodified Claude Code CLI, it doesn't reimplement them. It is not affiliated with, sponsored by, or endorsed by OpenAI or Anthropic; “Codex-style” and “Claude-Code-style” describe the category of tool, nothing more. GLM weights are MIT-licensed by zai-org / Zhipu AI. Full attributions & notices ship next to the install.

Step-by-step instructions and recipes: View on GitHub →  ·  Set up BYOK: BYOK docs

Earlier in the series: zero to a GLM coding agent in one command · which GLM host is fastest or cheapest · can open GLM match a frontier model? (we benchmarked it)

Was this helpful?