Zed access
Zed officially supports adding OpenAI-compatible provider (OpenAI-compatible model service), which can be used for Zed’s own AI functions such as Zed Agent, Inline Assistant, submission information generation and thread summary.
If not yet installed, follow Zed download page to install the client. An agent is an assistant that can read and write files and carry out tasks. The Inline Assistant edits code directly at the current editing location.
External Agents and Terminal Threads usually manage models and tokens themselves and will not automatically inherit the configuration here.
Graphical interface configuration
- Open Zed.
- Run agent: open settings in the command panel, or open Settings → AI → LLM Providers.
- Click Add Provider and select OpenAI-compatible.
- Fill in:
| Field | Fill in content |
|---|---|
| Provider name | shanhai or ShangHai Do |
| API URL | https://shanghaido.com/v1 |
| Model ID | qwen3.8-flash |
| Context window | Fill in according to the confirmed model restrictions; the file example below only sets the first-time client budget |
| API Key | Your site token |
When the key is saved through the interface, Zed official instructions will be saved to the system key chain instead of settings.json. If the interface generates an environment variable such as SHANHAI_API_KEY, you can also let Zed read it in the local process environment.
settings.json example
If you need to write the address and model capabilities into the configuration file, you can use the following structure; do not write the real API Key into settings.json:
{
"language_models": {
"openai_compatible": {
"shanhai": {
"api_url": "https://shanghaido.com/v1",
"available_models": [
{
"name": "qwen3.8-flash",
"display_name": "qwen3.8-flash",
"max_tokens": 16384,
"max_output_tokens": 2048
}
]
}
}
}
}
max_tokens in Zed here represents the conversation length that the model can handle at one time, and max_output_tokens represents the upper limit of the length of a reply. Token is the unit used by the model to calculate text length, which is not equivalent to the number of Chinese characters. The 16384 and 2048 in this example are only actively set first-time use budgets, not verified model specifications; long conversations and larger projects should first confirm the actual limits with the site customer service before adjusting.
Zed treats OpenAI compatible models as Chat Completions by default, and assumes that the model supports tool calls by default. If a model does not actually support tools, it needs to be turned off in the capability configuration; if it only supports Responses, set chat_completions to false according to Zed official documentation. qwen3.8-flash in this article uses Chat Completions.
Get started
Select shanhai / qwen3.8-flash in Agent Panel, send a normal question first, and then try to read a small file. If you encounter problems with model calling or tool execution, please contact the site customer service.
official information
encountered a problem
If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, error time and error information to facilitate troubleshooting.