Zed: connect a cheap AI API
Zed declares the provider right in settings.json and keeps the key in the keychain or an environment variable — it never lands in the config and can't leak into git by accident.
Zed
Editor with a built-in agent
Create an API key on the Keys page and copy it.
Open settings.json (cmd-shift-P → zed: open settings) and add the provider. List only the models you actually use - each one shows up in the picker.
{
"language_models": {
"openai_compatible": {
"cheapai": {
"api_url": "https://cheapai.io/v1",
"available_models": [
{
"name": "claude-opus-4-8",
"display_name": "Claude Opus 4.8",
"max_tokens": 200000,
"max_output_tokens": 32000,
"capabilities": { "tools": true, "images": true }
},
{
"name": "gpt-5.6-sol",
"display_name": "GPT-5.6 Sol",
"max_tokens": 200000,
"max_output_tokens": 32000,
"capabilities": { "tools": true, "images": true }
}
]
}
}
}
}Put the key in the Agent settings UI, or export CHEAPAI_API_KEY in your shell.
export CHEAPAI_API_KEY="YOUR_API_KEY"settings.json - Zed ignores it there and keeps keys in the system keychain. The env var name is derived from the provider id: cheapai → CHEAPAI_API_KEY. Rename the provider and the variable name changes with it.Zed — common questions
Where does Zed store the key?
In the system keychain or in an <ID>_API_KEY environment variable. Don't put the key in settings.json — that file only holds the provider id, api_url and the model list.
Get a key and plug it into Zed
Claude, GPT, Gemini and Grok on one key · pay in ₽, USDT or by card · no VPN
Get API keyGuides for other tools
See also: model prices · API reference and FAQ