Skip to main content

What is x402?

x402 is an open protocol from the Coinbase Developer Platform that enables programmatic, per request payments over HTTP, designed especially for AI agents and APIs. It effectively turns the old “402 Payment Required” HTTP status code into something usable, for both humans and AI agents. On Stellar, x402 works with Soroban authorization so that clients can pay for API requests via signed auth entries, ideal for micropayments and payment enabled apps. To build an x402-enabled service or integrate payments into your app, see Build Applications and the resources below.

Demo

Try the x402 Demo. Send an x402 payment on Stellar Testnet or Mainnet and see the x402 payment flow in action. (source code) Screenshot of the x402 payment flow demo on Stellar

x402 Compatible Wallets

To support x402 on Stellar, a wallet must support auth-entry signing (Soroban authorization entry signing). The following wallets support auth-entry signing:
  • Freighter Browser Extension
  • Albedo
  • Hana
  • HOT
  • Klever
  • OneKey
  • Scopuly
Freighter Mobile does not currently support x402; use the Freighter browser extension. Mobile support is planned for a future release.

Supported Assets

x402 on Stellar supports any SEP-41 compliant token. The default is USDC.

Testnet USDC

Mainnet USDC

x402 Facilitators

You can use a facilitator to verify and settle x402 payments. Two options are available for Stellar:

Coinbase x402 Facilitator

Coinbase’s x402 facilitator supports Stellar on Testnet with sponsored fees. Check which networks and options are supported:

Build on Stellar Relayer (with OpenZeppelin x402 Plugin)

The Relayer Plugin for x402 implements the x402 Facilitator API so you can serve x402 payments directly from a Relayer instance. The x402 Facilitator leverages the OpenZeppelin Relayer Framework. It works with the Coinbase x402 ecosystem and exposes the expected /verify, /settle, and /supported endpoints under the Relayer plugin router.

How to Use

This x402 facilitator service is available on Testnet and Mainnet. Under the hood, the plugin leverages OpenZeppelin Channels to submit transactions onchain via a managed Relayer and Facilitator setup.

Testnet

To use the facilitator on testnet, you will need:
  • An API Key (Relayer Service). Generate your testnet API key here: https://channels.openzeppelin.com/testnet/gen
  • Facilitator URL. Use the following facilitator endpoint in your configuration: https://channels.openzeppelin.com/x402/testnet

Mainnet

To use the Facilitator on mainnet, you will need:
  • An API Key (Relayer Service). Generate your mainnet API key here: https://channels.openzeppelin.com/gen
  • Facilitator URL. Use the following facilitator endpoint in your configuration: https://channels.openzeppelin.com/x402
This version supports x402 v2 specification. For x402 v1 support, please use a previous version of this plugin (check git history for v1 compatible releases).

Community Facilitators

The following facilitators are built and operated by the community. They are not maintained by SDF and are at varying stages of readiness, so check each project’s current status before depending on it.

Vellar Facilitator

Vellar serves the standard /verify, /settle, and /supported endpoints, and adds an optional Bazaar discovery layer: when a payment settles and carries Vellar’s discovery extension, the facilitator may also add that resource to a searchable catalog, so sellers are listed without registering separately. Cataloging is best-effort and never blocks settlement, and payments without the extension settle as normal. The catalog can also be queried by AI agents through an MCP discovery server, which you run yourself and point at a facilitator. Vellar sponsors the settlement transaction fee, though classic accounts still fund their own base and trustline reserves.
Testnet only, and not independently audited. See Vellar’s security notes for more information. The hosted instance runs on a free tier, so the first request after an idle period can take up to a minute.

Examples

  • x402 on Stellar (Stellar repo) — Tools, examples, and references for the x402 protocol on Stellar. Use this as the canonical source for Stellar-specific x402 demos and tooling. View on GitHub
  • x402 Starter Template — A starter template for building payment-enabled applications with x402. Simplified scaffolding demonstrating x402 payment protocol integration with browser wallet support; use it as a foundation for micropayment-enabled services, SaaS applications, or any project that needs frictionless web payments. View on GitHub
  • Economic Load Balancer — An intelligent multi-chain payment router that automatically selects the most cost-efficient network for high-frequency AI agent micropayments. View on GitHub
  • 1-shot Stellar x402 app — Example x402 app with a video paywall and guide for building payment-enabled apps on Stellar. View on GitHub

Additional Documentation

Learn more