# Payment schemes

> The three ways a solana-pay-kit gate can charge — fixed charge, metered usage (upto), and batch-settlement — and which gate function each uses.

A gated route advertises both protocols at once; the scheme is decided by **which gate function** you mount. All three return an axum `MethodRouter`.

| Scheme           | Gate function                        | What it does                                                                         |
| ---------------- | ------------------------------------ | ------------------------------------------------------------------------------------ |
| Fixed charge     | `paid_get` / `paid_post`             | Charge a fixed amount once, settled before the handler runs.                         |
| Metered usage    | `paid_upto_get` / `paid_upto_post`   | Authorize a ceiling, meter actual usage, settle the real amount and refund the rest. |
| Batch-settlement | `paid_batch_get` / `paid_batch_post` | One channel, many cheap requests verified off-chain; redeem vouchers on-chain later. |

<Callout type="info">
  The `upto` and `batch-settlement` schemes settle with operator-signed vouchers, so they require a `fee_payer_signer`
  on `PayKitConfig` (see [Signers](/docs/sdk/rust/signers)). MPP `session` and `subscription` exist at the protocol
  layer (`solana_pay_kit::mpp`) but are not yet exposed as `paid_*` gate functions.
</Callout>

## Fixed charge

The default gate: a fixed price the client settles over **MPP or x402** (its choice). Settlement runs before your handler.

<Snippet lang="rust" name="charge.server" path="/quote" />

The client side reads the challenge and pays — see [Client](/docs/sdk/rust/client):

<Snippet lang="rust" name="charge.client" url="https://api.example.com/quote" />

## Metered usage (`upto`)

A `paid_upto_*` gate advertises a **maximum** price. The client deposits that ceiling; the handler meters real usage and reports it via the `Charge` extractor; the gate settles the actual amount and refunds the remainder. This is the shape for LLM-token billing or per-byte metering, where the final cost is unknown until the work runs.

<Snippet lang="rust" name="upto.server" path="/summarize" />

## Batch-settlement

A `paid_batch_*` gate is for high-throughput APIs: the client opens one payment channel and signs a cumulative voucher per request, which the gate verifies off-chain and serves immediately — no on-chain transaction per request. The operator redeems vouchers on-chain later, in batches, via `pay.x402_batch()`.

<Snippet lang="rust" name="batch.server" path="/quote" />
