AI Providers Supported by Pi Agent
The following is a complete list of all AI providers supported by Pi Agent.
Providers supporting subscription login
OAuth login via the /login command:
| Provider | Requirement | Description |
|---|---|---|
| Claude Pro/Max | Anthropic subscription | Uses extra usage, 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 Grok model |
| OpenRouter | OpenRouter account | OAuth to create API Key |
| Radius | Radius account | Dynamic pi-messages gateway |
Subscription entries are subject to the actual display in the Pi Agent /login menu; different versions may vary slightly.
Providers supporting API Key
Configure API Key via environment variables or ~/.pi/agent/auth.json:
$ export ANTHROPIC_API_KEY=sk-ant-api03-xxxx
| Provider | Environment Variables | 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 official providers.md environment variable list.
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 of the two Cloudflare items can be set 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 interfaces can be registered via extensions.
| Provider | Description | Configuration method |
|---|---|---|
| llama.cpp | Local open-source model inference | /login llama.cpp, models managed via /llama |
| Custom API | Extensions development | Register via pi.registerProvider() |
For a complete example of registering a provider via extension, see the chapter "Working with llama.cpp Local Models".
The following three local backends are all connected via OpenAI Compatible API:
| Backend | Default port | Description |
|---|---|---|
| Ollama | 11434 | Ready to use out of the box; a single command can pull and run a model |
| LM Studio | 1234 | Provides a graphical interface, suitable for managing local models on the desktop |
| vLLM | 8000 | Oriented toward high-throughput service-oriented deployment |
Write the following minimal example into ~/.pi/agent/models.json, taking Ollama as an example; LM Studio and vLLM only need to replace the name and baseUrl:
Example
{
"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 ignore it directly.
But it should not be deleted for that reason: when no authentication field is configured, the model will load normally but will not appear in the /model selector; the official recommendation is also to keep the placeholder value.
The meanings of each field other than apiKey are as follows:
| Field | Description |
|---|---|
| baseUrl | OpenAI Compatible API address, LM Studio is http://127.0.0.1:1234/v1, vLLM fill in according to the actual service address |
| api | Use the OpenAI compatible protocol, fixed as openai-completions |
| apiKey | Placeholder value, must be kept even for local services without authentication, 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 single output length (tokens) |
| models[].input | Supported input types |