Files
coder/docs/ai-coder/ai-gateway/clients/zed.md
T
Yevhenii ShcherbinaandSusana Ferreira 95fd3e5e23 docs: use coder-api-token instead of coder-session-token (#24316)
## Summary

Follows up on https://github.com/coder/coder/pull/24032
Renames "Coder session token" to "Coder API token" in AI Gateway client
documentation pages.
Also renames the `CODER_SESSION_TOKEN` env var to `CODER_API_TOKEN` in
Codex CLI examples and Copilot proxy configuration.

Note: "Coder session token" is still used in some parts of the
documentation where it make sense.

---------

Co-authored-by: Susana Ferreira <susana@coder.com>
2026-04-14 16:14:48 -04:00

2.3 KiB

Zed

Zed IDE supports AI Gateway via its language_models configuration in settings.json.

Centralized API Key

To configure Zed to use AI Gateway, you need to edit your settings.json file. You can access this by pressing Cmd/Ctrl + , or opening the command palette and searching for "Open Settings".

You can configure both Anthropic and OpenAI providers to point to AI Gateway.

{
  "language_models": {
    "anthropic": {
      "api_url": "https://coder.example.com/api/v2/aibridge/anthropic",
    },
    "openai": {
      "api_url": "https://coder.example.com/api/v2/aibridge/openai/v1",
    },
  },
  // optional settings to set favorite models for the AI
  "agent": {
    "favorite_models": [
      {
        "provider": "anthropic",
        "model": "claude-sonnet-4-5-thinking-latest"
      },
      {
        "provider": "openai",
        "model": "gpt-5.2-codex"
      }
    ],
  },
}

Replace coder.example.com with your Coder deployment URL.

Note

These settings and environment variables need to be configured from client side. Zed currently does not support reading these settings from remote configuration. See this feature request for more details.

Authentication

Zed requires an API key for these providers. For AI Gateway, this key is your Coder API token.

You can set this in two ways:

Zed UI

  1. Open the Assistant Panel (right sidebar).
  2. Click Configuration or the settings icon.
  3. Select your provider ("Anthropic" or "OpenAI").
  4. Paste your Coder API token for the API Key.

Environment Variables

  1. Set ANTHROPIC_API_KEY and OPENAI_API_KEY to your Coder API token in the environment where you launch Zed.

BYOK (Personal API Key)

Note

At the time of writing, Zed Agent does not support sending custom headers, so BYOK mode is not available.

References: Configuring Zed - Language Models