Zed: setting up the AI assistant with your own key

Zed is configured through settings.json, and its anthropic provider expects a URL without /v1 — miss that detail and the assistant panel just keeps returning 404.

4 min · · Updated · IDE

Zed is an editor with a plain-text settings.json config, and its built-in assistant is configured the same way — no separate form for a base URL. The format is simple, but one detail breaks everything: Zed's anthropic provider expects a URL without /v1, and that suffix often ends up in the config anyway, copied from somewhere else.

Where to change settings

Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → zed: open settings opens your personal settings.json. The assistant section is called language_models or assistant depending on your Zed version — if a key doesn't get picked up, compare against zed: open default settings to see what your version actually expects.

Anthropic-compatible setup

bash
{
  "language_models": {
    "anthropic": {
      "api_url": "https://api.zukko.pro",
      "api_key": "fetch_your_key"
    }
  },
  "assistant": {
    "default_model": {
      "provider": "anthropic",
      "model": "claude-sonnet-5"
    }
  }
}

api_url has no /v1. Zed's anthropic provider calls /v1/messages itself and sets the anthropic-version header. Add /v1 manually and the path doubles up, sending every request to a URL that doesn't exist — the most common cause of a 404 here.

OpenAI-compatible setup

For GPT or GLM, use the openai_compatible provider (or openai, depending on your Zed version):

bash
{
  "language_models": {
    "openai_compatible": {
      "zukko": {
        "api_url": "https://api.zukko.pro/v1",
        "api_key": "fetch_your_key",
        "available_models": [
          { "name": "gpt-5.6-sol" },
          { "name": "gpt-5.6-luna" },
          { "name": "glm-5.3" }
        ]
      }
    }
  }
}

Here api_url includes /v1: this provider calls /chat/completions relative to the address you give it.

Test the key before digging through JSON

Before parsing settings.json line by line, confirm the key works at all:

bash
curl https://api.zukko.pro/v1/messages \
  -H "Authorization: Bearer fetch_your_key" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-sonnet-5","max_tokens":64,"messages":[{"role":"user","content":"ping"}]}'

If that answers, the issue is in Zed's config, not the key or balance. Next, check the most common culprit: a trailing comma in the JSON. settings.json doesn't tolerate a hanging comma before a closing brace — the file silently fails to apply, and Zed keeps running on old (or empty) settings with no obvious error in the UI.

Reading the API errors

  • 401 — key rejected: {"error":{"message":"Invalid API key. Use Authorization: Bearer fetch_*","type":"authentication_error"}}. Check the key is quoted correctly in the JSON with no stray whitespace.
  • 402 — empty balance: {"error":{"message":"Недостаточно средств на балансе","code":"insufficient_balance"}}. The check happens before the model is called, so a failed attempt is free.
  • 404 model_not_found — the model name doesn't match the catalog. Get the exact list without a key: curl https://api.zukko.pro/v1/models.
  • 400 model_retired — the model has been retired; the replacement is named right in the error message.
  • 503 model_disabled — the model is disabled in the catalog; replace it in settings.json with a current one.
  • 429 — from Zukko this only means a per-key limit (key_daily_limit_reached, which resets at 00:00 UTC, or key_monthly_limit_reached), if one is set in the dashboard; the gateway has no general rate limit, and any other 429 comes from the model provider.

Worth knowing about the models in Zed

The catalog currently has six models: claude-opus-5-5, claude-sonnet-5, gpt-5.6-sol, gpt-5.6-luna, glm-5.3 and glm-5.3-flash (current list: GET https://api.zukko.pro/v1/models). The Claude and GPT models support vision and a 1,000,000-token context, so pasting screenshots or large files into Zed's assistant works on them; glm-5.3 and glm-5.3-flash have a 128K context and don't accept images.

Limits, cost, and money

Regular (non-streaming) API responses carry X-Zukko-Cost-Micros (the request's cost in micro-dollars, 1,000,000 = $1) and X-Fetch-Balance-Cents (the balance left after the charge, also in microdollars) — useful if you're hitting the same key from scripts alongside the editor. Zed's assistant itself receives responses as a stream, and streaming responses don't carry these headers — check its spend in the dashboard, via GET /v1/usage, or GET /v1/balance.

On the key's page at https://zukko.pro/app/api-keys you can set a daily or monthly spend cap in dollars and restrict the allowed models list. Top up via SBP, a card through PayPear, crypto, or a foreign Mastercard EU card through Fride (about 13% fee, amounts $2–$594); the minimum is $1. A one-time $0.50 bonus comes from subscribing to @zukkopro: link Telegram in the dashboard, subscribe, press "Check"; once per Telegram account. A plain signup has no starting balance.

Support is at https://t.me/zukkopro?direct.

Free token counting

Before pasting a large file, or several at once, into Zed's assistant, you can check their token weight without an actual request and without any charge — the /v1/messages/count_tokens endpoint only counts:

bash
curl https://api.zukko.pro/v1/messages/count_tokens \
  -H "Authorization: Bearer fetch_your_key" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"the request text"}]}'

This matters even with a 1,000,000-token context (on the Claude and GPT models): that ceiling by itself doesn't guarantee the specific context you assembled won't turn out pricier than expected.

Web search for models that lack it

If settings.json points at a model with no built-in web search — say, GLM — and a task in Zed's assistant needs current information, you can call POST /v1/web-search with the same key separately from the main conversation and paste the result into the prompt by hand.

If settings.json syncs across machines

Zed supports settings sync, and a key in settings.json can quietly end up on a second machine or with a different developer. In that case, set limits on the key's dashboard page right away and check GET /v1/usage periodically — the cursor-paginated charge history (account-wide, covering all keys) shows whether the spend actually matches only your own work.

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Zed: AI assistant setup with a custom API key · Zukko