Payments

x402 on Stellar

Unlock payments for the agent economy. Build with internet-native payments on Stellar.

What is x402?

402 is an open payment protocol that lets any API or web service charge per request—no platform accounts, no billing system, no API keys required. A client hits your endpoint, pays in crypto, and gets the resource. All in one HTTP round-trip.

For AI agents that need to discover and pay for services autonomously, this is the difference between a workflow that runs and one that stalls.

Use cases

Payments built for what comes next

Pay-per-API Call

Replace API keys, subscription tiers, and billing infrastructure with a single payment per request. Add middleware. Specify a Stellar address. Done.

Agentic autonomy

AI agents can discover, authorize, and settle payments programmatically within user-defined spending rules. The workflow doesn't break where the payment begins.

Micropayments

Low, real-time settlement that makes fractional-cent pricing viable at scale.

Subscriptions and renewals

Users set programmable spending rules; agents execute payments within those parameters.

Pay-as-you-go access

Metered access to content, data, APIs, or compute, billed per use on Stellar instead of flat subscriptions.

Machine-to-machine payments (M2M)

High-frequency payments between automated systems — IoT devices, microservices, infrastructure — settling on Stellar within programmable spending rules.

Start building

1. Install

Install x402 middleware and add it to your server.

2. Setup

Choose which endpoints require payment, set the token and amount, and specify your Stellar address.

3. Deploy

The facilitator abstracts the blockchain complexity, handling verification, settlement, and network fees.

4. Accept payments

Any client—browser, app, or AI agent—can now pay for your API per request. Funds typically settle on Stellar in approximently 5 seconds.

x402 Resources

Developer docs

Complete developer documentation for building with x402 on the Stellar network

OpenZeppelin’s x402 facilitator plugin

Open-source facilitator plugin for x402 on Stellar with a managed relayer for relayer-subsidized transaction fees.

OpenZeppelin’s x402 facilitators docs

Overview and guide to tools

Managed relayer

Stellar relayer SDK for building custom facilitators and transaction infrastructure.

OpenZeppelin’s Stellar Relayer SDK

A SDK providing a TypeScript/JavaScript client for interacting with the OpenZeppelin Relayer service.

OpenZeppelin’s Stellar Relayer docs

Quickstart, integrations, configuration, and roadmap.

x402.org

Official page and specifications for the x402 protocol.

OpenZeppelin smart account contracts

Programmable wallets with built-in rules — spending limits, multi-sig, scoped permissions — so agents can pay for things without needing a human to approve transactions.

Coinbase x402 GitHub

Repo for the X402 open standard for internet native payments, aiming to support all networks and forms of value (stablecoins, tokens, fiat).

Connect with partnerships

Want to build with x402?

Talk to our team about integrating x402 on Stellar.

x402 is an open-source payment protocol. It is not a regulated financial service, and neither the Stellar Development Foundation nor the Stellar network operates, controls, or intermediates x402 transactions. Users, AI agents, and service providers integrating x402 are solely responsible for compliance with all applicable laws and regulations in their jurisdictions, including money transmission, sanctions, and consumer protection requirements. Programmable spending controls are available through smart account contracts but do not guarantee regulatory compliance. USDC is issued by Circle Internet Financial, LLC and is subject to Circle's terms and conditions. Availability of x402-compatible services and supported assets may vary by jurisdiction. The Stellar Development Foundation does not custody user funds, process payments, or control the Stellar network. Third-party services referenced herein, including the OpenZeppelin facilitator and managed relayer, are operated independently and subject to their own terms and conditions.