Skip to content
Documentation

Tool setup

Aider

Aider speaks the OpenAI API, so two environment variables point it at the AdvancedMind AI gateway.

Before you start

You need an active API key with credits on the org. Create one under API keys and copy the secret; it is shown once. A standard-scoped key can use either Klara preview whenever that route is available.

1. Install Aider

bash
python -m pip install aider-install
aider-install   # installs aider into its own isolated environment

2. Point Aider at the gateway

Aider treats AdvancedMind AI as an OpenAI-compatible provider. Set the base URL and key in your environment; these override the default OpenAI endpoint:

bash
export OPENAI_API_BASE="https://api.advancedmind.ai/v1"
export OPENAI_API_KEY="amai_sk_..."   # the secret shown once at key creation

To avoid exporting globals, pass --openai-api-base and --openai-api-key on the command line for a single run instead. Either way, prefix the model id with openai/ so Aider routes it through the OpenAI-compatible client.

3. Choose a model

  • Klara Base Preview v2: harder coding, repository analysis, test planning, debugging, and multi-step implementation.
  • Klara Base Preview v1: more direct technical answers and focused edits.

The wire ids for both Klara previews are in the commands below.

4. Run Aider

With the env vars set, name a model and the files you want in the chat:

bash
# from inside your git repo
aider --model openai/Klara-base-preview-v2 auth/session.go  # harder coding work

# or use the more direct preview
aider --model openai/Klara-base-preview-v1 auth/session.go

Or supply the gateway inline, without exporting anything:

bash
# pass the gateway on the command line instead of exporting env vars
aider \
  --openai-api-base https://api.advancedmind.ai/v1 \
  --openai-api-key  "$AMAI_API_KEY" \
  --model openai/Klara-base-preview-v1

Streaming

The Klara previews stream by default, so edits appear token by token as Aider works. Aider can only print a per-response token-and-cost line when streaming is off, because it needs the final usage figures. Add --no-stream when you want that cost line in the terminal:

bash
# disable streaming if you want the full cost line printed per response
aider --model openai/Klara-base-preview-v1 --no-stream

Token cost

Aider sends the files in the chat plus its diffs as context, so input tokens grow with the number and size of files you add; add only what the task needs. Every request is metered against your org balance and recorded with its model, token counts, and final cost on the Usage page. Top up or set a low-credit alert on Billing. A request that would run past your balance is blocked before any provider call.

Key scopes and limits

Give Aider its own key so you can revoke it independently. Use a standard key for ordinary Klara work, or a research key only when the session operates under an approved Research Mode entitlement. Set a monthly spend limit when you create the key to cap an unattended session. Manage and revoke keys on the API keys page.


Next: streaming, error handling, or the OpenCode setup guide.