Use Zed with a private API
Connect Zed to the private Morse API: set it up, pick a model, and check it works.
Give Zed the base URL https://inference.trymorse.ai/v1 and a Morse API key. It calls the OpenAI API.
Before you start
Make a key for Zed alone, with a spend limit, under API keys in the console. Then one tool can't spend all your credits. See Limit a key. Keep the key in your environment, where Zed reads it.
export MORSE_API_KEY="sk_morse_..."Set up Zed
Add Morse as a provider
Add this to Zed's
settings.json. Zed reads the key fromMORSE_API_KEY, named after the provider, or from Settings > AI > LLM Providers.settings.json { "language_models": { "openai_compatible": { "Morse": { "api_url": "https://inference.trymorse.ai/v1", "available_models": [ { "name": "qwen/qwen3-coder", "display_name": "Qwen3 Coder 480B A35B", "max_tokens": 262144, "max_output_tokens": 32768, "capabilities": { "tools": true, "images": false } } ] } } }, "agent": { "default_model": { "provider": "Morse", "model": "qwen/qwen3-coder" } } }max_tokensis the model's context window. To add another model from the table below, add it toavailable_modelsthe same way.Keep your settings on for Zed's key
Which model to pick
| Model | Context | Input / output | Why |
|---|---|---|---|
qwen/qwen3-coder | 262.1K | $0.375 / $1.25 | Qwen's coding model. It doesn't reason, so it starts writing sooner. |
moonshotai/kimi-k3.1-pro | 1M | $2 / $10 | Reasons, and reads images. |
z-ai/glm-5.3 | 1M | $1.40 / $4.40 | Reasons, and takes tools at TEE too. |
deepseek/deepseek-v4-pro-0813 | 1M | $1.32 / $3.96 | Reasons, at a lower price. |
z-ai/glm-5.3-flash | 1M | $0.15 / $0.50 | Cheap and fast for small edits, and takes tools at TEE too. |
Prices are in dollars per million tokens, on each model's default endpoint. Every model is on the models page.
Check it works
Open the agent panel and ask it to change a line in one of your files. It edits files with its tools, so a finished edit shows that Morse took the request and its tool calls.
Keep it private
Set a privacy floor on Zed's key to hold it to a tier, such as TEE. Without a floor, a request runs on its model's default privacy tier. The floor only decides which endpoints serve the requests. See Privacy tiers and Provider routing.
On a plain API call, TLS ends inside Morse's door, an attested enclave, which seals the request before the relay receives it. A plain client checks the door's certificate, not its attestation. To check the attestation yourself, see Sealed API keys.
If something goes wrong
| What you see | What to do |
|---|---|
400 setting_not_forwarded | Turn on Let my settings reach the model host on the key's page in the console for Zed's key. |
401 invalid_api_key | Check that MORSE_API_KEY is set where Zed starts, and that the key isn't revoked. |
402 insufficient_balance or key_spend_limit_reached | Add credits, or raise the key's spend limit. A request holds credit for its output limit before it starts: see Holds. |
404 model_not_found | Use a model's id exactly as the table above writes it, with the part before the slash. |
Every code is in Error codes. For other tools, see Tools and coding agents.