Suanlimao
← Back to all tutorials

Connect your tools

Aider

The terminal pair-programming tool: two environment variables and an `openai/` prefix.

About 4 minFor:Developers who edit code with Aider in the terminal

Before you start

  • Aider is installed (aider --version works)
  • A key and a model name copied from the model plaza

Step 1 · STEP 0x01

Set the address and key

bash
export OPENAI_API_BASE=https://api.suanlimao.shop/v1
export OPENAI_API_KEY=<YOUR_API_KEY>
terminal
$ export OPENAI_API_BASE=https://api.suanlimao.shop/v1$ export OPENAI_API_KEY=<YOUR_API_KEY>
  • The official OpenAI-compatible page uses exactly these two variables: OPENAI_API_BASE for the address and OPENAI_API_KEY for the key.
  • On Windows, reopen the terminal after setx (official note).
The docs do not say whether the address needs /v1. Start with https://api.suanlimao.shop/v1; on 404 try https://api.suanlimao.shop. The flags --openai-api-base / --openai-api-key work instead of the variables too.
The full key is shown only once, at creation. Missed it? Revoke it and create a new one.

Create a key →

Step 2 · STEP 0x02

Start with the openai/ prefix

terminal
$ aider --model openai/<MODEL_NAME>Aider v…Model: openai/<MODEL_NAME> with whole edit formatGit repo: .git with N files
  • Prefix the model name with openai/ so Aider uses the OpenAI-compatible route.
  • To make it permanent, put it in .aider.conf.yml (searched in the git root, current directory and home) or a .env file; see the official config docs for key names.
Don't guess the model name: open the model plaza, click “Copy model id” on a model card and paste it. A wrong model name is the most common error.

Open the model plaza →

Step 3 · STEP 0x03

Give it a task

terminal
> 给 README 加一节「快速开始」(Aider 会提出修改并询问是否应用)
Aider shows “model warnings” for model names it does not recognise; that is harmless as long as the name matches the plaza.

✓ How to tell it worked

  • Aider answers and proposes code changes.
  • The Usage page shows the request.

FAQ

401?

OPENAI_API_KEY is unset or truncated, or on Windows the terminal was not reopened after setx.

404?

Check the model name has the openai/ prefix and matches the plaza; then try OPENAI_API_BASE with and without /v1.

Want a Claude-family model?

Still use the OpenAI-compatible route: openai/ plus the Claude model name from the plaza.

Related tutorials

Still stuck?

Read the troubleshooting tutorials first. If that does not help, open a ticket with the request_id, time, model and the exact error (never paste your key).