How to use Zed cheaper without a subscription
Zed is one of the fastest editors around, and its built-in AI assistant is genuinely useful. But the subscription model isn't for everyone. Maybe you code in bursts, maybe you only want AI for the occasional refactor, or maybe you simply don't want another recurring bill. The good news: Zed lets you bring your own model provider, so you can keep every AI feature and pay only for what you actually use.
Why pay-per-token beats a subscription for most people
A flat monthly fee makes sense if you hammer the assistant all day, every day. For everyone else, it's money sitting idle. Pay-per-token flips the math: a quiet week costs almost nothing, and a busy sprint costs exactly what it should — no minimums, no "did I get my money's worth" guilt.
Zed supports any OpenAI-compatible endpoint. That's the key. Instead of locking yourself to one vendor's billing, you can route Zed's requests through a gateway that bills per token and gives you access to many models at once.
Use AnyModel as Zed's provider
AnyModel is a single OpenAI-compatible gateway. One base URL, one API key, and you reach GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. There's no subscription and no credit card to start — you get 1,000,000 free tokens on signup, and a total of 6,000,000 if you link Telegram. After that it's plain pay-per-token.
The practical win for Zed: switching models is just changing the model id. You can run a cheap, fast model for autocomplete-style edits and a stronger one for tricky architectural questions — all on the same key and the same endpoint.
Configure it in Zed
Zed isn't covered by AnyModel's one-line installer (that's only for codex, claude, opencode, and hermes), so you'll do a quick manual setup. Open Zed's settings (Cmd/Ctrl + ,) and add an OpenAI-compatible provider pointing at AnyModel:
{
"language_models": {
"openai": {
"api_url": "https://anymodel.org/v1",
"available_models": [
{ "name": "gpt-5", "max_tokens": 128000 },
{ "name": "claude-sonnet-4-5", "max_tokens": 200000 },
{ "name": "gemini-2.5-pro", "max_tokens": 1000000 }
]
}
}
}
Then set your AnyModel API key when Zed prompts for the OpenAI key (or via the assistant panel's provider settings). That's it — the base URL and key are the only two things that matter. Browse the full model list to grab the exact ids you want.
You can verify the endpoint works from a terminal before wiring it into the editor:
curl https://anymodel.org/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5","messages":[{"role":"user","content":"Say hi from Zed"}]}'
Pick the right model for the job
Because you're billed per token, model choice directly controls cost. A rough strategy:
| Task | Model type | Why |
|---|---|---|
| Quick edits, renames, small functions | A lighter model (DeepSeek, GLM, Qwen) | Cheap and fast, good enough for routine work |
| Code review, refactors, debugging | A mid/large model (Claude, GPT) | Better reasoning where it counts |
| Huge files or whole-repo context | A long-context model (Gemini) | Bigger windows handle more at once |
If you're unsure which gives the best value for your stack, the compare page lays out the options side by side. Mixing models per task is where pay-per-token really shines — something a single-vendor subscription can't do.
A note on privacy
When you send code to any AI, the model provider still receives your prompt — that's unavoidable for any hosted model. AnyModel offers Ghost Mode, an opt-in setting where your prompts and responses aren't stored on our side (only a token counter runs). It's not "100% privacy," but it does remove our middle layer from the retention picture, which matters when you're sending real source code through your editor.
Wrapping up
Zed's AI doesn't have to come with a subscription. Point it at one OpenAI-compatible endpoint, pay only for the tokens you use, and switch freely between the best models for each task. For more setups and tips, the blog has guides for other editors too.
Start with free tokens and no card — create your AnyModel key and plug it into Zed in under five minutes.
AnyModel