Guides

How agents pay (x402)

Verivyx speaks the x402 protocol (version 2). An agent that wants a protected resource gets a machine-readable 402 Payment Required, settles a USDC payment on Stellar, and retries — all without a human in the loop.

The flow

  • The agent requests a protected URL and receives 402 Payment Required with a PAYMENT-REQUIRED header — a base64 payload describing how to pay (scheme, network, asset, amount, destination).
  • The agent signs a USDC transfer that satisfies the requirements and retries the request with a PAYMENT-SIGNATURE header.
  • Verivyx verifies the payment on Stellar, the paywall_core contract splits it between creator and platform, and the content is returned with 200 OK.
http
# 1. Request the protected resource
GET https://your-domain.com/article
→ 402 Payment Required
  PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6Mi4u   # x402 requirements (base64)

# 2. Sign a USDC payment, then retry with the signature
GET https://your-domain.com/article
  PAYMENT-SIGNATURE: <signed x402 payload>
→ 200 OK                                       # content unlocked

Payment rails

  • Soroban USDC — spec-compliant Stellar payments. Gas is sponsored, so agents don't need XLM to pay.
  • Classic USDC — standard Stellar payments for clients that prefer the classic asset.
  • Amounts are always in atomic units — 1 USDC = 10,000,000.

What can pay today

Any spec-compliant x402 client can pay a Verivyx paywall right now. The fastest way to see a real end-to-end payment is the Playground, where a sandboxed agent pays a demo paywall on testnet and shows every step on-chain.

First-party tooling is on the way — a Verivyx MCP server and SDK to make agent integration a few lines of code.