Skip to content
Docs

Zed with AI Gateway

Zed is a high-performance code editor with a built-in agent panel. It ships a first-party vercel_ai_gateway language model provider, so the gateway catalog loads into its model picker with no provider definition of your own.

Run the Vercel CLI setup command for Zed:

terminal
npx vercel ai-gateway setup --agent zed

The command configures Zed's first-party vercel_ai_gateway provider in its JSONC settings.json with a comment-preserving merge, points it at the gateway's coding-agent endpoint, sets the Agent Panel default model, and exports VERCEL_AI_GATEWAY_API_KEY from a managed block in your shell startup file so the key stays out of the settings file.

If you can't use the Vercel CLI, configure Zed manually:

  1. Go to the AI Gateway section in the Vercel dashboard sidebar and click API keys to create a new API key.

  2. Zed reads the provider key from the environment. Export it in your shell:

    Terminal
    export VERCEL_AI_GATEWAY_API_KEY="your-ai-gateway-api-key"

    To persist the key, add the same line to your shell's startup file. Settings > AI > LLM Providers also accepts the key directly if you'd rather paste it.

  3. Add the provider to Zed's settings.json (open it with zed: open settings in the command palette):

    settings.json
    {
      "language_models": {
        "vercel_ai_gateway": {
          "api_url": "https://ai-gateway.vercel.sh/coding-agent/v1",
          "available_models": [
            {
              "name": "openai/gpt-6-astra",
              "display_name": "GPT-6 Astra",
              "max_tokens": 1050000,
              "max_output_tokens": 128000,
              "capabilities": {
                "tools": true,
                "images": true
              }
            }
          ]
        }
      },
      "agent": {
        "default_model": {
          "provider": "vercel_ai_gateway",
          "model": "openai/gpt-6-astra"
        }
      }
    }

    Zed's settings are JSONC, so comments in your existing file are preserved when you add this. The available_models entry seeds the picker. Once the key is visible to Zed, the full gateway catalog loads from /models and you can trim the starter entry.

  4. Launch Zed from a new terminal so the key is in its environment, then open the Agent Panel and pick a gateway model. agent.default_model sets the one the panel starts with.

View your usage, spend, and request activity in the AI Gateway section in the Vercel dashboard sidebar. See the observability documentation for more details.

VariableDescription
VERCEL_AI_GATEWAY_API_KEYYour AI Gateway API key. Required
ZED_HOMEOverrides Zed's config directory on macOS and Linux

Zed calls AI Gateway through the OpenAI-compatible Chat Completions API, so any model that supports Chat Completions works.

Last updated September 13, 2026

Was this helpful?

supported.