Coding tools
Zed
Add Deference to Zed as an OpenAI-compatible language model provider.
Zed reads OpenAI-compatible providers from language_models.openai_compatible in settings.json. It speaks Chat Completions, so the base URL is https://deference.si/v1.
Set up
- Create a key in API keys.
- Open the settings file with the command palette action
zed: open settings file. It lives at~/.config/zed/settings.jsonon macOS and Linux, and at%APPDATA%\Zed\settings.jsonon Windows. - Add the provider.
{
"language_models": {
"openai_compatible": {
"Deference": {
"api_url": "https://deference.si/v1",
"available_models": [
{
"name": "anthropic/claude-sonnet-5.5",
"display_name": "Claude Sonnet 5.5",
"max_tokens": 200000,
"max_output_tokens": 64000,
"capabilities": {
"tools": true,
"images": true,
"parallel_tool_calls": false,
"prompt_cache_key": false
}
}
]
}
}
}
}- Open the Agent panel's settings, find Deference and paste your key. Zed keeps it in your system keychain. The key never goes in
settings.json.
max_tokens is the context window Zed plans for and max_output_tokens is the reply limit. Use the limits on the model's page on Models or lower ones. Lower values make Zed summarize earlier and spend less.
To use an environment variable instead of the keychain, export DEFERENCE_API_KEY and start Zed from that shell, for example with zed .. The variable name is the provider name in capitals plus _API_KEY. An app launched from the Dock or Start menu does not see your shell exports.
Verify
Open the Agent panel, pick the model under Deference and send a message. A streamed reply means the connection works. Then open Activity: the request is the top row, with the model you chose.
Pick a model
- Add one entry to
available_modelsfor each model you want.nameis the exact model id. toolsis on by default. Set it tofalsefor models that do not listtoolsas a supported parameter.- Add
"chat_completions": falseto a model'scapabilitiesto send it toPOST /v1/responsesinstead. - Zed's edit predictions need
POST /v1/completions, which Deference does not serve.
Troubleshooting
| You see | Cause | Fix |
|---|---|---|
| The model is missing from the picker | The provider block is not valid JSON, or name has a typo | Fix the file, then copy the id from the Models page |
| Zed asks for the key every time | The keychain write failed | Export DEFERENCE_API_KEY and start Zed from that shell |
401 invalid_api_key | An old key is stored | Remove the stored key in the provider settings and enter the new one |
404 model_not_found | name differs from the catalog id | Copy the id from the Models page |
| Tool calls fail | The model does not support tools | Set "tools": false for it |
402 insufficient_credit | No available credit | Add credit |