Metered payment channels
Hilt Pay API supports MPPsession payment channels for high-frequency paid work where one on-chain payment per request would be too slow or too expensive.
The payer escrows a USDC spending ceiling once. Each delivered unit is then authorized by a cumulative off-chain voucher. Hilt verifies and records every accepted voucher, and the channel settles once at the highest verified amount. Any unused USDC is returned to the payer through the channel close flow.
Use payment channels for:
- token or compute streaming
- repeated agent tool calls in one session
- inference, search, data, or media work billed in small units
- bursts of API requests where the unit price is below practical per-transaction economics
Public contract
Hilt channels use:
The current MPP Solana session specification is an Internet-Draft. Hilt pins its server implementation and the mainnet channel program so a session cannot silently move to different settlement terms during its lifetime.
Security model
The merchant payout wallet, USDC mint, channel program, Hilt metering ceiling, unit price, Hilt fee destination, fee rate, expiry, external customer reference, voucher signer mode, and complete on-chain split are pinned when Hilt creates the session. Credentials issued for one Hilt session are rejected by every other session. Hilt does not hold the payer’s wallet key and cannot sign payer vouchers. A valid cumulative voucher can increase the authorized total only within the escrowed deposit. A later voucher replaces the earlier cumulative ceiling; it is not added to it again. Hilt stores channel state in PostgreSQL and serializes every mutation with a row lock. Delivery IDs and merchant write operations are idempotent. Voucher commitments above the Hilt metering ceiling are rejected even if the payer deposited more. The recovery worker settles expired or interrupted sessions only at the highest voucher Hilt already verified. It cannot increase the claim during recovery. At settlement, the channel program pays the developer wallet and Hilt fee destination directly from escrow using the split committed when the channel opened. Hilt’s operator key pays the settlement network fee and authorizes the claim transaction; it is assigned no payment share. Integer rounding can leave at most one USDC base unit, which the channel program sends to its protocol treasury when the sealed channel closes. Use a unique, stableexternal_customer_id that does not expose email, wallet, or other personal data. Keep the Hilt API key on your server.
Before you start
You need:- a Live Hilt Pay API key with
access:readandaccess:write - an active one-off Hilt Pay API product using
solana_usdc - a verified Solana payout wallet with an initialized, unfrozen native USDC token account
- a unit price in USDC minor units
- an MPP-compatible payer client that supports the Solana
sessionintent
10000 means 0.01 USDC per unit.
Session lifecycle
- Your server creates a capped metered session.
- Hilt returns the signed
WWW-Authenticate: Paymentchallenge in the response header and body. - The payer client verifies the challenge, approves the cap, opens the on-chain USDC channel, and submits its
Authorization: Paymentopen credential. - Before each billable unit, your server reserves a delivery with a unique delivery ID.
- The payer client signs the next cumulative voucher and posts the delivery ID and voucher to the directive’s
commitUrl. - Hilt verifies the voucher, commits that exact delivery, and returns the updated evidence before your application releases the paid result.
- The payer can top up or close through standard MPP actions. Your server can also request recovery settlement.
- At the deadline, Hilt’s worker settles the highest accepted voucher and preserves the settlement signature and delivery ledger.
committed.
Create a session
cap_minor_units is Hilt’s maximum billable amount for this session and the suggested opening deposit. It is not an automatic charge. An MPP client can choose a larger deposit, but Hilt will never accept cumulative vouchers above this ceiling. The value must be a whole number of product units. Session expiry can be five minutes to 24 hours.
Standard 1% products use Hilt’s published $50 fee cap, so a single channel can authorize at most 5,000 USDC. Hilt returns the exact maximum for products with different approved fee terms.
The response includes:
WWW-Authenticate.
Open and authorize
The payer client sends standard MPP credentials to the public authorization endpoint:open, use, voucher, topUp, or close. Hilt validates it against the exact session challenge and current channel state. Successful responses include Payment-Receipt.
The public authorization route does not accept or require the merchant API key. The signed MPP credential is the authority for that channel action; it does not grant access to other Hilt routes.
Reserve a billable delivery
Create the reservation before releasing one or more units:units by the product unit price and returns the MPP delivery directive. Reusing the delivery ID with the same amount returns the existing reservation. Reusing it with different terms fails with 409.
The response contains a standard MPP delivery directive and its public commitUrl. The payer client signs the required cumulative voucher and posts it with the delivery ID:
committed.
Inspect evidence
- payer and authorized voucher signer
- deposit, committed total, and remaining authorized balance
- highest accepted voucher signature
- every reserved, committed, or expired delivery
- close state and final Solana settlement signature
- product, customer, fee, asset, program, and expiry terms
Close or recover
An MPP-compatible payer can submit aclose action. Your server can also request settlement:
SDK methods
TypeScript SDK1.5.0:
1.5.0 exposes the same lifecycle through create_metered_session, authorize_metered_session, reserve_metered_delivery, commit_metered_delivery, get_metered_session, and settle_metered_session.

