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:

ProviderRequirementDescription
Claude Pro/MaxAnthropic SubscriptionAdditional usage is billed by token
ChatGPT Plus/Pro (Codex)OpenAI SubscriptionOfficially recognized by OpenAI
GitHub CopilotGitHub Copilot SubscriptionSupports enterprise servers
xAI (Grok)X Premium SubscriptionUses the Grok model
OpenRouterOpenRouter AccountOAuth creates an API Key
RadiusRadius AccountDynamic 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
ProviderEnvironment variableauth.json key
AnthropicANTHROPIC_API_KEYanthropic
Ant LingANT_LING_API_KEYant-ling
Azure OpenAI ResponsesAZURE_OPENAI_API_KEYazure-openai-responses
OpenAIOPENAI_API_KEYopenai
DeepSeekDEEPSEEK_API_KEYdeepseek
NVIDIA NIMNVIDIA_API_KEYnvidia
Google GeminiGEMINI_API_KEYgoogle
Amazon BedrockAWS_BEARER_TOKEN_BEDROCKamazon-bedrock
MistralMISTRAL_API_KEYmistral
GroqGROQ_API_KEYgroq
CerebrasCEREBRAS_API_KEYcerebras
Cloudflare AI GatewayCLOUDFLARE_API_KEY (also requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_GATEWAY_ID)cloudflare-ai-gateway
Cloudflare Workers AICLOUDFLARE_API_KEY (also requires CLOUDFLARE_ACCOUNT_ID)cloudflare-workers-ai
xAIXAI_API_KEYxai
OpenRouterOPENROUTER_API_KEYopenrouter
Vercel AI GatewayAI_GATEWAY_API_KEYvercel-ai-gateway
ZAI Coding PlanZAI_API_KEYzai
ZAI Coding Plan (China)ZAI_CODING_CN_API_KEYzai-coding-cn
OpenCode ZenOPENCODE_API_KEYopencode
OpenCode GoOPENCODE_API_KEYopencode-go
RadiusRADIUS_API_KEYradius
Hugging FaceHF_TOKENhuggingface
FireworksFIREWORKS_API_KEYfireworks
Together AITOGETHER_API_KEYtogether
BasetenBASETEN_API_KEYbaseten
Kimi For CodingKIMI_API_KEYkimi-coding
MiniMaxMINIMAX_API_KEYminimax
MiniMax (China)MINIMAX_CN_API_KEYminimax-cn
Qwen Token PlanQWEN_TOKEN_PLAN_API_KEYqwen-token-plan
Qwen Token Plan(Individual)QWEN_TOKEN_PLAN_API_KEYqwen-token-plan-individual
Qwen Token Plan (China)QWEN_TOKEN_PLAN_CN_API_KEYqwen-token-plan-cn
Xiaomi MiMoXIAOMI_API_KEYxiaomi
Xiaomi MiMo Token Plan (China)XIAOMI_TOKEN_PLAN_CN_API_KEYxiaomi-token-plan-cn
Xiaomi MiMo Token Plan (Amsterdam)XIAOMI_TOKEN_PLAN_AMS_API_KEYxiaomi-token-plan-ams
Xiaomi MiMo Token Plan (Singapore)XIAOMI_TOKEN_PLAN_SGP_API_KEYxiaomi-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.

ProviderDescriptionConfiguration method
llama.cppLocal open-source model inference/login llama.cpp, manage models through /llama
Custom APIExtensions developmentRegister 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:

BackendDefault portDescription
Ollama11434Out of the box, pull and run a model with a single command
LM Studio1234Provides a graphical interface, suitable for managing local models on the desktop
vLLM8000Aimed 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:

FieldDescription
baseUrlOpenAI Compatible API address; for LM Studio use http://127.0.0.1:1234/v1, for vLLM fill in the actual service address
apiUses the OpenAI-compatible protocol, always write openai-completions
apiKeyPlaceholder value; keep it even for local non-authenticated services, otherwise the model will not appear in /model
models[].idThe model ID used when calling, must match the name of the locally pulled model
models[].nameThe name displayed in the selector
models[].contextWindowContext window size (tokens)
models[].maxTokensMaximum output length per request (tokens)
models[].inputSupported input types
Other extensions