Coding Agents

Aider setup with Thalam

Install Aider, export your Thalam API key into OPENAI_API_KEY, and ship in under a minute. Run Claude, GPT, DeepSeek, Qwen and more from the terminal with one API key and Aider's edit-and-commit workflow.

Install Aider

Setup — environment variables

Easiest path: set two env vars and run Aider with a model id prefixed with openai/. The prefix tells Aider to call THALAM as an OpenAI-compatible endpoint.

terminal
# Mac / Linux
export OPENAI_API_BASE="https://api.thalam.ai/v1"
export OPENAI_API_KEY="tl-live-..."

# Then run aider with the openai/ prefix on your model id
aider --model openai/anthropic/claude-sonnet-4.6

Browse model ids on the (format is openai/<provider>/<model> for Aider — the openai/ prefix is Aider-specific, the rest is the THALAM model id). On Windows use setx instead of export and restart your shell.


Setup — config file (optional)

Prefer a checked-in config? Drop the snippet below into .aider.conf.yml at the project root or in your home directory.

.aider.conf.yml
# .aider.conf.yml (project root or ~/.aider.conf.yml)
openai-api-base: https://api.thalam.ai/v1
openai-api-key: tl-live-...
model: openai/anthropic/claude-sonnet-4.6

Project-level .aider.conf.yml takes precedence over the home-directory file, so you can run different models per repository without touching env vars. A .env file (with AIDER_OPENAI_API_BASE and AIDER_OPENAI_API_KEY) is a third equivalent option.

Verify it works

After running aider, type into the prompt:

/ask Which model are you and which API base URL is serving you?

Common gotchas

Three issues that account for almost every "it didn't work" report.

"Unknown model"

You forgot the openai/ prefix on the model id. Aider routes through LiteLLM and uses the prefix to choose the call shape. Use openai/anthropic/claude-sonnet-4.6, not anthropic/claude-sonnet-4.6.

Calls go to OpenAI

OPENAI_API_BASE isn't actually set in the shell where Aider runs. Re-export in the same terminal session, or move the values into .aider.conf.yml so they apply on every run.

401 unauthorized

Key is missing the tl-live- prefix or has stray whitespace from a paste. Re-copy from the THALAM dashboard and paste with echo $OPENAI_API_KEY to confirm.


Why use THALAM with Aider

Aider runs in the terminal and works by sending diffs to a model. Cheap fast models for routine edits, flagships for hard refactors — Aider has the /model command to switch live; THALAM keeps every option behind one key.

Switch models live

Type /model openai/<provider>/<model> in Aider's prompt to switch upstream mid-session. No re-auth, no restart.

Cheap routine edits

Use DeepSeek V3.2 or Qwen3 for diff-style edits and reserve Claude / GPT for the hard architectural questions. Same Aider workflow.

Pay per token

No subscription, no minimums. To swap THALAM out, change OPENAI_API_BASE — Aider doesn't care.

CI / scripted use

Same env vars work in CI runners and bash scripts. Aider in CI for autonomous chores (changelog updates, dependency bumps) is straightforward with one OPENAI_API_BASE.


Frequently asked questions

What developers ask before wiring Thalam into Aider.

Do I need an API key to use Aider with Thalam?

?

Yes. Aider reads its API key from the OPENAI_API_KEY environment variable (or the openai-api-key field in .aider.conf.yml). To route Aider through Thalam, create a free Thalam account, copy your API key from the dashboard, and export it as OPENAI_API_KEY. No credit card required to create the key — you only pay when you make requests.

How do I install Aider and connect it to Thalam?

?

Three steps. (1) Install Aider with pip: python -m pip install aider-install && aider-install (full instructions at aider.chat/docs/install.html). (2) Sign up at thalam.ai and copy your tl-live-... key. (3) Export OPENAI_API_BASE=https://api.thalam.ai/v1 and OPENAI_API_KEY=tl-live-... in your shell, then run aider --model openai/anthropic/claude-sonnet-4.6 (the openai/ prefix tells Aider to use the OpenAI-compatible call shape).

Is Thalam OpenAI-compatible?

?

Yes. Thalam exposes an OpenAI-compatible base URL at https://api.thalam.ai/v1, which is exactly what Aider expects when OPENAI_API_BASE is set. Every model Thalam routes to (Claude, Gemini, DeepSeek, Qwen and more) is reachable through the same OpenAI Chat Completions interface — just prefix the model id with openai/ on the Aider side.

Can I use Thalam with Aider on Mac and Windows?

?

Both, plus Linux. Aider runs in any Python 3.9+ environment. On Mac/Linux use export OPENAI_API_BASE=...; on Windows use setx OPENAI_API_BASE=... and restart your shell, or drop the values into .aider.conf.yml (works identically on every platform).

Can I switch models without changing my code?

?

Yes. Type /model openai/<provider>/<model> inside Aider's prompt to switch upstream mid-session, or pass --model openai/<provider>/<model> on launch. Switching between Claude, GPT, DeepSeek or any other Thalam-routed model is a config change, not a code change — Aider keeps its edit-and-commit workflow identical.

Plug in. Pick a model. Ship.

Get an API key in under a minute. No credit card required.