Skip to documentation content

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

SubscriptionProvider IDConnect with
ChatGPT planopenai, openai-codexSign in
GitHub Copilotgithub-copilotSign in
Kimi Codekimi-codingSign in or API key
Meta MusemetaSign in
SuperGrok or X PremiumxaiSign in
OpenCode Goopencode-goAPI key
Z.AI GLM Coding Planzai, zai-coding-cnAPI key
Qwen Token Planqwen-token-plan, qwen-token-plan-individual and their -cn variantsAPI key
Xiaomi MiMo Token Planxiaomi-token-plan-ams, xiaomi-token-plan-sgp, xiaomi-token-plan-cnAPI 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 openai and 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-codex and 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:

PlanProvider IDEnvironment variable
Teamqwen-token-planQWEN_TOKEN_PLAN_TEAM_API_KEY
Team (China)qwen-token-plan-cnQWEN_TOKEN_PLAN_TEAM_CN_API_KEY
Personalqwen-token-plan-individualQWEN_TOKEN_PLAN_INDIVIDUAL_API_KEY
Personal (China)qwen-token-plan-individual-cnQWEN_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:

RegionProvider IDEnvironment variable
Europe (token-plan-ams)xiaomi-token-plan-amsXIAOMI_TOKEN_PLAN_AMS_API_KEY
Singapore (token-plan-sgp)xiaomi-token-plan-sgpXIAOMI_TOKEN_PLAN_SGP_API_KEY
China (token-plan-cn)xiaomi-token-plan-cnXIAOMI_TOKEN_PLAN_CN_API_KEY