How to use GPT-5.2 in Zed
Zed is a fast, GPU-accelerated code editor with a built-in AI assistant and inline edits. It speaks the OpenAI API format, which means you can point it at GPT-5.2 through any OpenAI-compatible gateway. This guide shows how to wire up GPT-5.2 in Zed using AnyModel, so one API key reaches GPT-5.2 today and any other model tomorrow.
Why route Zed through AnyModel
Zed's AI features expect an OpenAI-style base URL and key. Instead of juggling separate accounts per provider, AnyModel gives you a single OpenAI-compatible endpoint that fronts GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. To switch models you change one string — the model id — and nothing else in your config.
- One base URL:
https://anymodel.org/v1 - One key for every model, including GPT-5.2 AnyModel uses pay-per-token billing with no subscription or minimums. Link Telegram to receive 5,000,000 free tokens; registration itself does not include a token grant.
- Pay-per-token after that — no subscription, no minimums
Step 1: Get your API key
Create an account and copy your key from the dashboard. You can register here in under a minute. Keep the key handy — it starts with your account prefix and goes into Zed's settings.
Step 2: Open Zed's settings
Zed stores configuration in a JSON file. Open the command palette with cmd-shift-p (macOS) or ctrl-shift-p (Linux), then run zed: open settings. This opens your settings.json.
Zed's assistant supports custom OpenAI-compatible providers. Because AnyModel mirrors the OpenAI API, you register it as an OpenAI-style provider with a custom api_url.
Step 3: Add the AnyModel provider
Add an language_models block pointing the OpenAI provider at AnyModel's base URL, and list GPT-5.2 as an available model:
{
"language_models": {
"openai": {
"api_url": "https://anymodel.org/v1",
"available_models": [
{
"name": "gpt-5.2",
"display_name": "GPT-5.2",
"max_tokens": 200000
}
]
}
}
}
Then set the key. Zed will prompt you for the OpenAI API key the first time you use the assistant — paste your AnyModel key there. Alternatively, export it in your shell before launching Zed:
export OPENAI_API_KEY="<YOUR_ANYMODEL_KEY>"
Note: the one-line installer (bash <(curl -fsSL "https://anymodel.org/i?tool=codex") <YOUR_API_KEY>) only supports codex, claude, opencode, and hermes. Zed is not one of those, so you use the manual OpenAI-compatible setup above — base URL plus key.
Step 4: Select GPT-5.2 and start coding
Open the assistant panel (cmd-? or via the panel toggle), click the model selector, and choose GPT-5.2. You can now:
- Ask questions about the open file or whole project
- Use inline assists (
ctrl-enter) to transform selected code - Run multi-step edits in the agent panel
If GPT-5.2 doesn't appear, double-check that the available_models name exactly matches the model id and that your api_url ends in /v1.
Verify the connection
Before debugging Zed's UI, confirm the endpoint and key work with a direct request:
curl https://anymodel.org/v1/chat/completions \
-H "Authorization: Bearer <YOUR_ANYMODEL_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.2","messages":[{"role":"user","content":"Say hi from Zed"}]}'
A 200 response with a completion means Zed will work too.
Switching and comparing models
The big advantage of routing through one endpoint: experimenting is free of friction. Want to compare GPT-5.2 against Claude or Gemini for a refactor? Add another entry to available_models and pick it from the selector — same key, same base URL. If you're weighing speed, context window, or price, the model comparison page lays out the differences side by side.
A note on privacy
For sensitive codebases, enable Ghost Mode — opt-in, zero-retention API keys where your prompts and responses aren't stored on our side, only a token counter. Be realistic, though: the underlying model provider still receives the prompt to generate a response, so this isn't "100% privacy" — it's no retention on AnyModel's end.
Wrapping up
Pointing Zed at GPT-5.2 takes three things: the base URL https://anymodel.org/v1, your API key, and the model id gpt-5.2. From there you can swap to any other model without touching the rest of your setup. For more setup walkthroughs, browse the blog.
Ready to try it? Create an account, fund the balance you need, and start without a subscription.
AnyModel