# Pricing

> $0.50 per camera-hour, up to 10 watches per camera, exact camera-minutes, 10 free minutes first, credits, a monthly spend cap, and how to read them from the API.

Percia charges for camera time, not for watches or alerts. Paid plans are on sale since 2026-11-14 (`GET /api/plan` says `selling: true`): every account has 10 free camera-minutes every month (UTC), then $0.50 per camera-hour billed by the minute, before tax. Billing is enforced since 2026-11-15 (`billingEnforced: true`); if the operator ever switches it off, nothing is paused or refused.

## The price

- **$0.50 per camera-hour.** A camera counts while at least one of your watches on it is active and the camera sends video. One watch or ten watches on the same camera cost the same.
- **Hours without video are free.** A watch whose camera stopped sending video does not count, and it pauses itself after an hour.
- **Billed by the exact minute.** Percia counts the minutes a camera was watched, to the second, and carries the remainder to the next count. Nothing is rounded up to a block.
- **10 free minutes first, every month.** Every account gets 10 free camera-minutes each calendar month (UTC), with no card; unused minutes do not roll over and the next 10 arrive on the 1st (`freeMinutesResetsAt` in `GET /api/plan`). `freeMinutesLeft` says what is left.
- **A one-time bonus for adding a card.** When `bonusAvailable` is true in `GET /api/plan`, adding payment details also grants `bonusMinutes` (50) more free minutes, once per card and once per account; they never expire and are used after the monthly 10. Adding a card charges nothing. `hasCard` and `bonusMinutesLeft` show the state.
- **Credits.** Minutes from a redeemed code or a grant are used after the free minutes of the month, then the card. `creditMinutes` in `GET /api/plan` is the balance; credit minutes are not charged and do not count toward the spend cap.
- **Then a card.** After the free minutes and credits, add a card on the Billing page (Stripe Checkout). Nothing is charged up front; Stripe invoices each month for the camera time used, as "Percia camera time".
- **Monthly spend cap.** Each account has a cap, $200 by default. When this month's camera time reaches it, your watches pause and you get an email. Raise the cap and resume the watches the same day.

A camera is one source address of one account, compared after trimming spaces and ignoring the case of the scheme and host: `rtsp://Cam.example.com/live` and `rtsp://cam.example.com/live` are one camera. A phone camera is one camera however its address is written.

Camera time is counted in exact camera-minutes, in whole minutes (the seconds below a minute carry over). Ten watches on one camera count once. The count is collected about every 15 minutes (internal; that is a collection cadence, not a billing unit). The month is the UTC calendar month.

## Limits

- **10 active watches per camera**, always. An 11th (create, resume, or moving a watch to that camera) answers `429 plan_limit` with `limit: "watchesPerStream"` and `max: 10`. Pause or delete one on that camera, or put several goals into one [agent](/docs/agents.md) as concerns.
- **Judging budget.** The watches of one camera share about 600 judge calls an hour: each gets `max(60, 600 / N)` calls an hour, N being the active watches on that camera. You do not set this.
- While `billingEnforced` is `true` in `GET /api/plan` (since 2026-11-15), creating or resuming a watch answers `429 plan_limit` with `limit: "billing"` while the free minutes and credits are used and there is no card, or while the cap is reached. The message says what to do. When `billingEnforced` is `false` nothing is paused or refused for billing.

## From the API

| Call | What you get |
|---|---|
| `GET /api/plan` (`watches:read`) | `label` ("Free" or "Pay as you go"), `pricing: {centsPerCameraHour, watchesPerStream}`, `freeMinutes`, `freeMinutesLeft`, `creditMinutes`, `creditExpiresAt`, `monthToDate: {cameraMinutes, cents}`, `capCents`, `billingEnforced` |
| `GET /api/usage?days=30` (`watches:read`) | `cameraMinutes` per UTC day, beside the other usage counts |
| `GET /api/usage/cameras` (`watches:read`) | This UTC month per camera: `{month, centsPerCameraHour, totalMinutes, totalCostCents, unattributedMinutes, cameras: [{id, name, kind, minutes, costCents}]}`. A phone camera shows its name, a video link only its host. `costCents` is list price, not what was charged (free and credit minutes come first, see `GET /api/plan`). Counted from 2026-11-14: earlier minutes are `unattributedMinutes` |
| `POST /api/billing/redeem {code}` (`watches:write`) | Redeems a credit code. Needs a card on file: without one it answers `402 card_required` with `addCardUrl` (the Billing page; only a person can add a card) and the code is not used, so show the link and redeem again afterwards. The one-time card bonus and the code's minutes both apply, each once. Answers `{grantedMinutes, expiresAt, creditMinutes, freeMinutesLeft}`. Unknown, disabled, expired and used-up codes are all `404 code_invalid`; redeeming a code twice is `409 code_already_redeemed`; too many tries is `429 rate_limited` with `Retry-After`. Send the code in the body only, never in a URL |
| `GET /api/billing/credits` (`watches:read`) | Your credit grants (`minutes`, `remaining`, `source`, `expiresAt`) and your last 20 redemptions. Never a code |
| `PATCH /api/billing/cap {capCents}` (`watches:write`) | Sets the monthly cap in cents, 500 ($5) to 1000000 ($10,000). Answers `{capCents}`; anything else is `400 invalid_request` with `field: capCents` |

Adding a card (`POST /api/billing/checkout`) and the Stripe portal (`POST /api/billing/portal`) are for people only: an API key or an agent cannot call them. An agent that sees `limit: "billing"` should tell the person to open the Billing page. Change the cap only when the person asks for it.

Paused watches carry `pausedReason`: `needs_billing` (free minutes and credits used, no card), `spend_cap` (cap reached) or `payment_failed` (a payment failed and the grace is over), beside `user` and `no_video`.

**Failed payments** (only while billing is enforced). When Stripe cannot charge the card, the account has 48 hours of grace: everything keeps working, and `GET /api/plan` returns `payment: {state: "grace", graceEndsAt, ...}` (`state` is `active` for a healthy account). After 48 hours unpaid, `state` is `blocked`: watches are paused with `pausedReason: "payment_failed"` and every write answers `402 payment_required` (`paymentState: "blocked"`, `billingUrl`), except fixing the payment (`POST /api/billing/portal`, `POST /api/billing/pay-invoice`), the Billing routes, signing out, deleting the account and deleting a watch. Reads (watches, events, evidence, billing, usage) always work. When the payment succeeds the account unblocks by itself and only the watches paused for `payment_failed` resume. `whoami` always carries a `billing` block (free and credit minutes, `canStartWatches`, `howCharged`, `billingUrl`, `paymentState`), with a `note` while the state is `grace` or `blocked`. Tell the person to update their payment method on the Billing page; an agent cannot do it and must not retry a 402. Accounts that only use credits or free minutes, with no subscription, are never affected. [Spec](/docs/specs/billing/payment-grace.md)
