Skip to content

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

  1. Create a key in API keys.
  2. Open the settings file with the command palette action zed: open settings file. It lives at ~/.config/zed/settings.json on macOS and Linux, and at %APPDATA%\Zed\settings.json on Windows.
  3. 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
            }
          }
        ]
      }
    }
  }
}
  1. 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_models for each model you want. name is the exact model id.
  • tools is on by default. Set it to false for models that do not list tools as a supported parameter.
  • Add "chat_completions": false to a model's capabilities to send it to POST /v1/responses instead.
  • Zed's edit predictions need POST /v1/completions, which Deference does not serve.

Troubleshooting

You seeCauseFix
The model is missing from the pickerThe provider block is not valid JSON, or name has a typoFix the file, then copy the id from the Models page
Zed asks for the key every timeThe keychain write failedExport DEFERENCE_API_KEY and start Zed from that shell
401 invalid_api_keyAn old key is storedRemove the stored key in the provider settings and enter the new one
404 model_not_foundname differs from the catalog idCopy the id from the Models page
Tool calls failThe model does not support toolsSet "tools": false for it
402 insufficient_creditNo available creditAdd credit