Aider
Connect Aider to PleumRouter with the OPENAI_API_BASE environment variable and an openai/ model prefix. You do not need to run a separate LiteLLM proxy.
Configuration example. Menu and setting names can differ slightly between Aider versions.
#setup.Install#
Install with python -m pip install aider-install && aider-install.
Setup#
Set the OPENAI_API_BASE and OPENAI_API_KEY environment variables. Then run aider --model openai/<model-id>.
- Create a key that starts with
plm_in the API keys menu, then copy it. - In your terminal, run
export PLEUM_API_KEY=plm_xxxxxxxxxxxxxxxx. Replaceplm_xxxxxxxxxxxxxxxxwith the key you copied. - Set
OPENAI_API_BASEtohttps://apirouter.pleum.ai/v1andOPENAI_API_KEYto$PLEUM_API_KEY. - Run
aider --model openai/<model-id>. Put an ID from the model catalog in<model-id>.
export PLEUM_API_KEY=plm_xxxxxxxxxxxxxxxx
export OPENAI_API_BASE=https://apirouter.pleum.ai/v1
export OPENAI_API_KEY=$PLEUM_API_KEY
aider --model openai/gpt-5.5Verify#
Send a short question in the aider input. If a reply comes back, the connection works. Look up the cost with the X-Request-Id response header at GET /v1/generation?id=….
How it works#
This tool sends OpenAI Chat Completions requests (/v1/chat/completions). The base URL is https://apirouter.pleum.ai/v1 and auth sends your plm_ key as Authorization: Bearer.
Errors#
The table below lists the errors that appear when you connect aider, with the fix for each. The plm_xxxxxxxxxxxxxxxx in the snippet is a placeholder, so replace it with a real key from the API keys menu.
| Symptom | Cause | Fix |
|---|---|---|
| 401 Unauthorized | The key was copied incorrectly or is no longer valid. | Copy the key again from the API keys menu and update the export PLEUM_API_KEY= line. |
| 402 Payment Required | The credit balance is too low, or this key went over its daily, weekly or monthly budget or its monthly token limit. | Top up credits, or adjust this key's budget and token limit in the API keys menu. |
| 404 Not Found | OPENAI_API_BASE is missing /v1 or has an extra path appended. The chat endpoint is /v1/chat/completions. | Set OPENAI_API_BASE to https://apirouter.pleum.ai/v1 and do not append a path to it. |
| 429 Too Many Requests | This key went over its request limit, or the model provider's request limit was reached. | Wait a moment and run it again. If you need a higher limit, contact us as described in Usage limits. |
Cost & security tips#
- Set a budget on the key. A coding agent calls the model many times per task and resends long context. Daily, weekly or monthly budgets on your API key make costs easier to predict.
- Keep the key out of git. Make sure a key in your shell profile or config file never gets committed, and if you suspect a leak, revoke it in the dashboard and issue a new one.
- Check where sensitive code goes. Prompts and code are sent to the provider of the model you pick. Use Data residency and PII masking to control that.