~/.pi/agent/models.json. By adding A2Agent as a custom provider, you can route Pi requests through A2Agent and select supported models from the /model picker.
Prerequisites
- Pi Coding Agent installed — follow the official Pi Quickstart if needed
- An A2Agent API key — sign up at a2agent.me/register to get one
- A model ID listed on the A2Agent Models page
Setup
1
Create a custom A2Agent provider
Create or edit Pi’s custom model configuration:Add the following configuration:The model IDs above are examples. Model availability may change, so use the exact IDs currently shown on the A2Agent Models page.
2
Start Pi and select an A2Agent model
Start Pi from the project directory:Inside Pi, enter:Select:Then choose one of the configured models.
3
Run a test request
Start a new Pi session and enter:You can also run a one-shot request:If Pi returns a response, the A2Agent connection is working.
Troubleshooting
Connection refused or could not resolve host
Connection refused or could not resolve host
Confirm that the base URL is exactly:Make sure:
- the
/v1path is included; - the URL does not contain
/modelsor/chat/completions; apiis set toopenai-completions; and
No A2Agent models appear in /model
No A2Agent models appear in /model
Check the following:
-
the file is located at
~/.pi/agent/models.json; - the JSON syntax is valid;
-
the Provider name is
a2agent; -
at least one model is listed under
models; - the model ID is spelled correctly.Check the current list at:A2Agent Models page
Model not found
Model not found
The model ID must match an available A2Agent model exactly.Check the current list at:A2Agent Models pageModel IDs and availability may change over time. Update the
models array with the current ID, then reopen /model.