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

# Overage

> Keep customers working past their allowance and bill the extra on their next invoice, up to a monthly cap you set.

> **Pro:** 500 messages a month, then 1 cent a message. **Scale:** 5,000 credits a month, then $0.01 a credit, up to $20 a month.

Overage turns a customer's busiest month into revenue instead of a dead end. They keep working past their allowance: Ledger records the extra units, and Stripe bills them on the next renewal invoice (each month's own invoice on an annual plan), up to a monthly cap. Overage can be priced on a plan's credits, on a metered item, or both, at one rate or in [bands](https://docs.integrateledger.com/pricing/tiers.md#overage-tiers). A \$0 plan with overage and nothing included is [pay as you go](https://docs.integrateledger.com/pricing/pay-as-you-go.md).

## The catalog

**Credit overage** goes on the plan: `overageUnitAmountCents`, the price per `overageBillingUnits` credits (default 1), and optionally `overageCapCents`, a default monthly cap. **Metered overage** goes on the item: `overageUnitAmountCents` per `overageBillingUnits` units past `included`.

```ts ledger.config.ts theme={"system"}
import { defineCatalog, feature, plan } from "integrateledger-cli";

export default defineCatalog({
	features: [
		feature({ id: "messages", name: "Messages", type: "metered" }),
		feature({ id: "generate_image", name: "Generate an image", creditCost: 1 }),
	],
	plans: [
		plan({
			id: "pro",
			name: "Pro",
			monthlyCredits: 0,
			priceCents: 2900,
			items: [{ featureId: "messages", included: 500, overageUnitAmountCents: 1 }],
		}),
		plan({
			id: "scale",
			name: "Scale",
			monthlyCredits: 5000,
			priceCents: 5000,
			overageUnitAmountCents: 1,
			overageBillingUnits: 1,
			overageCapCents: 2000,
			items: [{ featureId: "messages", unlimited: true }],
		}),
	],
	creditPacks: [],
});
```

```json ledger.catalog.json theme={"system"}
{
  "schemaVersion": 1,
  "features": [
    { "id": "messages", "name": "Messages", "type": "metered" },
    { "id": "generate_image", "name": "Generate an image", "creditCost": 1 }
  ],
  "plans": [
    { "id": "pro", "name": "Pro", "monthlyCredits": 0, "priceCents": 2900,
      "items": [{ "featureId": "messages", "included": 500, "overageUnitAmountCents": 1 }] },
    { "id": "scale", "name": "Scale", "monthlyCredits": 5000, "priceCents": 5000,
      "overageUnitAmountCents": 1, "overageBillingUnits": 1, "overageCapCents": 2000,
      "items": [{ "featureId": "messages", "unlimited": true }] }
  ],
  "addOns": []
}
```

Your integration stays the same: the same `check` and `track` calls bill as overage once the allowance is spent.

## What check and track return

### Credits

Ledger spends grants in [spend order](https://docs.integrateledger.com/concepts/balances.md), then overage. A use that costs more than what's left spends the rest and records the remainder as overage. A Scale customer with 1,000 credits left who tracks a 2,500-credit use gets:

```json Response theme={"system"}
{
  "allowed": true,
  "availableCredits": 0,
  "chargedCredits": 2500,
  "overageCredits": 1500,
  "overageRemainingCents": 500,
  "request_id": "render_0003",
  "idempotent": false
}
```

`overageCredits` is this period's credit overage so far, and `overageRemainingCents` is what's left under the cap ($20.00 − $15.00). `availableCredits` never goes below 0.

### Metered

A Pro customer with 50 messages left who tracks `quantity: 170` spends the 50 and records 120 as overage:

```json Response theme={"system"}
{
  "allowed": true,
  "availableCredits": 0,
  "chargedCredits": 0,
  "overageCredits": 0,
  "overageRemainingCents": null,
  "request_id": "batch_0007",
  "idempotent": false,
  "featureType": "metered",
  "chargedQuantity": 170,
  "balance": { "included": 500, "used": 620, "remaining": 0, "overageAllowed": true, "resetsAt": "2026-12-23T09:14:00.000Z" }
}
```

`balance.used` counts the overage, `remaining` stays at 0, and `overageAllowed: true` says a use past `remaining` will be billed. `overageCredits` counts credits only, so it stays at 0. `overageRemainingCents` is `null` here because this customer has no cap.

`check` makes the same decision as `track`, so `allowed: true` can mean the use will be billed as overage.

## Which cap applies

| The plan has | The cap is | Notes |
| - | - | - |
| A credit overage price on the plan (with or without metered overage) | The customer's own cap; else their [override's](https://docs.integrateledger.com/customers/overrides.md) cap; else the plan's `overageCapCents` | All null: no cap. |
| Metered overage only (prices on items, none on the plan) | The customer's own cap | `overageCapCents` and override caps come with a plan-level credit overage price. |
| No overage | None | Uses stop at the allowance. |

A customer's own cap replaces the plan's, higher or lower, and `0` turns overage off for that customer. Set it, or a negotiated rate, in [Overrides](https://docs.integrateledger.com/customers/overrides.md).

## Prices below a cent

`overageUnitAmountCents` is whole cents, so price a sub-cent unit per batch with `overageBillingUnits`.

> **Docs API:** $49 a month for 1,000 pages, then $7.50 per 1,000 pages.

`pages` is a `metered` feature:

```ts ledger.config.ts theme={"system"}
plan({
	id: "docs_api",
	name: "Docs API",
	monthlyCredits: 0,
	priceCents: 4900,
	items: [
		{ featureId: "pages", included: 1000, overageUnitAmountCents: 750, overageBillingUnits: 1000 },
	],
}),
```

```json ledger.catalog.json theme={"system"}
{ "id": "docs_api", "name": "Docs API", "monthlyCredits": 0, "priceCents": 4900,
  "items": [{ "featureId": "pages", "included": 1000, "overageUnitAmountCents": 750, "overageBillingUnits": 1000 }] }
```

Rounding happens once per period, not per event. Ledger adds up the period's overage units for each rate, divides by `overageBillingUnits` and rounds up: `ceil(units ÷ overageBillingUnits) × overageUnitAmountCents`. A month with 2,400 pages of overage bills `ceil(2.4) × 750` = $22.50, however many tracks made up those pages. The cap uses the same sum, so the first page of overage already counts as $7.50 against it.

## Overage controls

Shape how overage runs for each balance, on a plan for everyone on it or for one customer or entity: turn it off, give a free buffer before billing starts, or record it without invoicing it. Each entry targets the shared credit pool (`creditPool: true`) or a metered feature.

```json ledger.catalog.json theme={"system"}
{ "id": "scale", "name": "Scale", "monthlyCredits": 5000, "priceCents": 5000,
  "overageUnitAmountCents": 1, "overageCapCents": 2000,
  "items": [{ "featureId": "messages", "included": 500, "overageUnitAmountCents": 1 }],
  "controls": {
    "overage": [
      { "creditPool": true, "freeUnits": 500 },
      { "featureId": "messages", "allowed": false }
    ]
  } }
```

| Field | What it does |
| - | - |
| `allowed: false` | A hard stop at the end of the balance, on a plan that prices overage. |
| `freeUnits` | Units past the balance each period (credits for the pool) that are recorded and never billed, spent before any priced overage. [Entities](https://docs.integrateledger.com/customers/entities.md) share the customer's buffer, and an entity's `capCredits` counts the free credits it takes. |
| `billOverage: false` | Priced overage is recorded under the cap and never invoiced: usage you track and show without charging for it. |

Give one customer or entity their own entries with [`POST /v1/customers/controls`](https://docs.integrateledger.com/customers/overrides#overage-controls), and read what applies, with each entry's `billed`, `unbilled` and `freeLeft` this period, from [`GET /v1/customers/controls`](https://docs.integrateledger.com/api-reference/customers/get-controls). Overage entries sit beside [usage limits](https://docs.integrateledger.com/pricing/usage-limits.md) and [usage alerts](https://docs.integrateledger.com/pricing/usage-alerts.md) in a plan's `controls`.

## How it's billed

Customers see the terms before they pay. Above Checkout's Subscribe button, Ledger adds what the plan includes and how overage bills, with the customer's own cap or rate when they have one: "Includes 1,000 credits each month. Unused credits don't roll over. After that, extra credits are billed on your next invoice at $0.50 per 10 credits, rounded up to the next 10, up to $20.00 a month."

Each renewal invoice gets one line per rate for the period that just ended, such as "Scale – overage, 1,500 credits", and one per metered feature and rate, such as "Pro – Messages overage, 120", under the item's own Stripe product. Tiered overage bills one line per band reached, such as "Scale – overage, 4,500 credits (units 1–4,000)" and "(units 4,001 and up)", and a band's flat fee on its own line. After a plan change, the old plan's overage bills at its own rate. On an [annual plan](https://docs.integrateledger.com/pricing/annual.md), each month's overage goes on an invoice of its own when the month ends, and the year's last month on the renewal invoice. When a subscription ends, Ledger bills any remaining overage, credit and metered, on a final invoice. [Invoices and Stripe](https://docs.integrateledger.com/concepts/invoices-and-stripe.md) shows the whole invoice.

The customer API's `overage` object counts both kinds: `costCents` and `remainingCents` cover credit and metered overage, `credits` counts credits only. In the dashboard, a customer in overage shows **In overage** and a meter against their cap.

## Usage at cost on a dollar balance

On a [dollar balance](https://docs.integrateledger.com/pricing/ai-credits.md), "usage at cost" is one cent per cent of usage: `overageUnitAmountCents: 1, overageBillingUnits: 1000` at 100,000 credits per dollar. Keep the unit at a cent: at `100` per `100000`, $2.35 of usage would count as $3.00. It works on the plan (the shared pool) or on an own-balance AI item, and the invoice line shows dollars: "Pro – overage, \$12.35". A model call past the cap is charged as far as it fits, and the rest is reported as `uncoveredCredits`.

## The rules

* **All or nothing.** A use past the allowance is recorded in full, part from the allowance and the rest as overage, or refused whole.
* **One cap per customer.** Credit and metered overage add up against one cap, in cents, for the customer's billing period, or for the month on an annual plan. The use that would pass it is refused whole with `409 overage_cap_reached`, whichever kind it is; one that lands exactly on it is allowed. `check` answers `allowed: false` with `reason: "overage_cap_reached"`. [Which cap applies](#which-cap-applies) says where it comes from.
* **What a period costs.** `ceil(units ÷ overageBillingUnits) × overageUnitAmountCents` for each rate, rounded once per period: 15 messages at 50 cents per 10 bill \$1.00. See [Prices below a cent](#prices-below-a-cent).
* **Overage runs while the plan is `active`**, and while a renewal is `past_due` on a plan or customer that [ignores past due](https://docs.integrateledger.com/billing/renewals-and-lifecycle.md#ignore-past-due). During a [trial](https://docs.integrateledger.com/pricing/trials.md), or while any other renewal is past due, a metered use past its allowance is refused with `limit_reached`, and a credit use with `insufficient_credits`.
* **Overage prices go on the plan (credits) or on metered items.** Held, boolean, credits and unlimited items take none. `overageBillingUnits` needs `overageUnitAmountCents`.
* **Tiers price the period's total.** With [overage tiers](https://docs.integrateledger.com/pricing/tiers.md#overage-tiers), the period's overage units are priced in bands, graduated or volume, instead of at one rate. The cap counts the period's cost at those band prices, so a use is refused at the rate it would really be billed at. A customer's negotiated rate replaces the tiers with its one rate.
* **Annual plans that reset monthly bill each month's overage** on its own invoice when the month ends. An annual plan with overage resets monthly (`resetInterval: "year"` returns `annual_overage_not_supported`), and a [lifetime plan](https://docs.integrateledger.com/pricing/lifetime.md) bills only up front (`one_off_plan_cannot_bill_later`).
* **A change is a new version.** Adding or changing overage publishes a new [plan version](https://docs.integrateledger.com/billing/plan-versions.md): customers already on the plan keep their current terms.
* **Overage entries are money terms.** Changing a plan's `controls.overage` publishes a new plan version too. An entry targets the pool or a metered feature, once each, and `allowed: true` without an overage price needs `freeUnits`. Publishing checks these, and `POST /v1/customers/controls` answers `400 invalid_overage_control`.

## Related

* [Tiered pricing](https://docs.integrateledger.com/pricing/tiers.md#overage-tiers): overage priced in bands of the period's total.
* [Pay as you go](https://docs.integrateledger.com/pricing/pay-as-you-go.md): overage with nothing included.
* [AI usage in dollars](https://docs.integrateledger.com/pricing/ai-credits.md): model calls billed at cost past an included dollar amount.
* [Overrides](https://docs.integrateledger.com/customers/overrides.md): one customer's cap or rate.
* [Credit packs](https://docs.integrateledger.com/pricing/credit-packs.md): prepaid credits instead of billing later.
* [Metered allowances](https://docs.integrateledger.com/pricing/metered.md) and [Credits](https://docs.integrateledger.com/pricing/credits.md): the allowances overage starts after.


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