⚡ New — Kimi K3 is live: bring your own Moonshot key →

← Blog

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.

Frontier coding quality at a fraction of the cost — GLM-4.7 on Baseten scored 99.9% to Opus 4.8's 100% on our coding benchmark, at ₹0.033 vs ₹0.39 per task, and faster (1.5s vs 2.9s).

Before you begin

Have two keys ready — the installer prompts for both and verifies them, so keep them on the clipboard:

Install

macOS / Linux

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

Windows (PowerShell)

irm https://bharatrouter.com/install/glm.ps1 | iex

The 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:

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.

OpenCode running GLM-4.6 through BharatRouter, answering the cost-savings question — 4,261 tokens, $0.00 spent on BYOK
The first query, right after install — OpenCode driving GLM-4.6 through BharatRouter, metered on your key.

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-shot

Swap 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

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 →
Was this helpful?