x402 on Stellar

The payment layer for AI agents.

Vellar verifies and settles x402 payments on Stellar, lists every paid endpoint in a searchable Bazaar, and gives sellers and agents the tools to use both. Open source, non-custodial, fees sponsored.

Building on x402

What the payment layer does.

x402 is the open protocol that turns HTTP 402 into machine-payable APIs. Vellar is the piece that sits between a paying agent and a seller's API: it verifies signed payments, settles them on Stellar, and catalogs paid endpoints so agents can find them.

01

Verify and settle

Point your resource server at the Vellar facilitator and it handles the rest: verifying a signed payment, settling it on Stellar, and sponsoring the network fee through a pool of channel accounts. Buyers sign a payment authorization and never hand over keys.

02

Bazaar discovery

A settlement carrying the discovery extension can list your endpoint in the Bazaar, searchable by keyword and semantic ranking. Listing isn't automatic: the settlement has to succeed, and the discovery data, payTo binding and ownership checks all have to pass, so the catalog can't be spammed for free.

03

Built to be checked

The facilitator is open source. Its published testnet settlements, including a canonical conformance run with unmodified clients, resolve independently on the Stellar ledger, so nothing here has to be taken on trust.

Track record

Proof, not
promises.

Every line below links to the ledger, the doc, or the repo that proves it. Nothing here is asserted without something you can go check yourself.

For sellers

Point your resource server at the Vellar facilitator and gate any route with a 402 challenge. Settlement, fee sponsorship and Bazaar cataloging come for free, no Soroban code in your app.

FACILITATOR_URL=
https://vellar-facilitator-production.up.railway.app
npm install @x402/core @x402/stellar
register('stellar:testnet', exact)✓

For agents

Search the Bazaar for a payable endpoint, then pay and call it in one step, no pre-shared API key. AI agents can also query the catalog through an MCP discovery server, or reach for the CLI.

$ npx vellar-cli search "weather"
$ npx vellar-cli pay <url>✓ paid
VS Code extension

Charge for an API without leaving your VS Code.

Vellar x402 scans the open file for a route, asks how much to charge in USDC, and writes the 402 challenge, verification and settlement boilerplate straight into your handler. Nothing else in the file changes.

Works with Express, Fastify and the Next.js App Router. Pick a route from the command palette, set a price, and review real, typed code, ready to install and ship.

ExpressFastifyNext.js
Vellar x402 listed on the VS Code Marketplace
Playground

Don't take our word for it, go break it.

A playground for external developers to visually try out the Vellar x402 payment facilitator on Stellar testnet. Get a real funded testnet account, then work through the lessons below, real settlements, real refusals, everything inspectable.

Lab 01

Make a real API payment and inspect every hop, the 402 challenge, the signed header, the settled 200.

Learn the flow

Lab 02

Five deliberate corruptions of a real signed payment, every one refused by the facilitator.

Break payments

Lab 03

Browse every resource the facilitator has observed, each one with a working pay button.

The Bazaar, live

Lab 04

A five-level challenge track through everything above.

Quest mode

Break payments, live · Example⌁
Tamper signatureReuse nonce5 corruptions total
GET /v1/research402
X-PAYMENT headertampered
facilitator verify✗ refused
funds moved0.00
Nothing charged, that's the point
Questions

Frequently asked questions

Still curious? Reach us at hello@vellar.xyz or read the facilitator docs.

How do I start charging for an API?
Point your resource server at the Vellar facilitator and gate a route with a 402 challenge. Settlement, fee sponsorship and Bazaar cataloging are handled for you, with no Soroban code in your app. The VS Code extension can write the gate into an Express, Fastify or Next.js App Router route for you.
How does an agent find and pay an endpoint?
It searches the Bazaar, then pays and calls the endpoint in one step, with no pre-shared API key. Agents can use the CLI (npx vellar-cli search, then npx vellar-cli pay) or query the catalog through the MCP discovery server.
How does an endpoint get listed in the Bazaar?
Only after a real settlement carrying the discovery extension, and only if the discovery data is valid, the payTo is bound correctly, and the ownership checks against the resource's own 402 challenge pass. It can't be spammed for free.
Do you ever hold my funds or keys?
No. Buyers sign a payment authorization and never hand over keys. Vellar verifies and settles the signed payment; it never holds buyer funds or private keys.
Which networks, tokens and payment schemes work today?
Stellar testnet today, and Vellar settled its first payments on Stellar mainnet in September 2026. Any SEP-41 or Stellar Asset Contract token works, with USDC as the default. The exact scheme settles a fixed, pre-agreed amount; upto settles a metered amount up to a signed ceiling, which suits usage-based pricing, and is testnet-only for now.

Get paid by agents today.

Add an x402 payment gate to any endpoint in minutes, open source, non-custodial, fees sponsored.