# Connect your AI plan

> Connect the AI plan that your troop runs on, and add, order or replace plans later in Settings.

Your troop thinks with the AI plan that your organization already pays for. Troopy signs the plan in on the cloud
computer of each workspace, and the sign-in stays there. This page lists the plans, tells how each one signs in,
and how to add, order or replace plans later.

## Before you begin

- Only owners and admins of the organization connect, order and remove AI plans. Every workspace of the organization
  uses the same plans.
- The cloud computer of the workspace must run. Setup starts it. See
  [Get started](/docs/get-started).

## The plans that your troop can run on

| Plan           | What you pay for | How it signs in                                                    |
| -------------- | ---------------- | ------------------------------------------------------------------ |
| ChatGPT        | Plus or Pro      | You approve a code on the site of ChatGPT.                         |
| Claude         | Pro or Max       | You sign in to Claude, then paste back the code that Claude shows. |
| Grok           | SuperGrok plan   | You approve a code on the site of xAI.                             |
| GitHub Copilot | Copilot plan     | You approve a code on GitHub.                                      |
| Gemini         | Pay as you go    | You paste a Gemini API key. Google bills each token.               |
| OpenRouter     | Any model        | You paste an OpenRouter API key. OpenRouter bills each token.      |
| Z.ai           | GLM coding plan  | You paste a Z.ai API key.                                          |
| Kimi           | Moonshot plan    | You paste a Kimi API key. Moonshot bills each token.               |
| MiniMax        | Coding plan      | You paste a MiniMax API key.                                       |
| Qwen           | Qwen Cloud       | You paste a Qwen Cloud API key. Alibaba Cloud bills each token.    |
| Anthropic API  | Pay as you go    | You paste an Anthropic API key. Anthropic bills each token.        |
| OpenAI API     | Pay as you go    | You paste an OpenAI API key. OpenAI bills each token.              |

Setup recommends ChatGPT. Teammates work on every plan of the table. A plan with **Soon** beside it cannot connect yet.

> [!TIP]
> A plan that you pay for each month costs the same however much the troop works, up to its own limits. A key that
> bills each token costs more when the troop works more. For such a key, Troopy shows the spend of each run, and
> each run stops at its spend cap.

## Connect a plan during setup

Setup asks for the plan at **Step 2 · Your AI**, and signs it in at **Step 8 · Connect**.

### ChatGPT

1. In ChatGPT, open **Settings** > **Security** and turn on device code sign-in for Codex.
2. In Troopy, the step shows a link and a code. Open the link and sign in to ChatGPT.
3. Type the code there. The step in Troopy shows **Waiting for you to approve**.
4. When ChatGPT approves the code, the step shows that the plan is connected.

### Claude

1. Select **Sign in to Claude**, sign in, and approve the access.
2. Copy the code that Claude shows.
3. Paste it into **Paste the code**, then select **Connect Claude**.

### Grok and GitHub Copilot

1. The step shows a link and a code. Open the link and sign in to xAI or to GitHub.
2. Type the code there. Troopy shows **Waiting for you to approve** until the site approves it.

### A plan with an API key

1. Make a key on the site of the provider.
2. Paste it into **Paste your key**, then select **Connect** with the name of the plan.
3. Troopy shows **Checking the key** while it checks the key with the provider.

A code or a link expires after some minutes. Select **Get a new code** or **Get a new link** to start again. The
sign-in stays on the computer of your troop, and Troopy never sees your password.

## Add, order or remove plans later

Open **Settings** > **AI** > **Models**.

1. **Add a plan**

   Select **Add a plan**, then pick the plan. Its card asks you to sign it in, as setup does.

2. **Choose the plan to run on**

   The card **What your troop runs on** names the model and the effort of the first plan. Pick a model of another
   plan in its menu to make that plan the first one.

3. **Choose what comes next**

   Under **When** the first plan **runs out**, list the plans to try next. When a plan is out of usage, teammates move
   down the list until it resets. Select **Add a plan to try next** to add one.

4. **Remove a plan**

   On the card of the plan, select **Disconnect**. Teammates that ran on it move to the next plan of the list.

The card of each plan shows its usage, when the provider gives it. Select the refresh button to read it again.

## When a sign-in lapses

A provider can end a sign-in, for example after a change of password. The card of the plan then shows
**Sign-in lapsed**, and Troopy emails the owners and admins one time.

1. On the card of the plan, select **Disconnect**.
2. Select **Add a plan**, and connect the same plan again.

Troopy never renews a sign-in by itself. Two renewals of one sign-in can sign the plan out.

## Problems

| What you see                                | Why                                       | What to do                                                        |
| ------------------------------------------- | ----------------------------------------- | ----------------------------------------------------------------- |
| Home says to connect the plan               | Setup skipped the sign-in.                | Select the button on Home, or open **Settings** > **AI**.         |
| **Waiting for you to approve** does not end | The code was not approved, or it expired. | Select **Get a new code** and approve it on the site of the plan. |
| ChatGPT refuses the code                    | Device code sign-in is off in ChatGPT.    | Turn it on in **Settings** > **Security** of ChatGPT.             |
| **Out of usage for now**                    | The plan reached its limit.               | Add a plan to try next, or wait until the plan resets.            |
| **Sign-in lapsed**                          | The provider ended the sign-in.           | Disconnect the plan, then connect it again.                       |
| **Pick a model for** the plan               | The provider lists no chat model.         | Pick a model on the card of the plan, in **Settings** > **AI**.   |

## Related

- [Choose AI plans and models](/docs/models)
- [Get started: from sign-up to your first task](/docs/get-started)
- [Fix a teammate that is stuck](/docs/stuck-teammate)
- [Limits and defaults](/docs/limits)
