# Zed

Connect Zed's Agent to SimpleLLM through a custom OpenAI-compatible provider. You need a SimpleLLM API key and account credits; create a key in the [dashboard](https://app.simplellm.eu/api-keys).

## Add the provider

Open your user `settings.json` in Zed and merge this configuration into your existing settings. If `language_models` or `openai_compatible` already exists, add the `simplellm` entry inside it instead of creating a duplicate key.

~~~json
{
  "language_models": {
    "openai_compatible": {
      "simplellm": {
        "api_url": "https://api.simplellm.eu/v1",
        "available_models": [
          {
            "name": "DeepSeek-V4-Flash",
            "display_name": "DeepSeek V4 Flash (SimpleLLM)",
            "max_tokens": 1048576,
            "max_output_tokens": 8192,
            "capabilities": {
              "tools": true,
              "images": false,
              "chat_completions": true,
              "interleaved_reasoning": true,
              "max_tokens_parameter": true
            }
          }
        ]
      }
    }
  }
}
~~~

| Setting | Meaning |
| --- | --- |
| `api_url` | SimpleLLM's API base, including `/v1`. Do not append `/chat/completions`. |
| `name` | Exact, case-sensitive SimpleLLM model ID. Do not use an upstream provider's model name. |
| `max_tokens` | Zed's model context budget, including input and output. |
| `max_output_tokens` | Requested output budget; 8192 is a starting value, not the model's advertised maximum. |
| `chat_completions` | Uses the supported chat-completions API; keep this enabled. |
| `max_tokens_parameter` | Sends the output budget as `max_tokens`. |
| `interleaved_reasoning` | Preserves streamed reasoning in the `reasoning_content` field for subsequent turns. |

## Add your API key and select the model

Run `agent: open settings` from Zed's command palette. Under **LLM Providers**, find `simplellm` and enter your SimpleLLM API key. Then open the Agent panel and select **DeepSeek V4 Flash (SimpleLLM)** in the model picker.

Keep the key out of `settings.json`. Zed stores keys entered through its provider settings in the system keychain. As an alternative, the provider ID `simplellm` uses the `SIMPLELLM_API_KEY` environment variable; it must be available to the Zed process when launched.

## Change models or output limits

Use [Models & pricing](/docs/models.html) to check the current model ID, availability and context window. Update `name`, `display_name` and the context budget together when choosing another model. Tool, image and reasoning capabilities must match that model; these flags do not add capabilities to it.

Increase the output budget if a response reaches its limit before completing the answer. Reasoning also consumes output tokens. Longer outputs may take more than 60 seconds and cost more SC. Zed's OpenAI-compatible Agent integration uses streaming; see [streaming and cancellation](/docs/streaming.html) and [billing](/docs/billing.html).

## Troubleshooting

- **Provider missing:** check the settings nesting and update Zed if it does not recognize `openai_compatible`.
- **401:** check the API key saved for `simplellm`.
- **402:** check the account balance and API-key spending limit.
- **400:** check the model ID, context size and model-specific options before retrying. See [Troubleshooting](/docs/errors.html).

Configuration fields were checked against [Zed's provider documentation](https://zed.dev/docs/ai/use-api-access#openai-compatible-endpoints) and [OpenAI-compatible integration source](https://github.com/zed-industries/zed/blob/main/crates/language_models/src/provider/open_ai_compatible.rs). This sample has not been tested end to end in the Zed app.
