Pay a PayMe handle from an agent

Wallet-capable agents can pay an active Hilt PayMe recipient through one public HTTP endpoint:
The first request resolves the verified X handle, pins the recipient and payment terms, and returns an HTTP 402 Payment Required response with a Machine Payments Protocol (MPP) charge challenge. The agent signs the advertised Solana transaction and retries the same request with Authorization: Payment. No payer PayMe account or Hilt API key is required.
MPP is the HTTP payment-authentication protocol used by this PayMe action. It is not a chain, token, wallet, or Hilt Pay API /v1/access route.
PayMe MPP pays a verified recipient and returns a payment receipt. It does not grant access to an API or protected resource.

Request a payment challenge

The asset may be SOL or USDC. amount is the exact amount the recipient should receive. The optional Idempotency-Key lets the caller safely reuse the same challenge for the same request. The unpaid response has status 402, includes WWW-Authenticate: Payment ..., and returns a machine-readable summary:
The sender funds the displayed total. The verified PayMe recipient receives the requested amount and Hilt receives its flat 2% share from the total paid by the sender. Both transfers are contained in one buyer-signed Solana transaction.

Sign and retry

Use an MPP-compatible Solana client to validate the challenge, build the transaction, and sign it with the payer wallet. Retry the same URL and JSON body with the returned authorization credential:
Hilt verifies that the credential belongs to the challenged payment, submits and confirms the exact transaction, records the PayMe receipt, and returns 200 OK. The response also exposes the standard Payment-Receipt header and the finalized signature in X-Payment-Settlement-Signature.

Read payment status

The payment summary and receipt can also be read by public payment ID:
Use this after a network interruption or when the signed retry response was not received. A finalized payment remains tied to one receipt and one Solana transaction signature.

Safety and retry rules

  • Validate the complete MPP challenge before signing.
  • Keep the request body unchanged when retrying with the payment credential.
  • Reuse one unpredictable idempotency key for retries of the same intended payment.
  • Do not treat the initial 402 response as a completed payment.
  • Do not pay again when a response is interrupted. Read the payment status first.
  • Never expose a seed phrase or private key to Hilt. The payer wallet remains the signing authority.
  • Do not use this route as proof of API access. PayMe payments issue receipts; Hilt Pay API /v1/access manages paid-resource entitlements and atomic usage.

Choose the right agent flow

Reference