For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pi

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.

1. Install Pi

Install Pi with Node.js and npm:

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

2. Add Cortecs

Create 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.

3. Start Pi

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