# Apertis Changelog: 2.2.145 — Feature Added

Canonical page: https://apertis.ai/changelog/2.2.145
Markdown mirror: https://apertis.ai/changelog/2.2.145.md
Version: 2.2.145
Title: Feature Added
Published: 2026-12-01
Category: feature

Each API key can now carry its own requests-per-minute cap and daily and weekly spend caps in US dollars, set from the key's settings.

## Details

Each API key can now carry its own requests-per-minute cap and its own daily and weekly spend caps. Give an agent or a CI job a key with its own ceiling: once it reaches a cap, its next request gets a 429 with `Retry-After`.

![A key capped at 2 requests per minute: the third call in the same minute is answered 429 with Retry-After](/changelog-media/2.2.145/key-rate-limits.jpg "demo:key-rate-limits")

## Where to set them

Open the key's settings in API Keys. The three caps sit in the key's Limits & routing section, beside its hourly spend limit. Leave a field empty for no limit.

| Field | What it caps | Resets |
| --- | --- | --- |
| Requests per minute | Requests the key may start in a minute | Each minute |
| Spend limit per day (USD) | What the key may spend in a UTC day | 00:00 UTC |
| Spend limit per week (USD) | What the key may spend in a UTC week | Monday 00:00 UTC |

Through the key API the same caps are `rpm_limit`, `spend_limit_quota_per_day` and `spend_limit_quota_per_week`; the two spend caps are in quota, where 1,000,000 quota is US$1, and 0 means no limit.

Each key keeps its own caps when you rename it, and a rotated key keeps the caps of the key it replaces.

![The key's settings read back with a requests-per-minute cap and a daily and weekly spend cap](/changelog-media/2.2.145/key-rate-limits-settings.jpg)

## What a client sees past a cap

The request is refused with HTTP 429, a `Retry-After` header in seconds, and one of two codes:

| Cap reached | Error code | Retry-After value |
| --- | --- | --- |
| Requests per minute | `api_key_rpm_limit_exceeded` | Seconds until the minute allows another request |
| Daily or weekly spend | `api_key_spend_limit_exceeded` | Seconds until 00:00 UTC, or Monday 00:00 UTC for the week |

```http
HTTP/2 429
retry-after: 59

{
  "error": {
    "code": "api_key_rpm_limit_exceeded",
    "message": "This API key has reached its limit of 2 requests per minute. Retry after 59 seconds, or raise the limit in the key's settings. (request id: 202612011113524323700023651559)",
    "type": "rate_limit_error"
  }
}
```

Wait the `Retry-After` seconds, or raise the cap in the key's settings. Every limit a key can carry, and each refusal it can get, is listed in [per-key limits](https://docs.apertis.ai/billing/per-key-limits) and [error codes](https://docs.apertis.ai/help/error-codes).
