Payments

How Agent Gateway enforces paid access using x402, and how admins configure verification and settlement controls.

Agent Gateway can enforce payment before forwarding requests to protected resources. Payment behaviour is configured on the surface using the x402 protocol, which intercepts matching requests and demands a verifiable payment receipt before forwarding them upstream.

Payment policy model

Payment is configured at the surface target level as an x402 policy. The gateway evaluates payment requirements before the protected backend call is forwarded. If payment is required and missing or invalid, the request is rejected with 402 Payment Required.

Configuring payment on a surface

To enforce payment on a surface, add the Payment element from the Palette. The element is listed under the Policy section of the palette and attaches an x402 payment gate to the surface.

Once added, the gateway evaluates x402 payment requirements for requests arriving at that surface before forwarding them to the target.

x402 in Agent Gateway

x402 is the production payment path for on-chain micropayment access control.

What x402 enforces

  • Builds machine-readable payment requirements on 402 responses.
  • Validates submitted payment payloads on retry.
  • Applies configurable verification and settlement behavior.
  • Persists transactions for audit and cost tracking.

x402 verification and settlement modes

x402 supports multiple verification modes, selectable from the Verification Mode dropdown in the Payment element fullscreen editor:

OptionWhat it does
Local (On-Chain Verification)Verifies the payment transaction on-chain. Default.
Use external facilitatorDelegates verification to an external HTTP x402 facilitator.
Use connected gateway facilitatorDelegates verification to a connected gateway via DIDComm.
Verify cryptographic signatureVerifies a signed payment authorisation off-chain. No on-chain check.
Mock (Accept All - Testing)Accepts all payments without verification. For testing only.

Settlement behaviour is controlled separately via the Settlement Mode dropdown:

OptionWhat it does
Deferred (Batch Processing)Records the payment and settles later in a batch. Default.
ImmediateSettles immediately after verification. Not recommended for high-throughput surfaces.
NoneSkips settlement. Verification only.

These modes let operators balance on-chain assurance, settlement latency, and ease of testing.

Operations and audit

x402 produces durable transaction records used for:

  • Cost attribution.
  • Payment troubleshooting.
  • Compliance and audit evidence.
  • Integration events to external systems.

Track payment outcomes together with surface monitoring and policy decisions to identify rejected requests quickly and explain exactly why access was blocked.

  • x402 payment protocol: HTTP-native payment handshake using payment requirements and retry proofs.
  • Surfaces: Where payment policy is configured on managed agent traffic.
  • OPA policies: How policy decisions combine with payment controls in the request pipeline.