Pi
Use Cortecs models with the Pi coding agent
Last updated
Use Cortecs models with the Pi coding agent
Pi is a terminal-based coding agent that supports custom OpenAI-compatible providers. Cortecs can be added directly through Pi's model configuration.
Before you begin, create a Cortecs API key by following the Quickstart and choose a tool-calling model from the model catalog.
Install Pi with Node.js and npm:
npm install -g --ignore-scripts @earendil-works/pi-coding-agentCreate or update ~/.pi/agent/models.json:
{
"providers": {
"cortecs": {
"baseUrl": "https://api.cortecs.ai/v1",
"api": "openai-responses",
"apiKey": "$CORTECS_API_KEY",
"models": [
{ "id": "<MODEL_ID>" }
]
}
}
}The Cortecs Responses API is recommended for Pi's agent workflows. Change api to openai-completions only if a model or workflow requires Chat Completions.
Replace <MODEL_ID> with the exact ID from the model catalog. Add more entries to models if you want to use several models.
Set your API key and launch Pi:
Run /model inside Pi and select the model listed under cortecs.
For additional model options, see Pi's custom model documentation.
Last updated
export CORTECS_API_KEY="<API_KEY>"
pi