> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenrows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Keys and Credit Caps

> Use multiple Zenrows API keys and set per-key credit caps (per billing period, daily, weekly, monthly) to limit how many credits each key can use.

Your account can have up to 10 API keys, for example one per project, environment, or customer. Each key can have its own credit caps, so one workload can't use up the credits another one needs. Manage keys and caps on the [API keys page](https://app.zenrows.com/settings/api-keys).

## Set or change a cap

1. Open the [API keys page](https://app.zenrows.com/settings/api-keys) (**Settings** > **API keys**).
2. Open the menu of the key you want to limit and select **Credit caps**.
3. Click **Add a cap**, choose the **Window**, enter the cap in credits, and click **Add cap**.

To change or remove a cap, open that cap's actions menu in the same window.

## How caps work

A key can have any of these caps, alone or combined:

| Cap | Window |
| - | - |
| **Per billing period** | Your current billing period |
| **Daily** | Calendar day, UTC |
| **Weekly** | Monday to Sunday, UTC |
| **Monthly** | Calendar month, UTC |

* Keys are **uncapped by default**, including your main key.
* A key with several caps stops when it reaches **any** of them.
* All credits a key uses count toward its caps, overage included.
* [Browser Sessions](/browser-sessions/introduction) (formerly, Scraping Browser) count too, both their time and their data.
* Caps limit usage. They don't reserve credits and don't need to add up to your plan.
* Upgrades, downgrades and top-ups don't change your caps.

## When a key reaches its cap

The key stops working, and your other keys keep working. How the refusal looks depends on the product:

* **Fetch (formerly, Universal Scraper API) and [Extract](/extract/introduction) requests** return HTTP `402` with error code [AUTH014](/api-error-codes#AUTH014).
* **Batch requests** return HTTP `402` with the code [`api_key_cap_reached`](/api-error-codes#api_key_cap_reached). See [Batch jobs](#batch-jobs).
* **New [Browser Sessions](/browser-sessions/introduction)** are refused when they start, with error code [AUTH014](/api-error-codes#AUTH014).

The key works again when its cap window resets, or shortly after you raise or remove the cap.

### When the cap is checked

A cap is checked when something **starts**: each API request, and each [Browser Session](/browser-sessions/introduction). If the key is still under its cap at that moment, the request or session goes ahead.

What's already running isn't cut off:

* A request in progress when the cap is reached completes.
* A Browser Session that's already open keeps running until it ends. Everything it uses still counts toward the cap, and the next session started with that key is refused.

So usage can go over the cap by what was already running. For normal traffic that's a small amount. [Batch](/batch/introduction) runs many tasks in parallel, so a Batch run can go further over before it stops. A single session that moves a very large amount of data can take a key well past its cap before the cap stops the next one, so size caps with your heaviest sessions in mind.

If the usage of a cap can't be read for a moment, that cap doesn't block the key until its usage is available again. Any other caps on the key still apply.

<Note>
  AUTH014 means one key reached its own cap. [AUTH004](/api-error-codes#AUTH004) means your account has no credits left, which affects every key.
</Note>

<Warning>
  A key cap doesn't guarantee zero overage charges. Your account can run out of included credits before a key reaches its cap.
</Warning>

## Batch jobs

[Batch](/batch/introduction) jobs use the caps of the key they run with. A capped key can't start or add to a job, a run that reaches a cap stops, and scheduled runs are checked when they start. See [API key credit caps and Batch](/batch/developer-guide-restapi#api-key-credit-caps-and-batch).

## Tracking remaining credits

Responses from a key that has at least one cap include the `X-Key-Credits-Remaining` header: the lowest remaining credits across that key's caps. Uncapped keys don't get this header. If the usage of a cap can't be read for a moment, the header leaves that cap out, and it isn't sent at all when none of the key's caps can be read.

```
X-Key-Credits-Remaining: 12500
```

Read it to slow down or switch keys before a cap stops your requests. See all [response headers](/fetch/api-reference#response-headers).

## Alerts

Your account's [notification recipients](/first-steps/manage-notifications#api-key-credit-caps) get an email and an in-app notification when a key reaches 80% and 100% of a cap. They also get an email when a cap is set, changed, or removed. Turn these alerts on or off with the **API key credit caps** notification setting.

## Residential Proxies (Legacy)

Key caps don't apply to Residential Proxies. Residential proxy credentials keep their own limits.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.