Skip to main content

What is Pi

Pi is an open-source, minimal coding agent for the terminal. It reads custom endpoints from models.json, and each model can use a different API protocol. This setup adds Capriole AI as one provider in that file.

Prerequisites

Before you begin, make sure you have:

Installation

Install Pi with the official install script:
Or install it with npm (Node.js 22.19 or later):

Configuration

Model validation

Pi 1.3.0 passes a file-read, file-write, and final-answer check through Capriole AI with every model in Supported models, using the configuration below. Create or update ~/.pi/agent/models.json:
Then set Capriole AI as the default in ~/.pi/agent/settings.json:
What each setting does:
  • The provider api is openai-completions, so Grok, GLM, and Kimi use Chat Completions. GPT models override it with openai-responses, and Claude models override it with anthropic-messages and a baseUrl without /v1.
  • $CAPRIOLE_AI_API_KEY reads your key from the environment.
  • authHeader: true sends the key as a Bearer token for every protocol. Without it, Claude models send the key in an x-api-key header, which Capriole AI does not accept.
  • forceAdaptiveThinking makes Claude models use adaptive thinking. Opus 5.5 rejects a fixed thinking budget.
  • contextWindow and maxTokens tell Pi each model’s limits.

Run Pi

Set your API key, then start Pi from your project directory:
Switch models with /model. For a non-interactive run, use print mode:

Supported models

openai-latest and claude-latest always point to our latest flagship in each family.

Troubleshooting

Why don’t Capriole AI models appear in /model?

Pi hides a custom model until it can resolve its key. Export CAPRIOLE_AI_API_KEY in the same shell before you start Pi.

Why does Pi return an authentication error?

Confirm that the provider has "authHeader": true.

Why does Opus 5.5 fail with requires adaptive thinking?

Confirm that the Claude model entries have "compat": { "forceAdaptiveThinking": true }.

Why do Claude requests fail with Unsupported Claude Messages model?

Claude models on anthropic-messages need the bare Claude IDs, such as claude-opus-5-5. The anthropic/-prefixed IDs are for Chat Completions.

Notes

  • To add another Capriole AI model, copy the entry of a model from the same family and change the ID. GET https://api.caprioletech.com/v1/models lists every model ID.
  • Official references: Pi, Pi docs, Choose a model, and Pi configuration.
Last modified on October 20, 2026