# Limits

> The limits on the Hollow model API: credit, optional spend caps, the request rate limit and the number of projects, and how each is enforced.

## Account limits

**Limits on the Seed plan**

| Limit | Seed | Where it applies | Enforced by |
| --- | --- | --- | --- |
| Credit | Your balance | The whole account | API |
| Spend cap (monthly), optional | None unless you set one | One project or one key | API |
| Requests per minute | 60 | Each key. A key can be set lower. | API |
| Projects | 25 | Active projects in the account; archived projects do not count | Platform |

## Credit is the limit on spend

Model calls are paid from your prepaid credit, so credit is the limit on spend. Every request is checked against your credit before it reaches a model. The check uses the worst case for the request: the input size plus the largest reply it allows, set by `max_tokens`. If you leave `max_tokens` out, the API assumes 4096. A request can therefore be refused a little before the credit is truly used up, and a smaller `max_tokens` leaves more room.

- A request the credit cannot cover is refused with HTTP 402 and the code `credit_exhausted`, described in [Errors and status codes](https://platform.projecthollow.com/docs/errors.md). Adding credit on [Billing](https://platform.projecthollow.com/billing/) clears it straight away.
- A spend cap is optional. A Project or a key with no cap is limited only by your credit.

## Requests per minute

A key can send up to 60 requests in a minute on the Seed plan. Above that the request is refused with HTTP 429 and the error type `rate_limit_error`. The reply carries a `Retry-After` header. A request that is refused for its rate is refused before any spend is reserved, so it costs nothing. Wait, then retry with backoff. Sending requests in bursts, such as parallel tool calls, is fine as long as you stay within the rate: a burst never suspends a key, only the requests above the rate are refused.

You can set a lower rate on one key, from 1 up to 60, in the key form or with **Edit request rate** in the key menu. Leave it empty and the key uses the account rate. A key's rate can never be higher than the account rate, and a higher value is refused with HTTP 400 and the code `KEY_RATE_ABOVE_ACCOUNT`. A key without a rate of its own behaves as it always has.

## Workflow runs

Workflows have their own limits, on top of the credit their agent steps spend. They apply however the run starts: from the console, over the API, from a schedule or from a webhook. [Run workflows over the API](https://platform.projecthollow.com/docs/workflow-api.md) and [Schedules and webhooks](https://platform.projecthollow.com/docs/workflow-triggers.md) describe how to start one.

**Limits on workflows**

| Limit | Value | What happens past it |
| --- | --- | --- |
| Run quota | Your plan's daily and monthly limit on workflow runs | The start is refused with HTTP 429 and the code `QUOTA_EXCEEDED`. |
| Starts from the API and webhooks | 60 a minute for each key or webhook (a key with a lower request rate starts fewer), and the project's requests per minute | HTTP 429 with the code `RATE_LIMITED` and a `Retry-After` header. |
| Run input and webhook body | 16 KB | The request is refused. |
| Time to wait for a result (`wait`) | 20 seconds | The call replies with HTTP 202 and the run carries on. |
| A step segment | 40 seconds. A single step can run for at most 38 seconds. | The step fails. A longer wait needs a delay or an approval step. |
| Schedules | 5 for each workflow, at least 5 minutes apart | Publishing is refused. |
| Workflow result | 16,000 characters | The result is not returned, and the reply says `resultTruncated: true`. |

## Limits for each project and key

Set these on the [Limits](https://platform.projecthollow.com/limits/) page and the key form. The model API enforces them on every request, before any model is called, so a refused request costs nothing. A key with the `platform:manage` scope can set or lower a project's spend cap but cannot raise or remove it (HTTP 403, `SPEND_CAP_NEEDS_SESSION`): change a cap upwards on the [Limits](https://platform.projecthollow.com/limits/) page while signed in.

**Project and key limits**

| Limit | What it does |
| --- | --- |
| Project monthly spend cap | An optional monthly cap for one project. With none set, the project is limited only by your credit. |
| Key monthly spend cap | An optional monthly cap for one key, so a single script cannot use the whole of a project's cap or credit. A key cap cannot be higher than the cap of its project when the project has one. |
| Alert thresholds | Three thresholds you choose. Crossing one sends a notice to the notification bell. |
| Key requests per minute | An optional rate for one key, from 1 up to the account rate, so a single script cannot use the whole of a project's rate. The lower of the key's rate and the project's rate applies. |
| Project requests per minute | A rate limit across all of a project's keys, at or below the account limit. |
| Model allow-list | The models a project may call. A request for another model is refused with HTTP 403 and the code `model_not_allowed`. |

## Set limits over the API

`PATCH /v1/platform/projects/{projectId}/limits` changes the limits of one project and needs the `platform:manage` scope. Send only the fields you want to change. Every spend amount in the API is in pounds.

**Fields of a project limits change**

| Field | Unit | What it does |
| --- | --- | --- |
| `monthlySpendLimitGbp` | Pounds, zero or more, or `null` | The project's monthly spend cap, for example `10` for ten pounds. `null` removes it. The same field is returned by `GET /v1/platform/projects`. |
| `requestsPerMinute` | Requests a minute, or `null` | The project's rate limit, at or below the account rate. |
| `alertThresholds` | Fractions of the cap, above 0 and below 1 or equal to 1 | When to send a notice to the notification bell. |
| `allowedModels` | Model ids, or `null` | The models the project may call. |

**Set a project cap in pounds**

**curl**

```bash
curl -X PATCH 'https://api.projecthollow.com/v1/platform/projects/PROJECT_ID/limits' \
  -H 'Authorization: Bearer YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "monthlySpendLimitGbp": 10, "requestsPerMinute": 30 }'
```

**Reply**

```json
{
  "projectId": "PROJECT_ID",
  "limits": {
    "monthlySpendLimitGbp": 10,
    "requestsPerMinute": 30,
    "alertThresholds": [
      0.5,
      0.8,
      1
    ],
    "allowedModels": null
  }
}
```

The old field `monthlySpendLimitUsd` is no longer accepted. A request that sends it is refused with HTTP 400 and a message that names `monthlySpendLimitGbp`, so a cap is never silently left unchanged. A field the API does not know is refused the same way.

A spend cap counts the UTC calendar month and starts again at midnight UTC on the first. A spend cap is not a rate limit: it stops spend at the cap for the rest of the month, and does not slow requests down. Nothing bounds a cap except the cap of the project above a key, because credit is the real limit. A Project request rate can never be higher than the account rate shown above. When more than one limit applies, the lowest one decides: a request must be within the account rate, the key's rate and the project's rate.
