---
title: "Zed OpenAI-compatible provider setup (GLM, Qwen) | BroadRouter"
description: "Add BroadNet Inference to the Zed editor as an OpenAI-compatible provider in settings.json, with model IDs, token limits, capabilities and the key variable."
url: https://broadrouter.com/guides/zed-openai-compatible-provider/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Use Zed with BroadNet Inference as an OpenAI-compatible provider

Updated 2026-11-16

In Zed's settings.json, add a provider under language\_models.openai\_compatible, for example broadnet, with api\_url set to https://inference.broadnet.ai/v1 and available\_models listing BroadNet IDs such as broadnet/glm-5.3 with max\_tokens set to the context size. Zed reads the key from BROADNET\_API\_KEY, or you can save it in Agent Settings.

Zed is an open-source code editor with a built-in agent. It connects to any server with an OpenAI-compatible API through its `openai_compatible` provider type. BroadNet Inference serves standard chat completions at `https://inference.broadnet.ai/v1`, so it fits. BroadRouter is BroadNet’s own site; the steps below follow [Zed’s API access docs](https://zed.dev/docs/ai/use-api-access#openai-compatible) as of Zed 1.28.

## Setup

1.  **Get a key.** Create a pay-as-you-go key in the BroadNet console, or use an [unlimited plan](https://broadrouter.com/guides/unlimited-llm-api-sessions/) key.
2.  **Add the provider.** Either open Agent Settings with the `agent: open settings` command and click **Add Provider** in the LLM Providers section, or edit `settings.json` directly:

```json
{
  "language_models": {
    "openai_compatible": {
      "broadnet": {
        "api_url": "https://inference.broadnet.ai/v1",
        "available_models": [
          {
            "name": "broadnet/glm-5.3",
            "display_name": "GLM 5.3 (BroadNet)",
            "max_tokens": 1048576,
            "max_output_tokens": 16000,
            "capabilities": {
              "tools": true,
              "images": false,
              "parallel_tool_calls": false,
              "prompt_cache_key": false,
              "chat_completions": true,
              "interleaved_reasoning": false,
              "max_tokens_parameter": true
            }
          },
          {
            "name": "broadnet/qwen3.8-27b",
            "display_name": "Qwen3.8 27B (BroadNet)",
            "max_tokens": 262144,
            "max_output_tokens": 16000,
            "capabilities": {
              "tools": true,
              "images": true,
              "parallel_tool_calls": false,
              "prompt_cache_key": false,
              "chat_completions": true,
              "interleaved_reasoning": false,
              "max_tokens_parameter": true
            }
          }
        ]
      }
    }
  }
}
```

3.  **Give Zed the key.** Export it before you start Zed, or paste it into the provider in Agent Settings. Zed stores pasted keys in the system keychain, not in `settings.json`.

```bash
export BROADNET_API_KEY='your-broadnet-key'
```

4.  **Test it.** Open the Agent Panel, pick **GLM 5.3 (BroadNet)** in the model selector and ask a small question about an open file. An answer means the connection works.

## What the settings mean

-   **`name`** is the model ID Zed sends. Use BroadNet’s ID exactly, with the `broadnet/` prefix.
-   **`max_tokens`** is the context window in Zed’s schema, not the output limit. Use 1,048,576 for GLM 5.3 and DeepSeek V4.1 Flash, and 262,144 for Qwen3.8 27B.
-   **`max_output_tokens`** caps the reply. The 16,000 above is our suggestion, not a BroadNet limit. Reasoning counts toward it, so don’t set it low.
-   **`max_tokens_parameter: true`** makes Zed send the output limit as `max_tokens` instead of `max_completion_tokens`. BroadNet’s API reference describes the `max_tokens` field.
-   **`images`** defaults to false for OpenAI-compatible models. Turn it on only for models that take images: Qwen3.8 27B, DeepSeek V4.1 Flash and BroadNet Gemma 4 VL 26B.
-   **`reasoning_effort`** is optional. BroadNet’s docs suggest `low` if you want shorter thinking.

## Which model to pick

| Use | Model | Why |
| --- | --- | --- |
| Agent edits with tools | `broadnet/glm-5.3` | BroadNet lists tools and structured output; 1M context |
| Screenshots and Arabic text | `broadnet/qwen3.8-27b` | Tools plus image input; 262K context |
| Long chats on a flat plan | `broadnet/deepseek-v4.1-flash` | The unlimited-plan model; image input; tools not listed by BroadNet |

Zed assumes `tools: true` for OpenAI-compatible models. BroadNet’s docs don’t list tool calling for DeepSeek V4.1 Flash, so test a real agent task with it before you rely on it. A Meteor hour ($1) is a cheap way to try it before a Full Moon month ($60).

## Troubleshooting

-   **401.** The key is wrong, expired or out of allowance. If you set `BROADNET_API_KEY`, it wins over the keychain; unset it and restart Zed to use the saved key instead.
-   **404 on every request.** Check that `api_url` ends in `/v1`. Then check the `name` matches the BroadNet ID exactly. Paid models need a top-up; the $5 credit covers only `broadnet/gemma-4-26b-a4b` and the two Transcribe models.
-   **Empty replies.** The model used its output budget on reasoning. Raise `max_output_tokens` or set `reasoning_effort` to `low`. [Why answers come back empty](https://broadrouter.com/guides/reasoning-tokens-empty-response/).
-   **429.** A pay-as-you-go key allows 30 requests a minute and 4 in flight. A plan session runs one request at a time. See [errors and retries](https://broadrouter.com/guides/errors-and-retries/).
-   **Remote projects.** Zed initialises providers in the local app, so over SSH the key comes from your local keychain or local environment, not the remote machine.

## Terms in this guide

[Tool calling](https://broadrouter.com/glossary/tool-calling/)

Tool calling, also called function calling, is an LLM API feature in which the model returns a structured request to run a function the developer has defined, with JSON arguments. The application runs the function and sends the result back; the model never runs code itself.

[Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/)

Pay-as-you-go is a pricing model in which you pay only for what you use, metered per unit such as tokens, requests or audio minutes, with no subscription or minimum commitment. Most LLM APIs bill this way, from a prepaid balance or a periodic invoice.

[Chat Completions API](https://broadrouter.com/glossary/chat-completions-api/)

The Chat Completions API is OpenAI's HTTP endpoint, POST /v1/chat/completions, that takes a model name and a list of role-tagged messages and returns the model's next message. Its request and response shape became the common format that OpenAI-compatible providers and SDKs reuse.

[Concurrency](https://broadrouter.com/glossary/concurrency/)

Concurrency is the number of requests a client has in flight at the same time. LLM APIs often cap it per key or plan, separately from requests per minute, because each open request holds GPU capacity until its response has finished.

[Context window](https://broadrouter.com/glossary/context-window/)

A context window is the maximum number of tokens a language model can work with in a single request. It covers the prompt, conversation history, tool definitions, images and the generated output, including any reasoning tokens. Anything that does not fit must be cut, summarised or split across several requests.

[OpenAI-compatible API](https://broadrouter.com/glossary/openai-compatible-api/)

An OpenAI-compatible API is an HTTP API that accepts the same request and response formats as the OpenAI API, such as POST /v1/chat/completions, so OpenAI SDKs and tools can use it by changing only the base URL, the API key and the model name.

[Prepaid credit](https://broadrouter.com/glossary/prepaid-credit/)

Prepaid credit is money added to an API account before use. Each request deducts its cost from the balance, and when the balance runs out, metered requests stop until you top up. It caps spend at what you have paid in.

[Rate limit](https://broadrouter.com/glossary/rate-limit/)

A rate limit is a cap an API places on how much a client can use it in a time window, such as requests per minute or tokens per minute. Requests over the limit are refused, usually with HTTP 429 Too Many Requests, until usage falls back under it.

## Questions

### Which environment variable does Zed read for a custom provider key?

Zed builds the name from the provider ID in upper snake case plus \_API\_KEY. A provider called broadnet reads BROADNET\_API\_KEY. A non-empty variable takes precedence over a key saved in the keychain.

### Does the BroadNet model work in Zed's Agent Panel?

Yes. Zed's API access covers the Zed Agent, the Inline Assistant, commit messages and thread summaries. Zed assumes tool support for OpenAI-compatible models, so pick GLM 5.3 or Qwen3.8 27B, which BroadNet lists with tools.

### Does this change Zed's edit predictions?

No. Zed's docs say edit prediction has its own provider setup under edit\_predictions. The provider in this guide is for the agent and other Zed AI features.

### Why does Zed say the model only works with the Responses API?

It shouldn't for BroadNet. Leave capabilities.chat\_completions at its default of true. BroadNet serves /v1/chat/completions and does not list the Responses API.

## Related guides

-   [Use Kilo Code with BroadNet Inference (OpenAI Compatible provider)](https://broadrouter.com/guides/kilo-code-openai-compatible/)
-   [Use Cline with BroadNet Inference (OpenAI Compatible provider)](https://broadrouter.com/guides/cline-openai-compatible/)
-   [Why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/)
-   [BroadNet Inference error codes and when to retry](https://broadrouter.com/guides/errors-and-retries/)
-   [All tools that work with BroadNet Inference](https://broadrouter.com/integrations/): SDKs, coding agents, chat UIs and automation tools, with exact settings for each

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-zed-openai-compatible-provider&utm_content=page-cta) ·

**Sources**

-   [Zed docs, Use API Access, OpenAI-compatible endpoints (checked 2026-11-15)](https://zed.dev/docs/ai/use-api-access#openai-compatible)
-   [Zed releases on GitHub, v1.28.1 latest (checked 2026-11-15)](https://github.com/zed-industries/zed/releases)
-   [BroadNet Inference API reference (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-zed-openai-compatible-provider&utm_content=sources)
