# Plans and billing

> See your plan and usage, change plans, and get unblocked when a generation hits a plan limit.

A **plan** sets a workspace's limits, such as how many CLIs, successful generations, members, and testers it can have. Plans and prices are on the [pricing page](https://okibi.ai/#pricing).

## How plans apply to workspaces

- Your personal workspace starts on the **Free** plan.
- Creating another workspace needs the **Pro** plan. A workspace you create bills against your personal workspace's plan, so they share one set of limits.
- A workspace you were invited to uses its owner's plan.

Only owners and admins can see or change billing. Builders see the plan's name and are asked to contact an owner or admin.

## See your plan and usage

**In the app**

Open **Settings** > **Plan**. The **Plan** row names the current plan. Below it, each limit shows what you have used out of what your plan allows, and **Builds** shows when generations reset.

**In the CLI**

```sh
okibi billing status --workspace acme
okibi billing plans
```
`status` shows the current plan, any scheduled change, and what is left of each limit. `plans` lists the plans and their prices.

## Change your plan

**In the app**

1. Open **Settings** > **Plan** and click **Compare plans**.
2. On the Pro card, choose **Monthly** or **Annual**.
3. Click **Upgrade to Pro**. To go back, click **Downgrade to Free** and confirm.

**In the CLI**

```sh
okibi billing change pro --interval monthly --yes --workspace acme
```
`pro` is the Pro plan and `free` is Free. `--yes` confirms the change and any charge. The interval defaults to `annual`.

If a payment is needed, a checkout page opens in your browser. From okibi, run `okibi billing status` after you finish to check the result.

- An upgrade can charge your payment method right away.
- A downgrade can be scheduled for the end of the billing period. The **Plan** row shows the scheduled change.
- Downgrading deletes nothing. While you are over the Free limits, new CLIs and new generations are blocked. Existing public releases stay live.
- For **Enterprise**, click **Contact us**. It isn't available from okibi.

## Invoices and payment methods

In **Settings** > **Plan**, click **Manage billing** next to **Payment**, or run:

```sh
okibi billing portal --workspace acme
```

The billing portal is where you update payment methods, see invoices, and change subscription details. Changing the plan and opening the portal need a login key, not a [workspace-locked key](https://okibi.ai/docs/guides/api-keys.md).

## When a limit blocks a generation

- In the app, the CLI's page shows **Plan limit reached** and an **Upgrade your plan** link.
- In okibi, the command fails with a `plan limit reached` error.

Only successful generations count. A build that fails or is canceled gives its generation back.

In the app, v1 from an OpenAPI spec is free, and its suggestions count as 1 generation. When an agent writes the spec from docs or code, writing it and that build's suggestions count as 1 generation together. A rebuild whose docs or code haven't changed reuses the spec it wrote and doesn't count it again. Suggestions count only when an agent did the work: a rebuild where nothing needs improving, or one that only offers suggestions you already have, doesn't count. Carrying your own hand edits over to new code never counts.

To keep going, upgrade the plan or wait for generations to reset. The reset date is in **Settings** > **Plan**.

Other limits block different actions:

| Limit | What it blocks |
| --- | --- |
| CLIs | Creating a new CLI |
| Builders and admins, internal testers | Invites and role changes over the limit |
| Org workspaces | Creating another workspace |
| Public install links, publishing source to GitHub | Pro features, blocked on Free |

- [Workspace and members](https://okibi.ai/docs/guides/workspaces.md): Roles, invites, and who can manage billing.
- [Troubleshooting](https://okibi.ai/docs/troubleshooting.md): Fixes for common errors.
