Hilt Pay API

Hilt Pay API lets software turn a stablecoin payment into an access decision. Use it when an API, AI tool, bot, dataset, software feature, private product, or paid agent needs:
  • a payment session
  • an x402 402 Payment Required response
  • Solana USDC settlement
  • a receipt and proof trail
  • an entitlement check
  • webhook events
  • subscription state for recurring access
  • support context that can be fetched through the API
The public API namespace is /v1/access. This is the Hilt surface for paid API access and agentic payments: a protected resource can return a payment requirement, the buyer or agent can complete payment, and your backend can serve only after Hilt entitlement state is active.

Current public scope

Hilt Pay API is live with Solana USDC settlement. x402 is the protected-resource protocol shape for API and agent flows. Treat it as the HTTP 402 Payment Required contract your resource can return when access is missing. The live public settlement rail is Solana USDC; create live sessions only from rails returned as available by Hilt for that product and account. Additional settlement rails will have their own setup docs when they are publicly available.

Route overview

Use the /v1/access namespace for Hilt Pay API objects:

How the protected-resource flow works

For durable or time-based access, call POST /v1/access/entitlements/check and serve only when Hilt returns has_access: true. For metered requests:
  1. Your product receives a request with a stable request id.
  2. Your backend atomically consumes one unit with POST /v1/access/entitlements/consume.
  3. If usage is missing, create a payment session and return HTTP 402 with Hilt’s PAYMENT-REQUIRED header.
  4. The buyer or buyer-agent pays the Solana USDC terms and retries your resource with PAYMENT-SIGNATURE.
  5. Your backend settles the signature through POST /v1/access/x402/settle.
  6. Hilt verifies settlement, records the receipt, activates entitlement state, and returns PAYMENT-RESPONSE.
  7. Your backend atomically consumes one unit with the same logical request id.
  8. Serve only after settlement and consumption succeed.
Do not grant access from a client claim, signed payload alone, or raw transaction hash. Use Hilt’s durable check or atomic metered consumption for the access decision.

Create an app

Use one app boundary per product area, customer product, or integration surface.

Configure Solana USDC settlement

Your checkout should render only rails returned as available by Hilt for the product and account.

Create a product

One-off product:
Recurring product:
For recurring products, the buyer approves a native Solana subscription setup once. Hilt records future successful collections as normal payment-to-access evidence: payment, receipt, entitlement period, webhook event, support context, and audit history.

Check setup readiness

Use setup readiness before going live. It tells your agent or backend which product, rail, webhook, billing, and live settings still need attention.

Check durable access state

Response:
Use this call for durable or time-based access display and planning. If has_access is false, return HTTP 402 with the payment requirement or checkout handoff your flow supports. For metered agent requests, the runtime authority is POST /v1/access/entitlements/consume. Entitlement checks are useful for display and planning; atomic consumption decides whether each billable request is served. Do not replace either server-side decision with a wallet signature, transaction hash, or client-side claim.

Create a payment session

The response includes:
  • payment_session.id
  • payment_session.status
  • payment_session.checkout_url when the flow uses hosted checkout
  • payment_session.payment_requirement when the flow is protocol-based
  • pending_entitlement
  • rail
  • payment_session_options
Use checkout_url for hosted Solana USDC checkout handoff. Use payment_requirement only when the response includes a protocol requirement for your protected-resource flow.

Return and settle x402 V2

For an x402 session, Hilt returns the standard V2 payment requirement and its encoded PAYMENT-REQUIRED header. Relay that header with HTTP 402 Payment Required. The selected acceptance names Solana mainnet, native USDC, the gross amount, the merchant recipient, and the Hilt payment scheme. When a platform fee applies, scheme: hilt-exact includes two direct USDC transfer legs in extra.hilt.atomicTransfers. The buyer signs one Solana transaction. The merchant payment and Hilt fee either settle together or neither settles; Hilt does not receive or forward the merchant portion. The buyer or agent retries with a base64-encoded x402 V2 PAYMENT-SIGNATURE header. Send that header and the Hilt payment-session ID to:
Hilt binds the selected acceptance to the stored session, verifies the signed transaction, submits it to Solana, waits for confirmation, creates the signed receipt, and activates or extends the entitlement. A successful response includes the encoded PAYMENT-RESPONSE header. Do not serve from a signed payload alone. Serve only after settlement succeeds and the entitlement check or usage consumption succeeds.

Consume metered usage

Metered products grant a fixed number of units per successful payment. Consume units atomically before serving:
Send a unique Idempotency-Key for each billable operation. Concurrent requests cannot consume the same final unit twice. When no units remain, return a fresh Hilt 402 challenge rather than serving the resource. For a complete route pattern, see Agent-to-agent micropayments.

Submit proof when your flow needs it

Proof submission records the payment evidence for the payment session. It does not grant access by itself. Hilt still verifies payment state and updates entitlement state before has_access becomes true.

Native subscriptions

Hilt Pay API supports recurring products through native Solana subscription setup. For the complete merchant and API guide, see Native subscriptions. Use this for:
  • paid APIs
  • AI tools with monthly access
  • subscription datasets
  • recurring bot access
  • private software subscriptions
  • paid communities that need automatic access periods
The buyer signs once to approve the subscription setup. Future successful collections extend the paid-through period and emit the same operational events your product already consumes.

Native subscription quickstart

  1. Create a recurring product with billing_model: "recurring", renewal_mode: "solana_native_subscription", billing_interval_days, and cancel_at_period_end.
  2. Start a payment session for that product with rail: "solana_usdc".
  3. Send the buyer to the returned checkout_url, or return the protocol requirement if your product is using the protected-resource path and Hilt returned one.
  4. After the buyer signs and the first payment succeeds, check access with POST /v1/access/entitlements/check.
  5. Store the Hilt identifiers you need for support: entitlement id, payment id, receipt id, and native subscription authorization id when present in the Hilt response or webhook payload.
  6. Drive your own access decision from Hilt entitlement state, not from a wallet signature alone.
Read a native authorization:
Cancellation is period-aware:
  • the buyer or merchant can stop future collection
  • access can remain active until the paid-through date
  • Hilt records cancellation and subscription state
  • your product reads the entitlement state through the same access check
Create a cancellation intent:
Confirm the signed cancellation:
If immediate_revoke is false, access can remain valid until the current paid-through date. Keep using entitlement checks to decide what the buyer can access.

Webhooks

Store the returned signing secret immediately. Verify webhook signatures before changing access in your own system.

Sandbox sessions

Use sandbox sessions to test the integration without live money.
Use sandbox mode for:
  • denied access
  • pending access
  • allowed access
  • webhook consumer testing
  • repeated SDK and Postman checks
Use setup readiness before real traffic. A low-value live settlement check is optional after sandbox validation when your team wants extra confidence in the live wallet, payout, receipt, webhook, and entitlement path.

Agent setup

Agents can prepare the setup before the owner approves live use.
The agent can submit a setup manifest for:
  • app
  • product
  • billing model
  • protected resource
  • webhook destination
  • settlement rail
  • owner approval handoff
Owners still approve live billing, payout settings, and production API credentials from Hilt.

Pricing

Hilt Pay API has separate pricing from Hilt Pay Workspace: Open Hilt Pay API pricing for the current plans, comparison table, and fee estimator.