Set up your tools
One command configures Claude Code, Codex, OpenCode, Continue, Zed and Aider, and prints settings for Cursor, Cline, Roo and Kilo.
One command points your coding tools at Top Billing. It asks for your API key, checks it, shows the models your key can use, and writes each tool's config file for you. Every file it changes is backed up first.
npx @topbilling/cli
It offers two ways in: sign in with your browser (it shows a short code, you approve it on app.topbilling.in, and a key named after this machine is created for the project you pick), or paste a key you already have. Only setting up Claude Code? Run npx @topbilling/cli claude. You need Node.js 20.12 or newer, and a live key from the API keys page.
What it configures
Claude Codeterminalenv block of ~/.claude/settings.json: base URL, key, default model, the model aliases and the context window.Claude Code extensionVS Code, Cursor, WindsurfclaudeCode.environmentVariables in the editor's user settings.Codex CLICLIOpenCodeCLItopbilling provider to ~/.config/opencode/opencode.json.ContinueVS Code, JetBrains~/.continue/config.yaml; the key goes in ~/.continue/.env.ZededitorAiderCLI~/.aider.conf.yml.Cursor, Cline, Roo Code, Kilo CodeeditorsCommands
npx @topbilling/cli # interactive setup
npx @topbilling/cli login # sign in with your browser — no key to copy
npx @topbilling/cli claude # Claude Code only
npx @topbilling/cli usage # balance, spend, and what each coding session cost
npx @topbilling/cli models # the models your key can use
npx @topbilling/cli mcp install # Claude Code can then tell you your balance and what a session cost
npx @topbilling/cli env # print environment variables for your shell
npx @topbilling/cli status # check the key and what each tool points at
npx @topbilling/cli remove # undo everything it changed
In scripts and CI
Pass the key and the tools, and it asks nothing:
TOPBILLING_API_KEY=tb_live_... npx @topbilling/cli --tools claude-code,opencode --yes
Add --dry-run to see the files it would write, with your key masked, without writing anything.
~/.topbilling/config.json so later commands do not ask again. The command never prints the full key, and it only ever talks to Top Billing: https://api.topbilling.in for models and usage, and app.topbilling.in for browser sign-in.