Aider#
Aider uses LiteLLM underneath, so it can reach any provider through Lockpin’s OpenAI-compatible routes, and Anthropic’s models through the Anthropic route.
Base URL and key#
export OPENAI_API_BASE=http://127.0.0.1:8787/openai/v1
export OPENAI_API_KEY=... # your own key; Lockpin passes it on
aider --model openai/gpt-6.1-sol
The openai/ prefix tells Aider to use an OpenAI-compatible endpoint with the model name after it.
The command-line forms are --openai-api-base and --openai-api-key.
For another OpenAI-compatible provider, change the base URL, for example
http://127.0.0.1:8787/groq/v1, and use that provider’s model name.
LiteLLM reads ANTHROPIC_API_BASE for Anthropic’s models:
export ANTHROPIC_API_BASE=http://127.0.0.1:8787/anthropic
export ANTHROPIC_API_KEY=... # your own key; Lockpin passes it on
aider --model claude-sonnet-5-5
On Windows, set the same variables with $env:NAME = "value" in PowerShell.
Use a model that lockpin providers -models lists. On a team server, use the server’s URL, and your
lp_... key as the API key.
Task name and budget#
Aider has no flag for request headers, but its model settings file can pass extra headers to
LiteLLM. Put this in .aider.model.settings.yml in your project or home folder:
- name: openai/gpt-6.1-sol
extra_params:
extra_headers:
X-Lockpin-Task: aider-refactor
X-Lockpin-Budget-Usd: "1.00"
The
namemust match the--modelyou run. Use one entry per model.Change the task name for each job. A task’s budget is a total for that name, and it keeps counting across restarts.
The budget header can only lower a budget below
-default-budget.Aider’s own side calls, such as commit messages and history summaries, go through the same model and headers, so they count toward the same task.
You can also name the task in the base URL instead, with no settings file:
http://127.0.0.1:8787/t/aider-refactor/openai/v1 or
http://127.0.0.1:8787/t/aider-refactor/anthropic. A header wins over the path.
If your Aider version does not apply extra_headers, use the task in the base URL, or cap Aider
with a key. See
Other tools and base URLs.
When the cap hits#
Lockpin answers HTTP 402, in OpenAI’s error shape for openai/... models and Anthropic’s for
Anthropic ones. Aider prints the error from LiteLLM, with the lockpin: message and the numbers in
it. Raise the task’s budget in the meter and run again. This has not been tested against Aider.
Aider has no prompt hook, so Lockpin’s prompt review cannot run inside it. The cap still holds.
Verify#
After one prompt, the meter shows the call under the task you named.