cheapaimodel

Zed

Use cheapaimodel models in the Zed Agent and other Zed AI features through an OpenAI-compatible provider.

Copy

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 settingValue
Base URLapi_urlhttps://api.cheapaimodel.ai/v1
API keyLLM Providers settings page, or CHEAPAIMODEL_API_KEYYour key from the console's API Keys page
Model IDavailable_models[].nameglm-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:

~/.config/zed/settings.json
{
  "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 ID cheapaimodel reads CHEAPAIMODEL_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.
  • 404 with the plain-text body fault filter abort. api_url is missing /v1. Set https://api.cheapaimodel.ai/v1.
  • 404 with Invalid URL (POST /v1/chat/completions/chat/completions). api_url includes the endpoint path. Zed adds /chat/completions itself; set https://api.cheapaimodel.ai/v1 only.
  • 503 with model_not_found. name must be a model ID from the catalog, spelled exactly; display_name is only a label.