Run Claude Code on Open-Source Models
Billed by Time, Not Tokens
Love Claude Code, hate the Anthropic bill? Zap points the Claude Code and Codex CLIs you already know at open-source models like GLM 5.2, Kimi K2, and Qwen. Billed by time and compute, not token count. Switch models with one command. Buy credits when you need them.
No subscription. No token anxiety. Your config stays untouched.
$ npm install -g @xsquads/zap
$ zap login
$ zap claude # that's it, you're in
/model # switch to GLM, Kimi, or Qwen at runtimeToken Anxiety Is the Quiet Killer of Agentic Coding
Claude Code is the most capable coding CLI in 2026. The bill that comes with it is the catch. Every long reasoning chain, every file re-read, every tool output flows through tokens you pay for, and agentic loops multiply that cost because every step re-sends context.
- •You freeze mid-session because one more prompt might cost more than it is worth.
- •You are locked into one vendor's pricing and rate limits, with no fallback when they change.
- •Per-token pricing punishes the exact thing that makes agents good: thinking longer per turn.
- •Open models have closed the quality gap, but there was no clean way to drive them from the interface you already use.
What if you could keep the Claude Code workflow and stop watching the meter?
Zap Is the Cleanest Way to Run Open Models from Claude Code
Zap is not a fork and not a local router to host. It is a thin client plus a hosted worker that speaks the Anthropic and OpenAI wire formats natively. You keep the interface you know. You only change which model answers.
Open-Source Models, Zero Lock-in
Switch between GLM 5.2, Kimi K2, and Qwen with a single /model command. Pick the model that fits the task: cheap open weights for bulk refactors, a stronger one for the hard architecture call. You are never tied to one vendor's pricing or rate limits.
Billed by Time, Not Tokens
Agentic loops multiply token cost because every step re-sends context. Zap bills you for time and compute instead, so a model that thinks longer per turn does not punish your wallet the way per-token pricing does. Open weights are billed by time and compute, not by token count. No more token anxiety.
Pay As You Go
Buy credits only when you need them. Check your balance and ledger anytime with two simple commands. No subscriptions, no surprise bills at the end of the month.
One Interface You Already Know
Zap is not a second tool to learn. It spawns the real claude and codex CLIs and just points them at open models. If you know Claude Code, you already know Zap Claude Code. The only difference is which model answers.
Your Config Stays Untouched
Zap never writes to your ~/.claude/ or ~/.codex/ directories. Your existing Anthropic and OpenAI setup stays intact, so you can fall back to your native setup anytime by running claude or codex directly. Zero risk to your workflow.
Clean Errors, No Stack Traces
A 401 tells you your session expired. A 402 tells you you are out of credits. An unreachable API gives a clear one-line message and a nonzero exit. Zap never dumps a stack trace, so it drops cleanly into scripts and CI.
Anthropic Direct vs. Zap
Same CLI. Different economics and model freedom.
| Anthropic direct | Zap | |
|---|---|---|
| Model choice | ✗Locked to Anthropic models and pricing | ✓GLM 5.2, Kimi K2, Qwen, switch at runtime |
| Pricing model | ✗Per token, long reasoning chains sting | ✓Per time and compute, thinking longer costs less |
| Cost vs frontier | ✗Full frontier model token pricing | ✓Billed by time and compute, not tokens |
| Token anxiety | ✗Watch every file re-read burn your budget | ✓Metered by use, no per-token panic |
| Your config | ✗Overwrites your Anthropic auth and base URL | ✓Never touches ~/.claude or ~/.codex |
| Getting started | ✗Subscription before first prompt | ✓Log in, then buy credits as you go |
The Models You Can Run Today
Zap fetches the model list at launch, so you always see the current set without reinstalling. Switch any of them with the /model picker.
GLM 5.2
glm-5.2The default. A strong generalist for everyday coding, refactors, and feature work. Balances speed and quality for the long agentic loops Claude Code loves to run.
Kimi K2
kimi-k2.7Reach for Kimi when the task needs deeper reasoning and longer context windows. Good for architectural decisions and sprawling codebases.
Qwen
qwen-3.7A cost-efficient option for bulk work and high-volume refactors where you want throughput without watching the meter.
New open weights ship constantly. Zap surfaces them the moment the worker serves them, no reinstall required.
Three Commands. You Are Coding.
If you have a terminal and Node 20, you can be inside a Claude Code session on an open model in under a minute.
Install Zap
Run npm install -g @xsquads/zap to add the zap CLI. Requires Node 20 or newer. If you want to drive Claude Code, also install @anthropic-ai/claude-code globally. For Codex, install @openai/codex.
Log in
Run zap login. Google OAuth opens in your browser. Confirm with zap whoami to see your email and balance.
Run Claude Code on an open model
Run zap claude to launch Claude Code routed to open-source models. Open the /model picker to switch between GLM 5.2, Kimi K2, and Qwen at runtime, or switch directly with /model glm-5.2. Run zap codex the same way for the Codex CLI.
$ npm install -g @anthropic-ai/claude-code
$ npm install -g @xsquads/zap
$ zap login
$ zap claude
/model glm-5.2
$ zap whoami # check your balance
$ zap logoutThe Economics of Open Models Through Zap
Open models are billed by time and compute, not by token count, so a longer turn is not priced as more tokens. That is the difference from a token meter.
Buy them when you need them
Billed by time and compute, not tokens
Commands from install to a live session
Config files Zap touches in your home dir
Zap, Answered
What is Zap?
Zap is a metered CLI from xSquad that lets you run Claude Code and Codex against open-source models like GLM 5.2, Kimi K2, and Qwen. You install the @xsquads/zap npm package, log in with Google, and run zap claude or zap codex. The worker speaks the Anthropic and OpenAI wire formats natively, so the real CLIs keep working and you only pay for what you use through credits.
How much does Zap cost?
Zap is metered by time and compute, not by token count. You buy credits when you need them and can check your balance anytime with zap whoami or zap credits.
Which models can I run with Zap?
Zap currently serves open-source models including GLM 5.2, Kimi K2, and Qwen, with model ids like glm-5.2, kimi-k2.7, and qwen-3.7. The list updates as new open weights ship, and because Zap fetches the model list at launch you always see the current set without reinstalling. Open the /model picker inside Claude Code to see what is available right now.
Does Zap modify my Claude Code or Codex config?
No. Zap never writes to your ~/.claude/ or ~/.codex/ directories. It spawns the real claude and codex CLIs and points them at the Zap worker through environment variables and config overrides. Your existing Anthropic and OpenAI setup stays intact, and you can fall back to it anytime by running claude or codex directly.
How is Zap different from a local model router like Ollama?
Zap is not a local router you have to host. It is a thin client plus a hosted worker. The worker speaks the Anthropic and OpenAI wire formats natively, so zap claude just sets ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN and spawns claude. There is nothing to run locally and no model weights to download or manage.
Can I switch models mid-session?
Yes. Run zap claude, then open the /model picker to see every Zap model and switch at runtime (requires Claude Code v2.1.129 or newer). You can also switch directly with /model glm-5.2 on any version, or pass a model for a single run with zap claude -- --model glm-5.2.
What do I need installed before Zap?
You need Node 20 or newer, plus the CLIs you want to drive. Run npm install -g @anthropic-ai/claude-code for zap claude, and npm install -g @openai/codex for zap codex. Optionally install the headroom proxy to compress prompts and lower your credit burn.
Do I need a subscription to start?
No. Zap has no subscription. Buy credits when you need them, and check your balance anytime with zap whoami or zap credits.
Stop Watching the Token Meter
Install Zap and run Claude Code on open models today. Billed by time and compute, not tokens. Keep the workflow. Lose the token meter.
Zap is an xSquad product. The single-developer on-ramp to the same agent-factory philosophy as xSquad for Claude Code, where parallel Claude Code agents work as a full squad.