pai runs on your machine and manages a Phantom AI key. Your agent can give each subagent a child key with its own spending limit, lifetime and rate cap. pai also sets plans and model routing, buys credit from an agent wallet, and checks which model answered a call. It runs as a CLI, as an MCP server (pai mcp), and through a skill for pi, Claude Code, Codex and Cursor.
npm i -g @connortessaro/pai
pai login # paste your key
pai balance
How pai behaves, one topic each:
src/pai.mts exports, in the sidebar and the index below. The CLI starts at run and the MCP server at createMcpServer.Source, issues and releases: github.com/connortessaro/pai.