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

# Spend cap exceeded

# `spend_cap_exceeded`

**HTTP status:** `402 Payment Required`

The workspace has hit its **daily AI spend cap** for the current UTC
day. The cap is plan-dependent and resets at 00:00 UTC.

```json theme={null}
{
  "error": {
    "code": "spend_cap_exceeded",
    "message": "Daily AI spend cap reached (498¢ of 500¢). Resets at 00:00 UTC.",
    "request_id": "req_01J9Z…",
    "docs_url": "https://docs.scripe.io/api/v1/errors#spend_cap_exceeded",
    "meta": {
      "bucketDate": "2026-05-26",
      "capCents": 500,
      "spentCents": 498,
      "estimateCents": 5
    }
  }
}
```

## Why we shipped a hard cap

Every AI-cost endpoint (post generation, KB ingest with summarisation,
source ingest from file) calls into a third-party provider whose pricing
the customer doesn't see directly. A runaway loop on the customer side
could rack up several hundred dollars before they notice. The hard cap
puts a clear ceiling on how much pain a misbehaving integration can
cause in a single day, scoped per workspace so it doesn't penalise
co-tenants.

## Per-plan caps

| Plan         | Daily cap     |
| ------------ | ------------- |
| `SOLO`       | \$5 (500¢)    |
| `ADVANCED`   | \$20 (2,000¢) |
| `BUSINESS`   | \$50 (5,000¢) |
| `ENTERPRISE` | unlimited     |

The cap is per UTC day; the bucket resets to 0¢ at 00:00 UTC.

## How to handle it

1. **Don't retry blindly.** A retry will hit the same cap. Either wait
   for the bucket to reset or pre-flight-check usage on your side.
2. **Surface the `meta` to your end users** so they understand they
   need to wait — or upgrade — before more AI work can be queued.
3. **Pre-allocate manually.** If you know you need to push 200 posts
   through tomorrow, work backwards from the cap and plan the cadence.
4. **Need more headroom?** Upgrade to `BUSINESS` (5,000¢/day) or talk
   to us about an `ENTERPRISE` plan with no cap.

## What we count

Each AI-cost job pre-reserves an estimate against the bucket at submit
time, then reconciles to the **provider-reported actual cost** on the
worker side. Negative deltas (we overestimated) are credited back to
the bucket within a few seconds of the job finishing. Failed jobs that
never reached a provider also get their estimate refunded.

You'll never get billed for the same cents twice.

## Related

* [Jobs](../jobs.md) — long-running operations.
* [Conventions](../conventions.md) — error envelope shape.
