Skip to main content
To connect Aider to BetterToken, prepare an API key, enter the Base URL shown below, and choose a current Model ID from the model plaza.

Key settings

Prerequisites

Additional requirements

  • Install Python

Install

Install Aider

Run the following commands in a terminal:
After installation, confirm that Aider is available:

Manual setup

Configure BetterToken for the current terminal

Replace 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:
Add .env to .gitignore so the API Key is not committed. Then enter the project directory and run:
To use another file for one project, specify it explicitly:

Optional: use .aider.conf.yml

To persist only non-sensitive settings, create .aider.conf.yml in your home or project directory:
Keep the API Key in the 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:
Do not remove the 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 the Model 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? Use https://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.
  • Manual setup: enter the API Key, Base URL, and Model.
  • Not supported: no verified direct setup is currently available.

Technical details

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.