cheapaimodel

Aider

Run the Aider coding assistant on cheapaimodel models through the OpenAI-compatible API.

Copy

Aider connects to OpenAI-compatible APIs through its openai/ model prefix: point the base URL and key at cheapaimodel and put openai/ in front of the model ID.

Aider settingValue
Base URLOPENAI_API_BASE or --openai-api-basehttps://api.cheapaimodel.ai/v1
API keyOPENAI_API_KEY or --openai-api-keyYour key from the console's API Keys page
Model ID--modelopenai/glm-5.3, or openai/ plus any ID from the catalog

Set it up

Terminal
python -m pip install aider-install
aider-install

Then, in your project:

Terminal
export OPENAI_API_BASE="https://api.cheapaimodel.ai/v1"
export OPENAI_API_KEY="$CHEAPAIMODEL_API_KEY"
aider --model openai/glm-5.3

Aider strips the prefix and requests glm-5.3 from /v1/chat/completions.

To keep the settings without exporting OPENAI_* variables for every tool, put them in Aider's config file instead:

~/.aider.conf.yml
model: openai/glm-5.3
openai-api-base: https://api.cheapaimodel.ai/v1
openai-api-key: sk-...

Aider also reads .aider.conf.yml from the root of your git repo. Keep files that contain your key out of version control.

The model warning

On start, Aider prints Unknown context window size and costs, using sane defaults for models it has no metadata for, and may suggest similar names such as zai/glm-5.3. Keep openai/glm-5.3: the suggested names call other providers directly, not cheapaimodel. Aider's docs say the warning is safe to ignore, since Aider does not enforce token limits.

To silence it, pass --no-show-model-warnings, or describe the model in .aider.model.metadata.json in your home directory:

~/.aider.model.metadata.json
{
  "openai/glm-5.3": {
    "max_input_tokens": CONTEXT_LENGTH,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

Replace CONTEXT_LENGTH with the context length on the model's page, for example glm-5.3. Aider does not know cheapaimodel prices; see your spend on the console's Activity page.

Common mistakes

  • litellm.BadRequestError: LLM Provider NOT provided. The model ID has no openai/ prefix. Use --model openai/glm-5.3.
  • Aider starts with gpt-4o and every request fails. Without --model (or model: in the config file), Aider sees OPENAI_API_KEY and picks a default OpenAI model, such as gpt-4o with gpt-4o-mini as the weak model. We don't serve those IDs. Always name the model.
  • --weak-model or --editor-model requests fail. They follow the same rule as --model: prefix them with openai/ and use catalog IDs, for example --weak-model openai/glm-5.3-flash. If you set neither, Aider uses the main model for both.
  • "The API provider's servers are down or overloaded", with retries. Aider reports every 503 this way. If it fails from the first request, check the model ID: an ID we don't serve returns 503 with model_not_found. Otherwise see Errors.
  • fault filter abort or Invalid URL (POST /v1/chat/completions/chat/completions). Both are 404s from a wrong base URL: the first means /v1 is missing, the second that the base URL includes the endpoint path. Set exactly https://api.cheapaimodel.ai/v1.