Zed is a code editor with a built-in agent. Add Yunshu Router as an OpenAI-compatible provider and the Zed agent and inline assistant run on the model you choose, billed per token to your prepaid balance.
What you need
- Zed installed, a recent version.
- A Yunshu Router account with credit on the balance.
- An API key from the console. Use a separate key for Zed.
Set it up
-
Create a key in the console (API keys → Create key) and copy it.
-
Open your Zed settings file. To add the provider in the app instead, run agent: open settings and use Add Provider under LLM Providers, with the same URL, model ID and context window.
-
Add the provider:
{ "language_models": { "openai_compatible": { "yunshu": { "api_url": "https://api.yunshurouter.com/v1", "available_models": [ { "name": "deepseek-v4-pro", "display_name": "DeepSeek V4 Pro (Yunshu)", "max_tokens": 131072, "max_output_tokens": 8192, "capabilities": { "tools": true, "images": false, "parallel_tool_calls": false, "prompt_cache_key": false } } ] } } } }Field Why api_url With /.v1 nameOur model ID, exactly. capabilities.toolsMust be truefor the agent.capabilities.imagestrueonly if the model page lists image input. -
Add the key. Zed asks you not to put keys in
settings.json. Either enter it in the agent panel’s settings under theyunshuprovider, or set an environment variable before starting Zed. The name comes from the provider id:yunshu→YUNSHU_API_KEY.export YUNSHU_API_KEY="YOUR_YUNSHU_KEY" -
Open the agent panel and pick DeepSeek V4 Pro (Yunshu) in the model selector.
Check it works
- In the agent panel, ask: “Summarise the open file.”
- A correct answer means the key, address and model work. Ask for a small edit to check tool calls.
- Open Usage in the console: the requests show under the Zed key.
Recommended models
| Model ID | Use it for |
|---|---|
deepseek-v4-pro |
Agent, everyday work |
glm-5.3 |
Inline assistant, commit messages |
kimi-k3 |
Long agent tasks |
Add one entry to available_models per model.
Set a budget on the key
In the console, open API keys, pick the Zed key and set a monthly budget, a model
allow-list and a budget alert. A request that would pass the budget is refused with
402 budget_exceeded.
Known limitations
- Zed lists only the models you put in
available_models. - Anthropic format. Zed also has
language_models.anthropic_compatiblewith anapi_url(no/v1:https://api.yunshurouter.com).
Troubleshooting
| What you see | Likely cause | Fix |
|---|---|---|
401 |
Key not set, or set for another provider id | Enter it in the agent panel for yunshu, or export YUNSHU_ and restart Zed. |
404 on every request |
api_ without / |
Use https:/. |
404 naming the model |
name differs from our ID |
Copy it from the models page. |
| Agent doesn’t call tools | capabilities.tools is false |
Set it to true. |
403 naming the model |
Not on the key’s allow-list | Add it to the key. |
402 |
Budget or balance used up | Raise the budget or top up. |