Pi Coding Agent access
Configure the local address, independent key and available models in Pi Coding Agent.
Pi Coding Agent defines a custom endpoint using models.json. This site access uses API Key.
Step one: Installation and preparation
npm install -g @earendil-works/pi-coding-agent
Press Quick Start to securely set up DUNDUN_API_KEY. The package name and configuration can be checked Pi official project.
Step 2: Add model
Back up and edit ~/.pi/agent/models.json, keep the existing Provider, and add:
{
"providers": {
"dundun": {
"baseUrl": "https://dunduntoken.com/v1",
"api": "openai-completions",
"apiKey": "$DUNDUN_API_KEY",
"models": [
{
"id": "MODEL_ID",
"name": "DunDun model"
}
]
}
}
}
Replace model ID. $DUNDUN_API_KEY is a variable interpolation of Pi, retaining the dollar sign. openai-completions is the API type name of Pi.
Step 3: Selection and Verification
pi --list-models dundun
pi --provider dundun --model MODEL_ID
You can also open /model in a session to re-read the configuration. Test the text first, then test the read-only tool, and check the call record of this site. Restoring an old session may bring back previous models and the selection should be reconfirmed.
Credential conflicts and troubleshooting
Command line credentials and credentials saved in auth.json may take precedence over model configuration. If you still get a 401 after switching, check these sources and don’t upload the full certification file. Check variables, configuration directories and JSON if the model list is empty; tool exception checking capabilities and API types. pi update --models updates the client directory, which does not mean that the corresponding model is activated on this site.