Connect Pi
Add a native OpenAI-compatible provider to Pi, select an exact model ID and check the connection.
https://aelder.dev/v1LOCAL CONFIGURATION
Let my agent set this up
Copy this task to an agent already running on your computer. Enter your API key locally when asked.
Help me connect Pi to AELDER using this guide: https://aelder.dev/docs/pi/
Service Base URL: https://aelder.dev/v1
First inspect my installed version, active profile and configuration. Explain any mismatch with the guide before changing anything.
Use the documented local configuration or CLI method. Do not automate the GUI, install software or change permissions without asking.
Preserve existing accounts, providers, models, defaults, permissions and unrelated settings. Propose the smallest change, show a redacted diff, and back up any files before editing.
Have me enter my API key locally using the tool's secret storage or an environment variable. Never ask me to paste a key into chat, print it, or include it in a command, diff, log or commit.
Use the exact model ID I choose from my account's model list. Do not invent model IDs or assume every model supports every API format or tool feature.
Validate syntax and configuration loading before making any generation request. If there is no dry-run, say so.
Explain any proposed paid test, the model and what it sends, and ask for approval before running it. Do not send project files or private conversation history as a test.
Finish with the settings changed, checks performed and steps to restore the backup.Pi can connect directly through its models.json configuration. This guide uses Chat Completions, sent to /v1/chat/completions.
1. Prepare the connection
Use an existing Pi installation. Copy the Base URL above, including /v1, and choose an exact model ID from the authenticated models endpoint. Choose a model with tool-calling support for coding tasks.
Make SERVICE_API_KEY available to the terminal that starts Pi through your local secrets tooling. Alternatively, Bash and Zsh can read it without putting the key in shell history:
printf 'Service API key: '
IFS= read -r -s SERVICE_API_KEY
printf '\n'
export SERVICE_API_KEYKeep the key on your computer. Do not paste it into an agent conversation.
2. Add a custom provider
Open ~/.pi/agent/models.json, or the models.json in your configured Pi agent directory. Create it if absent. If it exists, merge my-api into its existing providers object; preserve your other providers and settings.
{
"$schema": "https://pi.dev/schemas/models.schema.json",
"providers": {
"my-api": {
"name": "My API",
"baseUrl": "https://aelder.dev/v1",
"api": "openai-completions",
"apiKey": "$SERVICE_API_KEY",
"models": [
{ "id": "YOUR_MODEL_ID", "input": ["text"] }
]
}
}
}Replace YOUR_MODEL_ID with the service’s exact ID. Keep the AELDER Base URL including /v1. $SERVICE_API_KEY is an environment reference in current Pi versions; it is not the literal key. Check your installed version’s reference if it uses an older configuration format.
openai-completions is Pi’s name for Chat Completions. Do not put /chat/completions in baseUrl. The my-api provider label belongs to Pi and is not added to the HTTP model ID.
Pi applies fallback context and output limits when they are omitted. Those defaults do not establish the selected model’s limits. Set contextWindow and maxTokens only to verified values before long coding sessions. Omitted cost metadata can also make Pi’s displayed estimate differ from your service bill.
3. Select the model
Start Pi from the terminal with the exported key, then run:
/modelOpening the picker reloads models.json. Select your model under My API. In the reviewed version, Ctrl+S in the picker saves the selection for new sessions. A resumed session can restore its own model choice, so use a fresh session for your first check.
Add another entry to models to register another exact ID, then reopen /model to choose it. Registering a model makes it selectable; selecting it determines which model the next request uses.
4. Verify
First confirm the model and provider in Pi’s UI. Loading a configuration or opening the picker is not a generation test. Send a short prompt such as “Reply with OK” when ready for a billable request, then check the request and model in your service dashboard.
If no model appears, check the JSON and that SERVICE_API_KEY reached Pi’s process. For a 401, check the key; for a model error, compare the ID with /v1/models. A working text response does not verify tools, reasoning, images or the full context window. The input setting permits text only; it does not verify tool support.
Pi also has openai-responses and anthropic-messages adapters. Use a separate, deliberately configured provider if you need another protocol; changing a label alone does not translate one protocol into another.
Sources: Pi’s model setup and configuration reference. The native configuration was reviewed; a live service session has not been verified.
Need the key? Open your AELDER dashboard. For direct API calls, see the API reference.

