Skip to main content
With one Capriole AI API key, you can run GPT-6.2 Astra, Claude Fable 5.2, Opus 5.5, and Gemini 4 Carbon in Pi at up to 90% less than official API prices.

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:
  • A Capriole AI account (Sign up here)
  • A Premium plan (USD 9 per month, also includes unlimited web chat) or a Team plan, required for an API key (Subscribe)
  • A Capriole AI API key (Get your key)

Installation

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

Connect with one command

On the API page, select Connect agent, choose Pi and macOS or Linux, and paste your API key. Install Pi first, then run the command it shows in Terminal. It adds the Capriole AI provider below to ~/.pi/agent/models.json, reading your key from ~/.capriole-ai/key, and makes claude-latest the default model. The script lists every change and asks before it writes anything. It backs up the files it changes, sends one test request, and puts every file back if that request fails. To undo it, choose disconnect in the same dialog and run that command. It removes the Capriole AI provider and restores the settings the script changed, except any you have edited since. To set up Pi yourself, follow the steps below.

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 Gemini, Grok, GLM, Kimi, and Qwen 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.
  • forceAdaptiveThinking makes Claude models use adaptive thinking. Opus 5.5 rejects a fixed thinking budget.
  • Pi sends the system prompt with the developer role for reasoning models, which Kimi K3.1 Pro does not accept, so its entry sets supportsDeveloperRole: false.
  • 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, claude-latest, and google-latest always point to our latest flagship in each family, currently GPT-6.2 Astra, Claude Fable 5.2, and Gemini 4 Carbon.

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.
  • Gemini 4 Carbon thinks longer than Gemini 4 Argon, so its turns can take longer and use more tokens. For quicker turns, use google/gemini-4-argon.
  • To use the same key with your other coding agents, see Use one API key with coding agents.
  • Official references: Pi, Pi docs, Choose a model, and Pi configuration.
Last modified on December 4, 2026