Key settings
Prerequisites
- The current version of the tool is installed
- A BetterToken API key: register and get one
- A Model ID from the model plaza
Additional requirements
- Install Python
Install
Install Aider
Run the following commands in a terminal:Manual setup
Configure BetterToken for the current terminal
- macOS / Linux
- Windows PowerShell
YOUR_API_KEY with your BetterToken API Key. YOUR_MODEL_ID is only an example. Replace it with a current model ID from a supported provider from the model plaza, and keep the openai/ prefix.
Save the configuration with .env
To avoid setting variables every time you open a terminal, create a.env file at the Git root of your project:
.env to .gitignore so the API Key is not committed. Then enter the project directory and run:
Optional: use .aider.conf.yml
To persist only non-sensitive settings, create.aider.conf.yml in your home or project directory:
OPENAI_API_KEY environment variable instead of a shared YAML file.
Change the model
Replace the model in the launch command with a current model ID from a supported provider:openai/ prefix. the Model ID must be compatible with the configured endpoint.
Verify the connection
Send a short test prompt. If the tool returns a response without an authentication or Model ID error, the connection works. Fully restart the tool after changing its configuration.Switch models
Open the model selector or change theModel field in the configuration. Use the exact Model ID from the model plaza, then restart the current session.
Common errors
Setup FAQ
Which Base URL should Aider use? Usehttps://www.bettertoken.ai/v1. This is BetterToken’s OpenAI-compatible Base URL.
Why does the model name need the openai/ prefix?
Aider uses this prefix to identify an OpenAI-compatible model. Omitting it can make Aider select the wrong provider.
Can I put the API Key in .aider.conf.yml?
We do not recommend it. Use environment variables or a .env file ignored by Git to reduce the risk of exposing an API Key in project files.
Advanced setup
Supported providers
Statuses apply to the BetterToken setup documented on this page.
What the setup methods mean
What the setup methods mean
- Manual setup: enter the API Key, Base URL, and Model.
- Not supported: no verified direct setup is currently available.
Related guides
- Continue CLI custom model setup
- Codex CLI custom provider setup
- Cursor custom API, Base URL, and API Key setup
- Configure an OpenAI-compatible API in Cline
Technical details
Protocol, endpoint, and internal provider fields
Protocol, endpoint, and internal provider fields
This setup uses
https://www.bettertoken.ai/v1. The tool appends the OpenAI-compatible endpoint path. Do not add /chat/completions or /responses unless a specific field explicitly requires it.
