BroadRouter
Get started

Use Zed with BroadNet Inference as an OpenAI-compatible provider

Updated

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 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 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:
{
  "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
            }
          }
        ]
      }
    }
  }
}
  1. 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.
export BROADNET_API_KEY='your-broadnet-key'
  1. 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.
  • 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.
  • 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.

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.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity