x402 on Stellar
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.
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
Freighter Mobile does not currently support x402; use the Freighter browser extension. Mobile support is planned for a future release.
x402 Facilitator
The OpenZeppelin Relayer x402 Plugin for x402 implements the x402 facilitator API so you can serve x402 payments directly from a Relayer instance. It works with the Coinbase x402 ecosystem (e.g., @x402/express) and exposes the expected /verify, /settle, and /supported endpoints under the Relayer plugin router.
Facilitator Service
The x402 Facilitator Service is now live. Under the hood, the plugin leverages OpenZeppelin Channels to submit transactions onchain via a managed Relayer and Facilitator setup.
Testnet Facilitator
To use the deployed x402 plugin 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 Facilitator
Coming soon.
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).
Resources
- 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
Additional Documentation
- OpenZeppelin x402 Facilitator Plugin Source Code
- OpenZeppelin x402 Facilitator Docs
- OpenZeppelin Stellar Relayer SDK
- OpenZeppelin Stellar Relayer Docs
- OpenZeppelin Smart Account
Learn more
- x402 protocol (Coinbase Developer Platform) — Official x402 protocol overview and spec
- x402 protocol specification — x402 Specification and Whitepaper
- Coinbase x402 GitHub — Official x402 Protocol GitHub Repo
- Signing Soroban invocations — Auth-entry signing and transaction signing on Stellar