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

# Choosing a Pricing Scheme

> How to decide between the exact and upto schemes for your endpoint.

The question comes down to one thing: do you know the price before doing the work?

## Use `exact` when...

* The cost per call is deterministic (a lookup, a fixed record, a canned response).
* The response size is bounded.
* You want buyers to be able to budget precisely.

Most endpoints belong here. Default to `exact` unless you have a reason not to.

```typescript theme={null}
requirePayment({
  scheme: "exact",
  amount: "5000",  // 0.005 USDC
  asset: "USDC",
  ...
});
```

## Use `upto` when...

* Cost depends on input (LLM tokens, transcription minutes, translation characters).
* Response size is unbounded and you charge by volume.
* You cannot predict compute cost until the job runs.

```typescript theme={null}
requirePayment({
  scheme: "upto",
  amount: "1000000", // 0.1 USDC ceiling
  asset: "USDC",
  pricing: { unit: "1k_tokens", pricePerUnit: "5000" },
  ...
});

// After work is done:
await facilitator.settle({ actualAmount: "340000" });
```

## Common mistakes

* **Using `upto` with a huge ceiling for a cheap deterministic call.** Buyers set per-call caps; a ceiling of $10 for a $0.001 call makes you unfilterable and hurts rank.
* **Using `exact` for LLM completions and quoting worst-case tokens.** Buyers overpay every call and go elsewhere.
* **Forgetting to declare `pricing`.** Buyers cannot decide whether your `upto` ceiling is reasonable without knowing the unit rate.

## Mixed offerings

A single endpoint can return multiple `PaymentRequirements` and let the client pick. Use this sparingly — two options is manageable, five is confusing.

## Related

* [Exact Scheme](/payment-schemes/exact)
* [Upto Scheme](/payment-schemes/upto)
