Skip to navigation
DocsZed setup: add an OpenAI-compatible provider for the Agent Panel

Coding tools

Zed setup: add an OpenAI-compatible provider for the Agent Panel

In short: Zed is a code editor whose Agent Panel supports our gateway as an OpenAI-compatible provider, set up in settings.json with language_models.openai_compatible.

Updated OpenAI formatIDEView .md
On this page
Base URLhttps://api.oneaiapikey.com/v1

Zed is a fast, native code editor with a built-in Agent Panel. Besides its own hosted models, Zed lets you register any OpenAI-compatible service as a language model provider. Add our gateway once and you can drive Zed’s agent with Claude, GPT, Grok or GLM using one key and one prepaid balance.

What do I need to use Zed with the gateway?

Using Zed with the gateway needs three things:

  • A recent version of Zed (OpenAI-compatible providers are configured through language_models.openai_compatible).
  • A funded account: any balance above $0, the sign-up credit included, pays for every model; when it runs out, add $1 or more (create an account).
  • An API key from the console (it begins with sk-).

How do I open Zed’s settings.json?

Open the command palette and run zed: open settings file. (Plain zed: open settings opens the graphical Settings Editor instead, which is handy for most options but not for this block.) The file lives at ~/.config/zed/settings.json on macOS and Linux and at %APPDATA%\Zed\settings.json on Windows.

How do I add the provider to Zed?

Merge the language_models block below into your settings. If you already have a language_models key, add the openai_compatible entry inside it rather than creating a second one.

settings.json
{
  "language_models": {
    "openai_compatible": {
      "One AI API Key": {
        "api_url": "https://api.oneaiapikey.com/v1",
        "available_models": [
          {
            "name": "claude-sonnet-5-5",
            "display_name": "Claude Sonnet 5.5",
            // conservative context budget; raise it if you know the model's limit
            "max_tokens": 200000,
            "max_output_tokens": 32000,
            "capabilities": {
              "tools": true,
              "images": true,
              "parallel_tool_calls": false,
              "prompt_cache_key": false,
              "chat_completions": true
            }
          },
          {
            "name": "glm-5.3-flash",
            "display_name": "GLM-5.3 Flash",
            "max_tokens": 128000,
            "max_output_tokens": 16000,
            "capabilities": {
              "tools": true,
              "images": false,
              "parallel_tool_calls": false,
              "prompt_cache_key": false,
              "chat_completions": true
            }
          }
        ]
      }
    }
  }
}

What the fields mean:

  • The key inside openai_compatible (here One AI API Key) is the provider name shown in Zed.
  • api_url includes /v1.
  • Each entry in available_models needs a name that matches a catalogue id exactly. display_name is just the label in the picker.
  • max_tokens is the context budget Zed plans around and max_output_tokens caps a single reply. The numbers above are conservative placeholders, so adjust them if you know a model’s real limits.
  • capabilities.tools must be true for agentic use, because the Agent Panel works through tool calls. Set images to true only for models that accept images.
  • chat_completions: true keeps Zed on the widely supported Chat Completions endpoint.

Settings files in Zed accept comments, so the // line in the example is fine.

How do I enter my API key in Zed?

Open the Agent Panel, go to its settings view, find your provider under the LLM providers list, and paste your sk- key. Zed stores it in your system keychain rather than in settings.json.

Alternatively, set an environment variable before launching Zed. Zed derives the variable name from the provider name in uppercase, which for this config is ONEAIAPIKEY_API_KEY. The provider’s settings view shows the exact name it expects.

macOS / Linux
export ONEAIAPIKEY_API_KEY="sk-your-key-here"

Which models work best in Zed’s Agent Panel?

The recommended models for Zed are listed below; add any of them to available_models. Rates are USD per 1M tokens:

Model idGood forInputOutput
claude-sonnet-5-5Daily coding, Coding agents, Code review$1.40$7
claude-opus-5-5Agentic coding, Large refactors, Complex reasoning$2.80$14
gpt-6.1-solCodex CLI, Tool calling, Long context$0.70$3.50
grok-4.7Research, Tool calling, Long context$1.40$4.20
glm-5.3-flashQuick answers, Drafting, Sub-agents$0.07$0.21

claude-sonnet-5-5 is a strong default for the agent; glm-5.3-flash is a low-cost option for quick questions and inline assists. See every model on the models page.

How do I verify Zed works?

Verify the provider by opening the Agent Panel, clicking the model selector and choosing one of the models listed under your provider name. Ask a simple question about the open project. A normal reply means the provider works, and you’ll see the request in your console’s usage log a few seconds later.

To check the key independently of Zed:

curl
curl -sS https://api.oneaiapikey.com/v1/models -H "Authorization: Bearer sk-your-key-here"

How do I fix common Zed errors?

The common Zed errors and their fixes are listed below.

The provider or models don’t show up. Zed couldn’t parse your settings, or the block is nested in the wrong place. Zed highlights JSON errors in the settings file; fix them and the provider appears without a restart.

401 Unauthorized. No key, or a wrong one, is stored for this provider. Re-enter it in the Agent Panel settings. If you rely on the environment variable, make sure Zed was launched from a shell where it’s set.

404 Not Found. api_url must be exactly https://api.oneaiapikey.com/v1: no trailing slash, no endpoint path.

“Model not found” or “no available channel”. A name in available_models doesn’t match a catalogue id. Ids are lowercase with exact dots and dashes.

The agent answers but never edits files. Tool calling is off for that model. Set capabilities.tools to true.

Long replies stop or time out. Zed streams responses, which keeps long generations alive. If you call the API from your own code, use "stream": true for long outputs: proxies cut idle non-streaming requests at about 100 seconds.

Next steps

Pair Zed with a terminal agent like Claude Code or OpenCode, or browse every tool guide. Current rates for all models are on the pricing page.

↑ ↓ moveEnter openEsc close
New accounts$10 credit on sign-up
Claim $10 credit →