# Payment schemes

> The two ways a pay-kit Go gate charges — fixed charge and metered usage (upto) — plus where MPP session lives.

A gate's `Kind` decides how it charges, and which middleware you mount. The default is a fixed charge; usage is a separate `Kind` gated with `RequireUsage`.

| Scheme        | Gate                  | Middleware                  | What it does                                                                         |
| ------------- | --------------------- | --------------------------- | ------------------------------------------------------------------------------------ |
| Fixed charge  | `GateFixed` (default) | `client.Require(gate)`      | Charge a fixed amount once, settled before the handler runs.                         |
| Metered usage | `GateUsage`           | `client.RequireUsage(gate)` | Authorize a ceiling, meter actual usage, settle the real amount and refund the rest. |

<Callout type="info">
  Usage gates settle a handler-determined amount via x402 `upto`, so they are **x402-only and cannot carry fees**, and
  the operator must have a signer. MPP `session` ships in Go but at the protocol layer
  (`protocols/mpp/server.NewSession` + `SessionMiddleware`), not as a `paykit.Gate`; `subscription` and x402
  `batch-settlement` are not implemented in Go.
</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="go" name="charge.server" path="/quote" />

The client side is a single call through the paying transport — see [Client](/docs/sdk/go/client):

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

## Metered usage (`upto`)

A `GateUsage` gate advertises `Amount` as the **ceiling**. The client opens a payment channel depositing that maximum; the handler meters real usage and reports it through the `Charge` meter from `paykit.ChargeFrom`; the gate settles the actual amount and refunds the remainder after the handler returns. This is the shape for LLM-token billing or per-byte metering.

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