Subscriptions
Several AI providers let you use Pi with a plan you already pay for, instead of paying per use through their API. Usage counts against the plan's limits.
Pi connects to a plan in one of two ways, depending on the provider:
- Sign in with your account: Pi opens a browser page, or shows a code to enter on the provider's site.
- Use an API key from the plan: you create a key for the plan on the provider's site and give it to Pi.
The table below shows which way each plan uses.
Sign in with your account
In Pi, run /login, choose Sign in with an account, then pick the subscription.
Pi opens a browser page, or shows a code to enter on the provider's site. After you sign in, Pi saves the credential in auth.json and renews it on its own while the provider allows it. Then pick a model with /model. The models of each subscription carry its provider ID as a tag, for example [openai-codex].
On a remote or headless machine, open the sign-in link on any machine with a browser. If the browser cannot reach Pi afterwards, paste the final URL from the browser's address bar (or the code it shows) into Pi.
To sign out, run /logout. This removes the credential from this machine only. It does not cancel access at the provider; use the provider's account settings for that.
Use the plan's API key
Create an API key for the plan on the provider's site. Some providers give plans their own keys, separate from pay-per-use keys; use the plan's key.
In Pi, run /login, choose Sign in with an API key, pick the plan, and paste the key. Pi saves it in auth.json.
Supported subscriptions
| Subscription | Provider ID | Connect with |
|---|---|---|
| ChatGPT plan | openai, openai-codex | Sign in |
| GitHub Copilot | github-copilot | Sign in |
| Kimi Code | kimi-coding | Sign in or API key |
| Meta Muse | meta | Sign in |
| SuperGrok or X Premium | xai | Sign in |
| OpenCode Go | opencode-go | API key |
| Z.AI GLM Coding Plan | zai, zai-coding-cn | API key |
| Qwen Token Plan | qwen-token-plan, qwen-token-plan-individual and their -cn variants | API key |
| Xiaomi MiMo Token Plan | xiaomi-token-plan-ams, xiaomi-token-plan-sgp, xiaomi-token-plan-cn | API key |
Each provider decides which plans include API use, which models you get, and how much. Check the provider's own terms.
ChatGPT plan
There are two ways to use a ChatGPT plan:
- Sign in with ChatGPT (
openai): run/login openaiand choose Sign in with ChatGPT. Pi uses the OpenAI API models on your ChatGPT plan. Works with the Go, Plus, Pro and Business plans. Decision models are not available with this sign-in. - Codex (
openai-codex): run/login openai-codexand choose Sign in with an account. Pi uses the Codex models through ChatGPT, the same service the Codex app uses, with your plan's Codex limits. See OpenAI's Using Codex with your ChatGPT plan.
ChatGPT Business workspaces have their own usage limits; when one is reached, ask the workspace admin to raise it.
GitHub Copilot
Run /login github-copilot. Pi asks for a GitHub Enterprise domain (leave it blank for github.com), then shows a code to enter on GitHub. The model list follows what your Copilot plan includes.
Kimi Code
Run /login kimi-coding and choose Sign in with Kimi Code. Pi shows a code to enter on kimi.com. Or use the API key from your Kimi Code membership: /login kimi-coding, Sign in with an API key, or set KIMI_API_KEY.
Meta Muse
Run /login meta and choose Sign in with Meta. Pi shows a code to enter on meta.com. Meta's sign-in cannot be renewed automatically: when it ends, Pi asks you to sign in again.
SuperGrok or X Premium
Run /login xai and choose Sign in with SuperGrok or X Premium. Pi shows a code to enter on x.ai.
OpenCode Go
Create a key on opencode.ai, then use /login opencode-go or set OPENCODE_API_KEY. The same variable also serves OpenCode Zen (opencode), which is pay-per-use, not a plan.
Z.AI GLM Coding Plan
Create a key for the GLM Coding Plan (not a pay-per-use key). Use zai with ZAI_API_KEY for the global service, or zai-coding-cn with ZAI_CODING_CN_API_KEY for the China service.
Qwen Token Plan
Token Plan comes in a Personal and a Team edition. Outside China it is sold on QwenCloud; in China, on Alibaba Cloud Model Studio. After subscribing, generate the plan's own API key on the Token Plan page (QwenCloud keys start with sk-sp-). Pay-per-use keys do not work. Pick the provider for your edition and where you bought the plan:
| Plan | Provider ID | Environment variable |
|---|---|---|
| Team | qwen-token-plan | QWEN_TOKEN_PLAN_TEAM_API_KEY |
| Team (China) | qwen-token-plan-cn | QWEN_TOKEN_PLAN_TEAM_CN_API_KEY |
| Personal | qwen-token-plan-individual | QWEN_TOKEN_PLAN_INDIVIDUAL_API_KEY |
| Personal (China) | qwen-token-plan-individual-cn | QWEN_TOKEN_PLAN_INDIVIDUAL_CN_API_KEY |
Xiaomi MiMo Token Plan
After subscribing, copy the plan's API key from the Token Plan page (it starts with tp-, or ttp- for team plans). Pay-per-use keys (sk-) do not work. The same page shows your plan's Base URL; pick the provider whose region matches it:
| Region | Provider ID | Environment variable |
|---|---|---|
Europe (token-plan-ams) | xiaomi-token-plan-ams | XIAOMI_TOKEN_PLAN_AMS_API_KEY |
Singapore (token-plan-sgp) | xiaomi-token-plan-sgp | XIAOMI_TOKEN_PLAN_SGP_API_KEY |
China (token-plan-cn) | xiaomi-token-plan-cn | XIAOMI_TOKEN_PLAN_CN_API_KEY |