May 8, 20263 min readSetupClaude Opus 4.6Zed

How to use Claude Opus 4.6 in Zed

Zed is a fast, native editor with a built-in assistant panel and agentic edit features. Claude Opus 4.6 is a strong fit for that workflow: it handles long files, multi-step refactors, and careful reasoning well. The catch is that Zed doesn't ship a one-click "AnyModel" button — but it does speak the OpenAI-compatible protocol, and that's all you need to route Opus 4.6 through a single gateway.

This guide shows the manual setup, which takes about two minutes.

Why route Opus 4.6 through AnyModel

AnyModel exposes one OpenAI-compatible endpoint that reaches every model behind a single API key — Claude, GPT, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. To switch models you change the model id in your config and nothing else. That means you can keep Opus 4.6 for heavy reasoning and drop to a cheaper model for boilerplate without juggling provider accounts or keys.

A few facts worth knowing before you start:

  • Free to start: 1,000,000 tokens on signup, and 6,000,000 total if you link Telegram. No credit card.
  • No subscription: after the free tokens, it's pay-per-token with no minimums.
  • One key, every model: the same key works in Zed, your CLI, and any other OpenAI-compatible tool.

Step 1: Get your API key

Create an account at /app/register, then copy your API key from the dashboard. Your base URL is:

https://anymodel.org/v1

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 tools, so configure it manually as described below.

Step 2: Add AnyModel as a custom provider in Zed

Zed configures AI providers through its settings.json. Open the command palette (Cmd-Shift-P / Ctrl-Shift-P), run zed: open settings, and add an OpenAI-compatible provider pointing at AnyModel:

{
  "language_models": {
    "openai_compatible": {
      "AnyModel": {
        "api_url": "https://anymodel.org/v1",
        "available_models": [
          {
            "name": "claude-opus-4-6",
            "display_name": "Claude Opus 4.6",
            "max_tokens": 200000
          }
        ]
      }
    }
  }
}

Then set the API key. Open the Agent/Assistant panel, go to its settings, find your AnyModel provider, and paste the key from Step 1. Zed stores it securely rather than in plain text in settings.json.

If your Zed build expects an environment variable instead, export it before launching:

export OPENAI_API_KEY="your-anymodel-key"

Step 3: Select Opus 4.6 and test it

Open the Agent panel (the assistant icon in the right dock), pick Claude Opus 4.6 from the model dropdown, and send a prompt like "Explain what this function does and suggest one improvement" against an open file. If you get a response, you're done.

You can verify connectivity outside the editor with a quick request:

curl https://anymodel.org/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-4-6","messages":[{"role":"user","content":"hello"}]}'

Tips for getting the most out of Opus 4.6 in Zed

  • Use inline assist for edits. Highlight code, trigger inline assist (Cmd-Enter by default), and let Opus 4.6 rewrite in place — it's good at preserving surrounding style.
  • Mix models by task. Keep Opus 4.6 for architecture and tricky bugs; add a second available_models entry for a faster model and switch the dropdown for routine work. The compare page helps you weigh cost versus capability.
  • Watch your context. Opus 4.6 handles large windows, but trimming irrelevant files keeps responses sharp and tokens low.
  • Privacy-sensitive repos? Enable Ghost Mode for opt-in zero-retention keys — prompts and responses aren't stored on our side, only a token counter. (The model provider still receives the prompt, so this isn't absolute privacy.)

Troubleshooting

If models don't appear, double-check the api_url ends in /v1 and that the key is saved against the AnyModel provider, not a different one. A 401 means the key is wrong or missing; a 404 on the model usually means a typo in the name field — it must match the gateway's model id exactly.

For more setup walkthroughs across editors and CLIs, browse the blog.


Ready to code with Opus 4.6 in Zed? Create a free AnyModel account — 1,000,000 tokens to start, no credit card — and paste one key into your editor.

Read next