# Plans & limits

> Plan quotas, what counts as usage, workspace retention, rate limiting, and the limit error codes.

Your account is on a plan that sets how much you can run. Limits are enforced on every
request; exceeding one returns a clear error (see [below](#limit-errors)).

## Plans

| Limit | Free | Pro | Builder | Team |
|-------|------|-----|---------|------|
| Price / month | $0 | $19 | $49 | $149 |
| Monthly active minutes | 500 | 10,000 | 25,000 | 60,000 |
| Concurrent sandboxes | 1 | 2 | 5 | 10 |
| Sandbox creations / day | 25 | 100 | 250 | 1,000 |
| Memory per sandbox | 1 GB | 2 GB | 4 GB | 8 GB |
| Max command timeout | 120 s | 600 s | 1,200 s | 1,800 s |
| Workspace storage per sandbox | 1 GB | 10 GB | 50 GB | 150 GB |
| Custom templates | 1 | 10 | 50 | 200 |
| Dockerfile builds / month | 3 | 25 | 100 | 400 |
| Concurrent builds | 1 | 1 | 2 | 5 |
| Max image size | 1 GB | 2 GB | 5 GB | 10 GB |
| Build timeout | 10 min | 15 min | 20 min | 30 min |
| Workspace retention | 3 days | 30 days | 90 days | 90 days |

Plans are fixed monthly subscriptions. Limits are hard stops: there are no automatic overages,
so you are never charged for going over. Upgrade for more headroom.

## Upgrading your plan

Upgrade yourself from the dashboard's **Billing** page. Pick a plan and you'll be sent to
Stripe's secure checkout; once payment succeeds your plan (and limits) update automatically.
Manage your payment method, download invoices, or cancel any time via **Manage billing**,
which opens the Stripe Customer Portal. Cancelling drops you back to the Free plan at the end
of the billing period.

> Billing is available when the platform operator has configured Stripe. On a self-hosted
> instance without Stripe keys, plans are applied by the operator instead.

## What counts as usage

- **Active minutes** = time spent executing commands in the current UTC calendar month. Idle
  but alive time is not (currently) metered.
- **Concurrent sandboxes** = sandboxes that currently exist and occupy a slot. A `stopped`
  sandbox does **not** count against concurrency; a `failed` one does until destroyed.
- **Sandbox creations / day** = a rolling-24h cap on how many sandboxes you can *create* (an
  anti-abuse guard, separate from concurrency). Resuming a stopped sandbox doesn't count.
- **Requested memory** above your plan ceiling is rejected with `memory_limit`; choose a
  smaller sandbox or upgrade.
- **Requested command timeout** above your plan ceiling is capped to the ceiling.

Check your current usage and limits any time:

```http
GET /v1/usage
```

Returns this month's usage alongside your plan's limits. The dashboard's **Usage** page shows
the same.

## Workspace retention

When you stop a sandbox, its workspace is archived so you can resume it later. Archives are kept
for your plan's **workspace retention** window, measured from when the workspace last did
anything (Free 3 days, Pro 30 days, Builder and Team 90 days). After that the archive is deleted
to reclaim storage and the sandbox can no longer be resumed or used as a `restore_from` source.
Resume a workspace before its window elapses, or upgrade for a longer one. Active sandboxes are
unaffected: retention only applies to stopped or destroyed workspaces.

## Rate limiting

API requests are rate limited per credential. Exceeding the limit returns `429` with a
`Retry-After` header - back off and retry. Loading the dashboard and opening previews are not
counted against your API budget.

## Limit errors

| Status | Code | Meaning | What to do |
|--------|------|---------|------------|
| `402` | `concurrency_limit` | Too many sandboxes at once | Stop/destroy one, or upgrade. |
| `402` | `memory_limit` | Requested sandbox memory is above your plan | Choose less memory, or upgrade. |
| `402` | `runtime_limit` | Out of monthly active minutes | Wait for reset, or upgrade. |
| `402` | `storage_limit` | Sandbox workspace over its cap | Free up files, or upgrade. |
| `402` | `quota_templates` | At your custom template limit | Delete one, or upgrade. |
| `402` | `quota_builds` | Too many builds in progress | Wait for one to finish, or upgrade. |
| `402` | `quota_builds_monthly` | Out of monthly Dockerfile builds | Wait for reset, or upgrade. |
| `402` | `daily_sandbox_limit` | Hit the daily sandbox-creation cap | Wait, or upgrade. |
| `403` | `account_suspended` | Account suspended for abuse | Contact support. |
| `429` | `rate_limited` | Too many requests | Honor `Retry-After`. |
| `503` | `capacity_unavailable` | The worker fleet is full right now | Retry after a sandbox stops, or upgrade/add capacity. |
| `503` | `server_busy` | The API is temporarily saturated | Retry after the `Retry-After` window. |

All errors share the shape `{ "error": { "code": "...", "message": "..." } }`.
