Skip to main content
Add an OpenAI-compatible provider in Zed Agent Settings, then enter the BetterToken API Key, Base URL, and Model ID. Zed stores keys saved through this screen in the system keychain instead of settings.json.

Key settings

Prerequisites

Install

Install or update to the current version from the Zed website. Start Zed, then use the steps below to open Agent settings.

Manual setup

1

Add an OpenAI-compatible provider

Click Add Provider, choose OpenAI Compatible, and enter BetterToken as the Provider Name.
2

Enter the connection settings

Enter only the Base URL. Zed constructs the Chat Completions endpoint.
3

Save the API Key

Save the provider in Zed settings. Zed stores the API Key in the local system keychain and does not write it to settings.json.
4

Select the model

Open the Agent Panel model picker and select YOUR_MODEL_ID under BetterToken.
Do not place YOUR_API_KEY in settings.json, a project file, or a Git repository.

Optional: declare the provider and model in settings.json

When you need file-managed model declarations, run zed: open settings file. Keep only the provider, api_url, and model metadata in the file:
Zed requires max_tokens as the model context-window declaration. Adjust it to the selected model. Enter the API Key in Agent Settings so the system keychain stores it.

Verify the connection

  1. Select BetterToken / YOUR_MODEL_ID in the Agent Panel.
  2. Send a short test message.
  3. A normal response without authentication or model errors confirms the setup.
Fully quit and restart Zed after changing provider or model settings.

Switch models

Choose another BetterToken model in the Agent Panel model picker. To add a Model ID, copy the current value from the model plaza, then update the provider settings or available_models.

Common errors

Advanced setup

Supported providers

Statuses apply to the BetterToken setup documented on this page.
  • Manual setup: enter the API Key, Base URL, and Model.
  • Not supported: no verified direct setup is currently available.

Technical details

Zed calls BetterToken through an OpenAI-compatible provider. The settings screen stores the key in the system keychain; settings.json contains only the provider, api_url, and model declaration. Use https://bettertoken.ai/v1 as the Base URL and let Zed append the Chat Completions path.