Aider
Run the Aider coding assistant on cheapaimodel models through the OpenAI-compatible API.
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 setting | Value | |
|---|---|---|
| Base URL | OPENAI_API_BASE or --openai-api-base | https://api.cheapaimodel.ai/v1 |
| API key | OPENAI_API_KEY or --openai-api-key | Your key from the console's API Keys page |
| Model ID | --model | openai/glm-5.3, or openai/ plus any ID from the catalog |
Set it up
python -m pip install aider-install
aider-installThen, in your project:
export OPENAI_API_BASE="https://api.cheapaimodel.ai/v1"
export OPENAI_API_KEY="$CHEAPAIMODEL_API_KEY"
aider --model openai/glm-5.3Aider 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:
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:
{
"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 noopenai/prefix. Use--model openai/glm-5.3.- Aider starts with
gpt-4oand every request fails. Without--model(ormodel:in the config file), Aider seesOPENAI_API_KEYand picks a default OpenAI model, such asgpt-4owithgpt-4o-minias the weak model. We don't serve those IDs. Always name the model. --weak-modelor--editor-modelrequests fail. They follow the same rule as--model: prefix them withopenai/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
503this way. If it fails from the first request, check the model ID: an ID we don't serve returns503withmodel_not_found. Otherwise see Errors. fault filter abortorInvalid URL (POST /v1/chat/completions/chat/completions). Both are404s from a wrong base URL: the first means/v1is missing, the second that the base URL includes the endpoint path. Set exactlyhttps://api.cheapaimodel.ai/v1.