Zed
Use cheapaimodel models in the Zed Agent and other Zed AI features through an OpenAI-compatible provider.
Zed adds OpenAI-compatible services as providers under language_models.openai_compatible in settings.json. The provider then serves the Zed Agent, the Inline Assistant and Zed's other model-backed features.
| Zed setting | Value | |
|---|---|---|
| Base URL | api_url | https://api.cheapaimodel.ai/v1 |
| API key | LLM Providers settings page, or CHEAPAIMODEL_API_KEY | Your key from the console's API Keys page |
| Model ID | available_models[].name | glm-5.3, or any ID from the catalog |
Set it up
Add the provider
Run zed: open settings file from the command palette and add a provider:
{
"language_models": {
"openai_compatible": {
"cheapaimodel": {
"api_url": "https://api.cheapaimodel.ai/v1",
"available_models": [
{
"name": "glm-5.3",
"display_name": "GLM-5.3",
"max_tokens": CONTEXT_LENGTH
}
]
}
}
}
}max_tokens is the model's context window. Replace CONTEXT_LENGTH with the context length on the model's page, for example glm-5.3. Add one entry to available_models per model ID.
Add your key
Run agent: open settings, find cheapaimodel under LLM Providers and paste the key; Zed stores it in your system keychain. Alternatively set CHEAPAIMODEL_API_KEY in the environment Zed starts with and restart Zed.
Pick the model
Open the Agent Panel and choose GLM-5.3 under cheapaimodel in the model selector.
Edit predictions are configured separately. Zed's OpenAI-compatible edit prediction provider needs a /v1/completions endpoint and a fill-in-the-middle model; cheapaimodel's models serve only /v1/chat/completions and /v1/responses. Keep Zeta or another edit prediction provider.
Common mistakes
- Zed says the provider has no API key. Keys are not read from
settings.json. Paste the key on the LLM Providers page or set the environment variable. - The environment variable is ignored, or an old key keeps being used. Zed derives the variable's name from the provider ID: upper snake case plus
_API_KEY. The IDcheapaimodelreadsCHEAPAIMODEL_API_KEY; if you rename the provider, rename the variable to match. A non-empty variable takes precedence over the keychain; unset it and restart Zed to use the key you pasted. 404with the plain-text bodyfault filter abort.api_urlis missing/v1. Sethttps://api.cheapaimodel.ai/v1.404withInvalid URL (POST /v1/chat/completions/chat/completions).api_urlincludes the endpoint path. Zed adds/chat/completionsitself; sethttps://api.cheapaimodel.ai/v1only.503withmodel_not_found.namemust be a model ID from the catalog, spelled exactly;display_nameis only a label.