---
url: 'https://docs.byesu.com/en/clients/zed.md'
description: >-
  Configure Zed Editor settings.json for byesu API: use native Anthropic
  (/v1/messages + 0.1x cache) and OpenAI-compatible (/v1) models on one API key.
---

# Connect Zed Editor to byesu API

> **Key facts**: Zed's `~/.config/zed/settings.json` supports **both** native Anthropic (`"api_url": "https://byesu.com"`, **no `/v1`** — preserving `0.1x` Claude prompt cache reads & thinking blocks) **and** OpenAI-compatible (`"api_url": "https://byesu.com/v1"`) simultaneously using a single **`auto`** group `sk-...` key.

**Zed** is a GPU-accelerated, Rust-native code editor with a built-in **Agent Panel**, **Inline Assistant**, and MCP tool integration. Unlike editors that funnel every custom key through an OpenAI translation wrapper, Zed lets you wire **native `/v1/messages`** for Claude 5.5 right alongside **OpenAI-compatible `/v1`** for GPT-6.2, Gemini 4 Argon, and DeepSeek V4 Pro in one clean JSON file.

::: tip Dual-protocol advantage on one key

* **`language_models.anthropic.api_url`**: `https://byesu.com` *(do **not** add `/v1` — preserves native `cache_control` `0.1x` reads & thinking blocks)*
* **`language_models.openai.api_url`**: `https://byesu.com/v1` *(with `/v1` — unlocks `gpt-6.2-sol`, `gemini-4-argon`, `deepseek-v4-pro`)*
* **Credential storage**: OS Keychain via Zed's Agent Panel UI, or `ANTHROPIC_API_KEY` / `ZED_ANTHROPIC_API_KEY` + `OPENAI_API_KEY` env vars (one `sk-...` token from [byesu Console](https://byesu.com/register) works for both!)
  :::

## Step 1: Copy-Ready `~/.config/zed/settings.json`

Open Zed's configuration file (`Cmd+,` on macOS or `Ctrl+,` on Linux → `~/.config/zed/settings.json`; on Windows `%APPDATA%\Zed\settings.json`) and merge the `agent` and `language_models` blocks below:

```json
{
  "agent": {
    "default_model": {
      "provider": "anthropic",
      "model": "claude-sonnet-5-5"
    }
  },
  "language_models": {
    "anthropic": {
      "api_url": "https://byesu.com",
      "available_models": [
        {
          "name": "claude-opus-5-5",
          "display_name": "Claude Opus 5.5 (byesu)",
          "max_tokens": 200000,
          "max_output_tokens": 32000,
          "cache_configuration": {
            "max_cache_anchors": 4,
            "min_total_token": 1024,
            "should_speculate": true
          }
        },
        {
          "name": "claude-sonnet-5-5",
          "display_name": "Claude Sonnet 5.5 (byesu)",
          "max_tokens": 200000,
          "max_output_tokens": 16384,
          "cache_configuration": {
            "max_cache_anchors": 4,
            "min_total_token": 1024,
            "should_speculate": true
          }
        },
        {
          "name": "claude-fable-5-2",
          "display_name": "Claude Fable 5.2 Reasoning (byesu)",
          "max_tokens": 200000,
          "max_output_tokens": 32000,
          "cache_configuration": {
            "max_cache_anchors": 4,
            "min_total_token": 1024,
            "should_speculate": true
          }
        }
      ]
    },
    "openai": {
      "api_url": "https://byesu.com/v1",
      "available_models": [
        {
          "name": "gpt-6.2-sol",
          "display_name": "GPT-6.2 Sol (byesu)",
          "max_tokens": 400000,
          "max_output_tokens": 32768
        },
        {
          "name": "gpt-6.1-sol",
          "display_name": "GPT-6.1 Sol (byesu)",
          "max_tokens": 400000,
          "max_output_tokens": 32768
        },
        {
          "name": "deepseek-v4-pro",
          "display_name": "DeepSeek V4 Pro (byesu)",
          "max_tokens": 128000,
          "max_output_tokens": 16384
        },
        {
          "name": "gemini-4-argon",
          "display_name": "Gemini 4 Argon 1M (byesu)",
          "max_tokens": 1000000,
          "max_output_tokens": 16384
        }
      ]
    }
  }
}
```

Need a tailored block with fewer models? Generate one interactively in the **[AI Client & SDK Config Generator](/en/tools/config-generator)**.

## Step 2: Store Your `sk-...` Key in OS Keychain or Shell Env

Zed keeps secrets out of `settings.json` so you can safely track dotfiles in Git. Pick either method using an `sk-...` token created in the default **`auto`** group ([Choosing a Group](/en/guide/groups)):

### Option A: OS Keychain via Zed Agent Panel (Recommended on Desktop)

1. Open the **Agent Panel** (`Cmd+?` on macOS or `Ctrl+?` on Linux/Windows) → click **Configure** (or run `agent: open configuration` from the Command Palette).
2. Paste your `sk-...` token into **Anthropic → API Key** and press **Enter**.
3. Paste the **exact same `sk-...` token** into **OpenAI → API Key** and press **Enter**. Zed saves both credentials in your system keychain.

### Option B: Environment Variables (Great for CLI / Headless / Linux Launchers)

```bash
# Add to ~/.zshrc or ~/.bashrc before launching `zed .`
export BYESU_API_KEY="sk-your-byesu-token"
export ANTHROPIC_API_KEY="$BYESU_API_KEY"
export ZED_ANTHROPIC_API_KEY="$BYESU_API_KEY"
export OPENAI_API_KEY="$BYESU_API_KEY"
```

## Step 3: Tuning `max_tokens`, `max_output_tokens`, and `cache_configuration`

* **`max_tokens` vs `max_output_tokens` in Zed**: In Zed's `available_models` schema, `max_tokens` declares the **total context window** used by Zed's token gauge, while `max_output_tokens` caps per-turn completion length. Setting `max_output_tokens` to `16384`–`32000` prevents truncated multi-file diffs during large Agent Panel edits.
* **Preserving `0.1x` Claude prompt cache reads**: When `cache_configuration` is set (`max_cache_anchors: 4`, `min_total_token: 1024`), Zed places Anthropic `cache_control` anchors on your system tools and conversation prefix. Because `https://byesu.com` forwards `/v1/messages` untouched, cached prefix tokens bill down to **`0.1x`** — just watch out for 6–10 minute review pauses where Claude's default 5-minute TTL expires (see **[Claude 5m vs GPT 30m Prompt Cache TTL](/en/articles/claude-5m-vs-gpt-30m-prompt-cache-ttl)** and **[Prompt Caching Guide](/en/guide/prompt-caching)**).
* **Flexible funding**: Top up your balance via **[USDT](/en/guide/pay-with-usdt)** or **Alipay** with pay-as-you-go per-token billing and live console rates. Compare other developer environments in **[Cursor vs Claude Code vs Cline](/en/compare/cursor-vs-claude-code-vs-cline)**, **[Windsurf IDE](/en/clients/windsurf)**, and **[Trae IDE](/en/clients/trae)**.

## Troubleshooting

* **`404` on Claude models in Zed**: Check `language_models.anthropic.api_url` — it **must** be `"https://byesu.com"` **without `/v1`**. Adding `/v1` produces `/v1/v1/messages` ([Claude 404 fix](/en/errors/claude-api-model-not-found-404)).
* **`404` on GPT / DeepSeek / Gemini models**: Check `language_models.openai.api_url` — it **must** include `/v1` (`"https://byesu.com/v1"`).
* **`401 authentication_error` / `invalid_api_key`**: Re-paste your `sk-...` key inside **Agent Panel → Configure** to overwrite any stale Keychain entry ([Claude 401 fix](/en/errors/claude-api-401-authentication-error), [OpenAI 401 fix](/en/errors/openai-api-401-invalid-api-key)).
* **`no available channel`**: Confirm your token belongs to `auto` (`Glm` or `Kimi` tokens are required only for `glm-5.3` or `kimi-k3`; see [no available channel](/en/errors/no-available-channel-error)).

## FAQ

### Why should I configure both `language_models.anthropic` and `language_models.openai` in Zed?

`language_models.anthropic` (`https://byesu.com`) gives Claude 5.5 native `/v1/messages` support — unlocking `0.1x` `cache_control` reads and thinking blocks — while `language_models.openai` (`https://byesu.com/v1`) adds `gpt-6.2-sol`, `deepseek-v4-pro`, and `gemini-4-argon` to the same model dropdown on one key.

### What is the exact URL difference between Zed's `anthropic` and `openai` blocks?

Use `"https://byesu.com"` (**no `/v1`**) under `anthropic`, and `"https://byesu.com/v1"` (**with `/v1`**) under `openai`.

### Where does Zed store my API key so I do not commit secrets in `settings.json`?

Paste your `sk-...` token in **Agent Panel → Configure** (stored in your OS Keychain) or export `ANTHROPIC_API_KEY` / `ZED_ANTHROPIC_API_KEY` and `OPENAI_API_KEY` in your shell profile.

### How do I enable Anthropic prompt caching inside Zed's `settings.json`?

Include `"cache_configuration": { "max_cache_anchors": 4, "min_total_token": 1024, "should_speculate": true }` inside each Claude model object under `language_models.anthropic.available_models`.

## Related Guides & Tools

* [Prompt Caching, Explained (`0.1x` Cache Reads)](/en/guide/prompt-caching)
* [Claude 5-Minute vs GPT 30-Minute Prompt Cache TTL](/en/articles/claude-5m-vs-gpt-30m-prompt-cache-ttl)
* [AI Client & SDK Config Generator](/en/tools/config-generator)
* [Connect Windsurf IDE to byesu API](/en/clients/windsurf)
* [December 2026 LLM API Latency & Uptime Report](/en/articles/llm-api-latency-uptime-december-2026)
