# Credits and limits

You pay in credits, one screenshot at a time. A failed screenshot is not charged.

## What a screenshot costs

| What you ask for | Credits |
| --- | --- |
| A screenshot | 1 |
| A screenshot from a chosen country | 2 |

Every other option is included: device, full page, format, cleaning up the page.

- The credits are reserved when the screenshot starts and charged when it succeeds.
- A page that answers an error of its own, such as 404 or 451, is still a screenshot: it is captured and charged.
- Asking again with the same `Idempotency-Key` returns the same screenshot and is not charged twice. See [Retries and Idempotency-Key](https://docs.localscreenshot.com/retries).

## Where credits come from

- **Signup credits.** 50 credits when you create your account. They do not expire.
- **A monthly plan.** A number of credits each month. What is left at the end of the paid month does not carry over.
- **Packs.** Bought once. They do not expire.

The credits that expire first are used first.

## See what is left

`GET` `/v1/credits`

**Your credits**

```bash
curl "https://api.localscreenshot.com/v1/credits" \
  -H "Authorization: Bearer $LOCALSCREENSHOT_API_KEY"
```

**200**

```json
{
  "credits": { "remaining": 49 },
  "costs": { "base": 1, "surcharges": { "country": 1 } },
  "limits": { "requests_per_minute": 10, "concurrent_screenshots": 2 }
}
```

With the image, two headers say the same thing: `X-Credits-Charged` and `X-Credits-Remaining`. When you run out, a request fails with `insufficient_credits` and status 402.

## Limits

Limits apply to the account. Several API keys share them.

| Limit | On free credits | After a first payment |
| --- | --- | --- |
| Requests per minute | 10 | 120 |
| Screenshots running at once | 2 | 20 |
| Failed screenshots per day | 15 | 300 |

- Over the number of requests per minute: `rate_limited`, with a `Retry-After` header.
- Too many screenshots running at once: `concurrency_limit`.
- Too many failed screenshots in a day: `failure_budget_exceeded`.

## Limits that protect websites

A single website does not get more than 4 screenshots at once, nor more than 30 a minute, from all our users together. Past that, a request fails with `domain_busy`: try again a minute later.

## Limits of one screenshot

| Limit | Value |
| --- | --- |
| Time for a page to load | 35 seconds |
| Weight of a page | 10 MB |
| How long a request waits before answering `202` | 50 seconds |
| How long an image is kept | 7 days |
| How long a link to an image works | 15 minutes |
