Zed

Moth DocsTutorials

Zed takes Moth as an OpenAI-compatible provider in its settings, with each model listed by hand.

Open Zed's settings.json and add Moth under language_models. Zed doesn't read the model list, so each model you want goes in with its context window as max_tokens.

settings.json
{
  "language_models": {
    "openai_compatible": {
      "Moth": {
        "api_url": "https://api.runmoth.si/v1",
        "available_models": [
          {
            "name": "claude-sonnet-4.6",
            "display_name": "Claude Sonnet 4.6 (Moth)",
            "max_tokens": 200000,
            "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "chat_completions": true }
          },
          {
            "name": "gemini-3.8-flash",
            "display_name": "Gemini 3.8 Flash (Moth)",
            "max_tokens": 1048576,
            "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "chat_completions": true }
          }
        ]
      }
    }
  }
}

The key never goes in this file. Zed reads it from an environment variable named after the provider, so for a provider called Moth it reads MOTH_API_KEY. You can also add it in the Agent panel's settings under LLM Providers, which keeps it in your system keychain.

  • Leave chat_completions true, since false sends Zed to OpenAI's Responses API, which Moth doesn't serve.
  • max_tokens here is the model's whole context window, its context_length in the catalog.
  • To check it worked, open the Agent panel, pick a Moth model and ask it to read a file in your project.

A request a model can't take is refused with a 400 that says why. Some tools send stop sequences, which the GPT, Grok, DeepSeek and Kimi models refuse, so pick a Claude or Gemini model if you see that. What is removed lists every setting and what happens to it.