# Plans and billing

Every account starts on the Free plan. Paid plans include more and never stop serving: usage over the included
amounts is billed at Cloudflare's list price plus 10%. Prices are in US dollars.

## Plans

| | Free | Starter | Pro | Enterprise |
|---|---|---|---|---|
| Price / month | $0 | $5 | $20 | Contact us |
| Spaces (sites) | 3 | 10 | 50 | Custom |
| Storage | 1 GB | 10 GB | 100 GB | Custom |
| Requests / month | 1M | 10M | 50M | Custom |
| Storage reads / month | 1M | 10M | 50M | Custom |
| Storage writes / month | 100K | 1M | 5M | Custom |
| Largest installer | 100 MiB | 500 MiB | 2 GiB | Custom |
| Deploys / day | 20 | 100 | 500 | Custom |
| Over the included amounts | Sites pause, uploads are refused (see below) | Billed at overage prices | Billed at overage prices | Per contract |

Compare and upgrade at `https://app.heremyapp.com/billing`. Machine-readable: `GET https://api.heremyapp.com/v1/plans` (no token needed).
Enterprise limits are set per contract; the numbers `/v1/plans` returns for it (`"custom_limits": true`) are only
defaults before a contract.

## Usage over your plan

| Meter | Overage price | Cloudflare list price |
|---|---|---|
| Requests | $0.33 per million requests | $0.3 |
| Storage reads | $0.396 per million reads | $0.36 |
| Storage writes | $4.95 per million writes | $4.5 |
| Storage | $0.0165 per GB-month | $0.015 |
| Data transfer | Free | Free |

What each meter counts:

| Meter | Counted when |
|---|---|
| Requests | Every request to your site, its public URL redirect and its download URLs, including `304 Not Modified` |
| Storage reads | A file is read from storage to answer a request (not for `304` or `HEAD`) and when an upload is verified |
| Storage writes | A new file is stored by a deploy (files already stored by your account are not written again) and each installer upload or part |
| Storage | Site files (each distinct file once per account) plus installers; the billing period's daily average is the GB-months |

CPU time, database operations, API calls and data transfer are included in every plan.
A GB is 1,000,000,000 bytes.

## What happens at the limits

| Plan | Requests or reads over the included amount | Storage or writes over the included amount |
|---|---|---|
| Free | Sites and downloads pause (`503` with `Retry-After`) until the 1st of next month (UTC), or until you upgrade | Deploys and installer uploads fail with `402 quota_exceeded` |
| Starter, Pro | Keep serving; billed at the prices above | Keep working; billed at the prices above |
| Enterprise | Per contract | Per contract |

These limits apply on every plan and fail with `402 plan_limit`: the number of spaces and the largest installer.
Deploys per day are limited too (`429 deploy_limit`, resets at 00:00 UTC). Error `details` include `upgrade_url`.

To free storage, delete old deployments (`DELETE /v1/deployments/ID`), installer versions (`DELETE /v1/artifacts/ID`)
or whole spaces (`DELETE /v1/spaces/SLUG`). Deleting is permanent; do it only when the user agrees.

## Changing plans

- Upgrading takes effect as soon as the payment is confirmed, usually within seconds.
- After a downgrade, nothing is deleted: existing spaces, deployments and installers keep working. If the account has
  more spaces than the new plan allows, it cannot create new spaces until it is under the limit. Deleting a space frees
  its slot immediately. Larger installers already published stay online; new ones must fit the new plan.

## Checking usage

```bash
curl -sS --fail-with-body "$API/usage" -H "$AUTH"
```

The response has the current `period`, `usage`, the plan's `included` amounts, `overage.estimated_usd`, whether the
account is `paused`, and usage per space. Freshness differs by field:

| Field | Updated |
|---|---|
| `usage.storage_bytes_now`, `usage.spaces`, `usage.deploys_today` | Live |
| `usage.requests`, `usage.reads`, `usage.writes`, `spaces` (per space) | Hourly, per UTC day; a new deploy or visit may take up to an hour to appear |
| `usage.storage_gb` | Daily average of this period (GB-months), from hourly snapshots |

People can see the same numbers in the dashboard at `https://app.heremyapp.com`.

## Billing

- Payments are handled by Paddle, our merchant of record: Paddle charges the card, adds the sales tax or VAT that
  applies, and sends the receipts.
- A paid plan renews monthly from the day you subscribe. Usage over the plan in a billing period is added to the
  renewal payment at the end of that period.
- Switching between Starter and Pro takes effect immediately and is prorated.
- Downgrading to Free cancels the subscription at the end of the paid period. If usage charges are pending then, they
  are charged at that time (amounts under $1 are waived).
- Change the plan, the payment method or download invoices in the dashboard under Billing.
- Refunds: see `https://heremyapp.com/refunds`. Enterprise (custom limits, invoicing): support@heremyapp.com.

## For agents

- Do not upgrade, subscribe or enter payment details for the user. If a request fails with `402`, tell the user what
  limit was reached and give them `details.upgrade_url`.
- Before a large upload on the Free plan, check `GET /v1/usage` so the upload does not fail halfway.
