AI providers supported by Pi Agent
The following is a complete list of all AI providers supported by Pi Agent.
Providers that support subscription login
Perform OAuth login with the/logincommand:
| Provider | Requirement | Description |
|---|---|---|
| Claude Pro/Max | Anthropic Subscription | Additional usage is billed by token |
| ChatGPT Plus/Pro (Codex) | OpenAI Subscription | Officially recognized by OpenAI |
| GitHub Copilot | GitHub Copilot Subscription | Supports enterprise servers |
| xAI (Grok) | X Premium Subscription | Uses the Grok model |
| OpenRouter | OpenRouter Account | OAuth creates an API Key |
| Radius | Radius Account | Dynamic pi-messages gateway |
Subscription-type entries are subject to the actual display of the Pi Agent /login menu; different versions may vary slightly.
Providers that support API Key
Configure the API Key via environment variables or~/.pi/agent/auth.json:
$ export ANTHROPIC_API_KEY=sk-ant-api03-xxxx
| Provider | Environment variable | auth.json key |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY | anthropic |
| Ant Ling | ANT_LING_API_KEY | ant-ling |
| Azure OpenAI Responses | AZURE_OPENAI_API_KEY | azure-openai-responses |
| OpenAI | OPENAI_API_KEY | openai |
| DeepSeek | DEEPSEEK_API_KEY | deepseek |
| NVIDIA NIM | NVIDIA_API_KEY | nvidia |
| Google Gemini | GEMINI_API_KEY | |
| Amazon Bedrock | AWS_BEARER_TOKEN_BEDROCK | amazon-bedrock |
| Mistral | MISTRAL_API_KEY | mistral |
| Groq | GROQ_API_KEY | groq |
| Cerebras | CEREBRAS_API_KEY | cerebras |
| Cloudflare AI Gateway | CLOUDFLARE_API_KEY (also requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_GATEWAY_ID) | cloudflare-ai-gateway |
| Cloudflare Workers AI | CLOUDFLARE_API_KEY (also requires CLOUDFLARE_ACCOUNT_ID) | cloudflare-workers-ai |
| xAI | XAI_API_KEY | xai |
| OpenRouter | OPENROUTER_API_KEY | openrouter |
| Vercel AI Gateway | AI_GATEWAY_API_KEY | vercel-ai-gateway |
| ZAI Coding Plan | ZAI_API_KEY | zai |
| ZAI Coding Plan (China) | ZAI_CODING_CN_API_KEY | zai-coding-cn |
| OpenCode Zen | OPENCODE_API_KEY | opencode |
| OpenCode Go | OPENCODE_API_KEY | opencode-go |
| Radius | RADIUS_API_KEY | radius |
| Hugging Face | HF_TOKEN | huggingface |
| Fireworks | FIREWORKS_API_KEY | fireworks |
| Together AI | TOGETHER_API_KEY | together |
| Baseten | BASETEN_API_KEY | baseten |
| Kimi For Coding | KIMI_API_KEY | kimi-coding |
| MiniMax | MINIMAX_API_KEY | minimax |
| MiniMax (China) | MINIMAX_CN_API_KEY | minimax-cn |
| Qwen Token Plan | QWEN_TOKEN_PLAN_API_KEY | qwen-token-plan |
| Qwen Token Plan(Individual) | QWEN_TOKEN_PLAN_API_KEY | qwen-token-plan-individual |
| Qwen Token Plan (China) | QWEN_TOKEN_PLAN_CN_API_KEY | qwen-token-plan-cn |
| Xiaomi MiMo | XIAOMI_API_KEY | xiaomi |
| Xiaomi MiMo Token Plan (China) | XIAOMI_TOKEN_PLAN_CN_API_KEY | xiaomi-token-plan-cn |
| Xiaomi MiMo Token Plan (Amsterdam) | XIAOMI_TOKEN_PLAN_AMS_API_KEY | xiaomi-token-plan-ams |
| Xiaomi MiMo Token Plan (Singapore) | XIAOMI_TOKEN_PLAN_SGP_API_KEY | xiaomi-token-plan-sgp |
There are 35 API Key providers in total, corresponding one-to-one with the environment variable list in the official providers.md.
Among them, Qwen Token Plan (Individual) and Qwen Token Plan share the same environment variable QWEN_TOKEN_PLAN_API_KEY; the difference lies in the auth.json key name and the range of selectable models.
The account and gateway IDs for the two Cloudflare entries can be set either as environment variables or written into the env object of the auth.json credentials.
Local and custom providers
Local inference backends are connected via configuration files, while custom APIs can be registered using the extension method.
| Provider | Description | Configuration method |
|---|---|---|
| llama.cpp | Local open-source model inference | /login llama.cpp, manage models through /llama |
| Custom API | Extensions development | Register via pi.registerProvider() |
For a complete example of registering a provider via the extension method, see the chapter "Local Models with llama.cpp".
The following three local backends are all connected via the OpenAI Compatible API:
| Backend | Default port | Description |
|---|---|---|
| Ollama | 11434 | Out of the box, pull and run a model with a single command |
| LM Studio | 1234 | Provides a graphical interface, suitable for managing local models on the desktop |
| vLLM | 8000 | Aimed at high-throughput service-oriented deployment |
Write the following minimal example into~/.pi/agent/models.json, using Ollama as an example; for LM Studio and vLLM, simply replace the name and baseUrl:
Examples
"providers": {
"ollama": {
"baseUrl": "http://127.0.0.1:11434/v1",
"api": "openai-completions",
"apiKey": "ollama",
"models": [
{
"id": "qwen3-coder-30b",
"name": "Qwen3 Coder 30B",
"contextWindow": 131072,
"maxTokens": 8192,
"input": ["text"]
}
]
}
}
}
The apiKey value "ollama" in the example is just a placeholder; the local server will directly ignore it.
But you cannot delete it for this reason: when no authentication field is configured, the model will load normally but will not appear in the /model selector, and the official recommendation is to keep the placeholder value.
The meanings of each field except apiKey are as follows:
| Field | Description |
|---|---|
| baseUrl | OpenAI Compatible API address; for LM Studio use http://127.0.0.1:1234/v1, for vLLM fill in the actual service address |
| api | Uses the OpenAI-compatible protocol, always write openai-completions |
| apiKey | Placeholder value; keep it even for local non-authenticated services, otherwise the model will not appear in /model |
| models[].id | The model ID used when calling, must match the name of the locally pulled model |
| models[].name | The name displayed in the selector |
| models[].contextWindow | Context window size (tokens) |
| models[].maxTokens | Maximum output length per request (tokens) |
| models[].input | Supported input types |