> ## 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.

# Pay as you go

> Let customers start with no monthly fee and pay only for what they use, billed on their next invoice, for credits or a metered feature.

> **Pay as you go:** no monthly fee, 5 cents an image, billed at the end of the month.

Pay as you go removes the commitment from signing up: customers start with no monthly fee, use as much as they need, and pay for exactly that at the end of the month. It's a $0 plan with an [overage](https://docs.integrateledger.com/pricing/overage.md) price and nothing included. The customer adds a card, gets a Stripe subscription at a $0 monthly price, and each renewal invoice bills what they used that month.

## The catalog

**A metered feature:** an item with `included: 0` and an overage price. The first image is already billable.

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

export default defineCatalog({
	features: [feature({ id: "images", name: "Images", type: "metered" })],
	plans: [
		plan({
			id: "payg",
			name: "Pay as you go",
			monthlyCredits: 0,
			priceCents: 0,
			items: [{ featureId: "images", included: 0, overageUnitAmountCents: 5 }],
		}),
	],
	creditPacks: [],
});
```

```json ledger.catalog.json theme={"system"}
{
  "schemaVersion": 1,
  "features": [{ "id": "images", "name": "Images", "type": "metered" }],
  "plans": [
    { "id": "payg", "name": "Pay as you go", "monthlyCredits": 0, "priceCents": 0,
      "items": [{ "featureId": "images", "included": 0, "overageUnitAmountCents": 5 }] }
  ],
  "addOns": []
}
```

**Credits:** `monthlyCredits: 0` with a credit overage price on the plan. Every use's credits are overage, and the plan can carry a default cap:

```ts ledger.config.ts theme={"system"}
plan({
	id: "payg",
	name: "Pay as you go",
	monthlyCredits: 0,
	priceCents: 0,
	overageUnitAmountCents: 2,
	overageCapCents: 5000,
}),
```

```json ledger.catalog.json theme={"system"}
{ "id": "payg", "name": "Pay as you go", "monthlyCredits": 0, "priceCents": 0,
  "overageUnitAmountCents": 2, "overageCapCents": 5000 }
```

## What check and track return

`check` on images answers `allowed: true` before any use, with `balance.overageAllowed: true`:

```json Response theme={"system"}
{
  "allowed": true,
  "availableCredits": 0,
  "creditCost": 0,
  "featureType": "metered",
  "unlimited": false,
  "balance": { "included": 0, "used": 11, "remaining": 0, "overageAllowed": true, "resetsAt": "2026-12-23T09:14:00.000Z" }
}
```

Each `track` adds to `balance.used`, and the renewal bills "Pay as you go – Images overage, 12" at 5 cents an image. On the credits plan, `track` answers `availableCredits: 0` with the use's credits in `overageCredits`, and a month of 40 credits bills "Pay as you go – overage, 40 credits", \$0.80.

## Rules

* **Attach collects a card.** Attach works as for a paid plan. With a saved card, Ledger creates the $0 subscription at once. Without one, attach returns a Checkout URL, and Checkout collects the card for a $0 total. [Checkout and attach](https://docs.integrateledger.com/billing/checkout-and-attach.md) has the flow.
* **Attach it on signup** if every customer should be able to start. [Customers without a plan](https://docs.integrateledger.com/concepts/balances.md#customers-without-a-plan) has what a customer can use before any plan.
* **Caps.** [Which cap applies](https://docs.integrateledger.com/pricing/overage.md#which-cap-applies) has the plan's cap, the customer's, and metered-only plans.
* \*\*Empty months bill $0.** A month without usage renews at $0 and bills nothing else.
* **Billing periods.** [Overage](https://docs.integrateledger.com/pricing/overage.md#the-rules) has how overage bills on monthly and annual plans.
* **Stripe objects.** Catalog sync gives the plan a Stripe product and a \$0 monthly price, and each priced item its own "Pay as you go – Images overage" product for its invoice lines.

## Related

* [Overage](https://docs.integrateledger.com/pricing/overage.md): every overage rule, the cap, and the invoice lines.
* [Metered allowances](https://docs.integrateledger.com/pricing/metered.md): include some units before billing.
* [Credit packs](https://docs.integrateledger.com/pricing/credit-packs.md): prepaid credits instead.


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