# Contracts and rules in Limitr Cloud

> Put negotiated terms in place without a plan per deal: rules in your policy say what changes (limits, features, caps, rates), and contracts say who has them and when, for one customer, an org and its users, or a segment, with ramps and an end date.

# Contracts

A customer signs a deal: 5M AI tokens a month instead of 2M, audit logs, a not-to-exceed amount, 20% off tokens, for
a year. You don't need a plan for that deal. In Limitr Cloud it's two parts:

- **A rule** says what changes. It lives in your policy (**Policy**, **Rules** tab), so it's drafted, reviewed,
  published, and versioned like everything else there.
- **A contract** says who has which rules, and when. It lives on the **Contracts** page, with the terms as agreed and
  the file they came from.

A rule doesn't need a contract: for a group, a rule can name [segments](./segments) (Ex. a [coupon](./coupons)),
and one customer can be given a rule on their page. A contract is for a deal: its term, phases, fees, and files.

## How it fits together

Three places, each with one job:

| | Holds | Where |
|---|---|---|
| **The contract** | What was agreed: who it's with, the term and its phases, the rules in force, the fees, a commitment, credit packs, the value, and the files. | **Contracts** |
| **The account** | Who pays and how: the payer, card or a Stripe invoice or outside Limitr, the days to pay, and the billing periods. Its group invoice each period is the bill. | **Customers**, **Accounts** |
| **The policy** | What a rule changes. | **Policy** |

So a contract's **rules** apply to the customers it reaches, and its **fees** and **commitment** bill each
[account](./customers#accounts) it reaches, on that account's group invoice, collected the account's way. A
contract's **value** is the record of what it's worth: nothing bills from it, and the contract checks that its fees
and commitment come to it. **How this bills**, at the top of each contract, says all of it in plain lines, with
links.

A typical enterprise deal: a rule (the negotiated limits and rates), an account above the customer that pays by
Stripe invoice, net 30, and the contract with the customer and its users, the rule, a yearly platform fee, and maybe
a minimum. The Analyst sets all of it up from the order form, on one card.

One rule can serve many contracts (a startup program for a segment), and one contract can move through several rules
over its term (a ramp). Contracts and rules are on [Scale and Enterprise](./plans-and-billing).

Contracts are there when you need them: customers, plans, and [accounts](./customers#accounts) work without them,
and a contract only needs who it's with, the terms, and a rule or a fee. Fees, commitments, packs, and renewals are
each optional.

## What a rule can change

A rule holds the same changes you can make to one customer, written once:

| The contract says | In the rule |
|---|---|
| Included usage, quotas, seats | **Limits**: a limit in place of the plan's, hard, soft (overage is billed), or watch only. |
| Features, add-ons, early access | **Gives**: an entitlement their plan doesn't have, as another plan defines it. |
| Something they don't get | **Takes**: an entitlement their plan has, turned off. |
| A not-to-exceed amount, a spend cap | **Caps**: a ceiling on a credit (Ex. runes), that stops calls or only alerts. |
| Negotiated rates, discounts | **Prices**: a new price, or a percent or flat change on the list price, on Cloud's invoices. |

Your engines apply the limits, gives, takes, and caps on every call (engine 0.8 and later). Prices stay in Limitr Cloud,
which applies them when it invoices; your engines never see them.

A rule can't invent an entitlement: a give always uses a plan's definition. Terms Limitr doesn't enforce (renewal,
SLAs, termination) go in the contract's record, so they're written down next to what is enforced.

## What a customer gets

For each entitlement, the order is always:

1. **Their own change** (an override, give, take, or custom price you set on the customer).
2. **Their rules**, highest priority first.
3. **Their plan.**

When two of a customer's rules set the same thing, the higher priority wins. Two at the same priority can't on
contracts: saving one that would do that is refused, so you never have to guess which one applies. Give one a
higher priority. (Between rules from segments and their own, the one written first in the policy wins a tie.)

On a customer's page, tags show where each entitlement and limit comes from: **given by acme_2027**, **limit from
acme_2027**, or **via acme** for one a user gets from its org. The **Rules** panel lists every rule they have and where
it comes from, and the **Contracts** panel the contracts that reach them.

## Making a contract

The quickest way is the [Analyst](./agent#contracts). Attach the contract and say who it's with ("put Acme's 2027
order form in place"). It reads the terms, writes the rules into your draft, checks them, and proposes one card:
publish the draft, then save the contract. Nothing changes until you apply it.

You can also do it yourself: write the rule on the **Rules** tab (**New rule**) and publish it, then **New contract**
on the Contracts page: its name, who it's with, its phases (a start date and the rules from then), the end, how it
renews, its value, its fees, the terms as agreed, how they map onto Limitr, and its files. The same checks apply as for the
Analyst's. Saving, ending, and deleting contracts needs the **Change customers** permission. Changing rules is
editing the policy, so publishing them needs **Publish test policies** or **Publish live policies**.

## Who a contract reaches

- **Customers by ID.** Up to 200.
- **An org and its users.** A customer and everyone whose refs lead to it (its teams, their users). Gives and takes
  reach users on their org's plan anyway, but a limit is each customer's own: for each user's own limit, include the
  users.
- **An account.** Everyone in an [account](./customers#accounts): its top-level customers and everyone whose refs
  lead to them.
- **A segment.** Every customer a [segment](./segments) matches, Ex. a startup program. Limitr Cloud works it out
  again when a customer's plan, type, refs, or metadata change, when the segment changes, and once a day.

A contract's customers get its rules within seconds of saving it, and lose them when it ends.

## Phases and the end

A contract has one or more **phases**, each a start date and the rules from then, and an optional **end**. A ramp
is two phases: months 1 to 6 on one rule, then another. Limitr Cloud switches phases on time (within the hour) and
takes the rules off at the end.

Usage is priced at the rules in force when it was recorded. When a phase starts, or a contract starts or ends, in
the middle of a billing period, the invoice prices the usage before the change at the old rules and the rest at the
new ones, and shows each part on the invoice line. Tiers carry on across the change: a customer 400 units into a
tier when a phase starts is still 400 units in.

A phase can also grant **credit packs** when it starts (Ex. 1M bonus tokens at the start of each year): a plan's
topups, free, once per phase. They go to each account the contract reaches (its top-level customer), or, if you
choose, to each customer it reaches.

A contract can be a **draft** while it's being agreed: it's saved, but its rules don't apply until it's active.

## Renewals

A contract with an end can **renew**. Under **Renewal** on the contract:

- **Ends at its end** (the default): its rules come off at the end.
- **Renews by itself:** at the end, it renews for another term, unless it's ended first.
- **Renewed by hand:** at the end, **Renew** on the contract starts the next term, or you let it end.

Each new term is as long as **Each new term** says (the first term's length by default, Ex. 12 months). **Notice**
is how long before the end either side has to say it won't renew (30 days by default). A renewal keeps the same
contract: its earlier terms are listed on it with their dates and value, its rules in force carry on, its fees keep
billing each cycle, and a commitment applies to the new term (a prepaid amount is each term's, unless it rolls over).

**A step-up** (Ex. 5% more each renewal) is recorded on the contract, and put in place as a new phase from the next
term's start with a stepped-up rule, so prices stay in your policy with everything else. The contract says when the
next term doesn't have that phase yet, and **Ask the Analyst** puts it in place.

**Reminders.** With a notification on **A contract's renewal or end is coming up, or it renews**, Limitr Cloud tells
your team a month before the notice deadline (or before the end, for a contract without notice or that doesn't
renew), and when a contract renews. The Analyst can list what's coming up ("which contracts renew this quarter?") and
renew one for you to apply.

## Fees

A contract's committed fees (a platform fee, a license, an annual subscription, a setup fee) are the contract's own.
Under **Fees**, each one is:

- **A name**, as invoices show it (Ex. Platform fee).
- **An amount** each cycle, in your policy's currency.
- **How often:** once, monthly, quarterly, every six months, or yearly, counted from its start.
- **Billed in advance** (when each cycle starts) or **in arrears** (when it ends, on that period's invoice). A
  one-time fee bills when it starts.
- **From** when (the term's start by default).
- **Paid outside Limitr**, for a fee paid by wire or check, or before Limitr: it's recorded on the invoice and in
  revenue as paid, and never charged.

There's nothing to set up in your policy. Limitr bills the full amount each cycle, on each
[account](./customers#accounts) the contract reaches, until the end. It's billed on the account's top-level customer
(or its payer, when an account record names one), so the contract has to reach that customer: a contract with an org
and its users does, a contract with only one user doesn't, and the contract says which accounts it couldn't bill.
How it's collected is the account's: a card, a Stripe invoice due in 30 days, or outside Limitr.

A fee is its own line on the invoice, apart from usage, so revenue, margin, and dashboards can tell committed fees
from usage, and usage charts and forecasts never count them. A contract shows **Bills** (the accounts it bills), its
fees, and **Fees billed**: each cycle, when, and on whom. The Analyst sets fees up from the contract's terms ("an
annual platform fee of $24,000, invoiced net 30").

Fees made before Nov 2026 name an entitlement in your policy instead. They keep billing as they always have.

## Commitments

A contract can commit its account to spend:

- **A minimum** each billing period (Ex. $5,000 a month). When the account's invoice for a period in the term comes
  to less, a **true-up** line bills the difference.
- **Prepaid** for the term (Ex. $50,000 for the year). The account's invoices are paid from it first, until it's
  used; then they're billed as usual. What's left at the end **lapses**, or **rolls over** to the account's later
  invoices. Bill the prepayment itself as a one-time [fee](#fees), or outside Limitr.

A commitment is one account's, and that account bills as one, because it's applied to the account's single
invoice each period: a top-level customer without an account record does (with or without users), and an account
record does unless it's set to **Each member pays**. So a commitment is for a contract with one customer (and its
users) or with an account, not a segment. The contract shows its
true-ups or what's been drawn, period by period, and what's left of a prepaid amount; the account's invoices show
the same lines.

## Recognition

A contract with fees or a commitment shows its **recognition schedule**: what it billed, earned, and has deferred,
month by month. Fees are earned evenly over their cycles (an annual fee billed in January is earned a twelfth a
month), true-ups in the period they're for, and a prepayment as the account's invoices draw it down, with what
lapses earned at the end. A [credit](./customers#credits-and-refunds) given under the contract counts against it
the month it's given. **CSV** exports it for your accounting system, which stays the record: the schedule is
what Limitr billed, laid out for your books.

## The Contracts page

The list shows each contract, who it's with, the rules in force now, its term, and where it stands (active, starts
later, draft, term over, ended), ending soonest first. **Current**, **Ended**, and **All** filter it, and the search
finds a customer's or a name. Open a contract to see all of it.

A contract shows its phases (with what each rule changes), who it reaches now, who it bills, its fees, the terms as
agreed, how each term maps onto Limitr, its value, its files (anyone in the workspace can download them), and its
history. From there:

- **Edit** changes any of it: dates, phases, rules, fees, the terms, and its files (attach, download, remove). An
  ended contract stays ended when it's edited.
- **Renew** starts the next term of a contract renewed by hand (or one without a renewal: 12 months).
- **End it now** takes its rules off its customers and stops its fees. **Make it active again** puts them back.
- **Delete** removes it and its files, and its customers lose its rules. Nothing else on them changes.
- **Ask the Analyst** about it, or to change it ("move Acme to year 2 pricing on March 1").

A rule a contract uses can't be removed by a publish: end the contract first. A segment a contract uses can't be
deleted.

## Pricing rules from before

Before rules, Enterprise had pricing rules (prices for a segment). Limitr Cloud moves each one for you: it becomes a
rule with its prices and a contract for its segment, so customers pay the same. Until then, they show read only at the
bottom of the **Rules** tab and still apply.

For rules in the engine itself, without Limitr Cloud, see [Trials and custom deals](/docs/how-to/custom-deals#one-deal-for-many-customers).
