# Plan and usage
Source: https://sovaria.in/docs/settings-plan-and-usage

Read every limit your plan includes, how much of each monthly allowance you have used, what the next plan adds, what happens at a limit, and how your app should handle it.

Project settings › **Plan & usage** lists everything your organization’s plan includes. Every number is enforced by the product that owns it — function limits by Functions, storage by Storage, sign-ins by Auth — and this page only reads them, including any limit support raised for your organization.

## Reading the table

| Part of a row | Meaning |
|---|---|
| Name | What is limited, e.g. “Function memory”. A **soft** tag means support can raise it without a plan change; **billed beyond** marks a monthly allowance that keeps working past the limit on paid plans. |
| Middle column | Your value. Monthly allowances show a bar and `used / allowed` — orange from 80%, red when full. |
| Right column | The next plan that raises it, e.g. `Ultra: 2 GB`. Empty means you already have the highest standard value. |
| Not included | The feature isn’t on your plan; the row shows the plan that unlocks it (`Ultra+`). |

## What happens when a request hits a limit

(Diagram: A request and the plan check)

Allowances that cost money to serve — function invocations and compute, realtime messages, storage and bandwidth, database disk, emails, push notifications and monthly active users — **stop on Free** and are **billed beyond** the allowance on paid plans, up to your spend cap. Counts such as tables, functions, environments and seats are ceilings on every plan.

|  | Free | Pro | Ultra | Team | Enterprise |
|---|---|---|---|---|---|
| Function invocations past the allowance | Hard stop | Billed beyond | Billed beyond | Billed beyond | Billed beyond |
| Storage past the allowance | Hard stop | Billed beyond | Billed beyond | Billed beyond | Billed beyond |
| Push notifications past the allowance | Hard stop | Billed beyond | Billed beyond | Billed beyond | Billed beyond |
| Default spend cap (× plan price) | — | 3 | 3 | 2 | — |

## After a downgrade

Moving to a smaller plan never deletes data at once. What is over the new plan's limits is held back, oldest first kept, until you remove something or upgrade again:

| Over the limit | What happens |
|---|---|
| Team members (`org.team_members`) | The owner and the longest-standing members keep access; the newest extra members are **on hold** (listed as "On hold · over plan", no access) until you remove a member or upgrade. Then they get access back on their own. |
| Projects (`db.active_databases`) | The newest extra projects are paused (their URL answers that the project is over the plan) and resume when the org is back within its plan. |
| Staging environments (`env.staging_environments`) | Paused at once. If the org is still over its plan **14 days** later, they are deleted (a backup of each database is kept for the plan's backup retention). |
| Custom domains (`net.custom_domains`) | The newest extra domains stop serving until the org is back within its plan. |

## Errors your app receives

| Code | When | What to show |
|---|---|---|
| `PLAN_LIMIT_REACHED` | A count or maximum is reached — cron schedules, tables, memory above the cap. | “This project has reached its limit for …” and, for admins, a link to upgrade. |
| `PLAN_QUOTA_EXHAUSTED` | A monthly allowance is used up on a plan that stops at it (Free). `resets_at` says when it comes back. | “Try again after …” |
| `PLAN_FEATURE_REQUIRED` | The feature isn’t on your plan. | Hide the feature, or show what unlocks it. |

Response:
```json
HTTP 403
{
  "detail": {
    "code": "PLAN_LIMIT_REACHED",
    "message": "Your Pro plan includes 25 cron schedules.",
    "limit_key": "fn.cron_jobs",
    "limit": 25,
    "used": 25,
    "plan": "pro",
    "required_plan": "ultra",
    "soft": false,
    "resets_at": null
  }
}
```

Handle it (JavaScript):
```ts
try {
  await sovaria.functions.invoke('send-report', { body })
} catch (err) {
  const detail = err?.response?.data?.detail
  if (detail?.code?.startsWith('PLAN_')) {
    showBanner(detail.message, detail.required_plan ? `Upgrade to ${detail.required_plan}` : undefined)
    return
  }
  throw err
}
```

## Limits next to the controls

Limited settings carry one quiet line under the control with your value, the next plan’s value and an **Upgrade** link — for example Functions › Memory & timeout, Settings › Pooling & timeouts, Realtime › Settings and a bucket’s details in Storage. Features your plan doesn’t include stay visible but disabled, with what unlocks them, so you always know what is possible.

## Usage from the CLI

CLI:
```bash
sov billing plan <org-id>           # plan and limits
sov billing usage <org-id>          # this period's counters
sov billing usage-history <org-id>  # earlier periods
sov billing overage <org-id>        # what is billed beyond the allowances
```

> **Note:** Allowances reset on your billing date, shown under the plan name — not on the 1st of the month. Every plan number is in [Plan limits](https://sovaria.in/docs/plan-limits).
