Suanlimao
← Back to all tutorials

Connect your tools

Zed

Add an OpenAI-compatible provider to Zed's settings.json.

About 6 minFor:Developers who use the Zed editor

Before you start

  • Zed is installed
  • A key and a model name copied from the model plaza

Step 1 · STEP 0x01

Declare the provider and models in settings.json

Open Zed's settings.json (run zed: open settings from the command palette) and add a provider under language_models.openai_compatible. The key is the provider ID; here we use my-relay:

Zed
> zed: open settingssettings.json
json
{
  "language_models": {
    "openai_compatible": {
      "my-relay": {
        "api_url": "https://api.suanlimao.shop/v1",
        "available_models": [
          {
            "name": "<MODEL_NAME>",
            "display_name": "<MODEL_NAME>",
            "max_tokens": 128000,
            "max_output_tokens": 8192,
            "capabilities": { "tools": true, "images": false }
          }
        ]
      }
    }
  }
}
  • api_url is https://api.suanlimao.shop/v1 — the official example uses the /v1 form.
  • Each entry in available_models has name (copied from the plaza), display_name, max_tokens (context length) and max_output_tokens; take the numbers from the plaza.
  • capabilities defaults to tools on and images off; set chat_completions to false for Responses-only models, and max_tokens_parameter: true if the endpoint expects max_tokens.
Don't guess the model name: open the model plaza, click “Copy model id” on a model card and paste it. A wrong model name is the most common error.

Open the model plaza →

Step 2 · STEP 0x02

Give Zed the key (never in settings.json)

Agent panel → Settings → your provider
1

API Key

<YOUR_API_KEY>
2
Save
Diagram only — the real screen in your version may differ

Either paste the key in the provider's settings in the Agent panel, or set an environment variable named after the provider ID in upper snake case plus _API_KEY — my-relay becomes MY_RELAY_API_KEY.

bash
export MY_RELAY_API_KEY=<YOUR_API_KEY>
terminal
$ export MY_RELAY_API_KEY=<YOUR_API_KEY>$ zed .
The docs are explicit: do not put API keys in settings.json. The file may be synced or committed and would expose the key.
The full key is shown only once, at creation. Missed it? Revoke it and create a new one.

Create a key →

Step 3 · STEP 0x03

Pick the model in the Agent panel

Agent panel
1

Model picker

my-relay / <MODEL_NAME>
2

Message box

Hello
Diagram only — the real screen in your version may differ
  • Open the Agent panel; your provider and model appear in the picker. Select it and send a message.
For Claude-family models you can use anthropic_compatible instead: api_url is https://api.suanlimao.shop without /v1, and model capabilities support tools, images and prompt_caching.

✓ How to tell it worked

  • The Agent panel answers with your model.
  • The Usage page shows the request.

FAQ

My provider is missing from the picker.

Make sure settings.json is valid JSON and available_models has at least one entry with a name.

It says there is no key.

The variable name must match the provider ID (my-relay → MY_RELAY_API_KEY) and Zed must start after it is set; or paste the key in the provider settings.

I get 404.

Check api_url is https://api.suanlimao.shop/v1 and the model name matches the plaza.

Related tutorials

Still stuck?

Read the troubleshooting tutorials first. If that does not help, open a ticket with the request_id, time, model and the exact error (never paste your key).