Skip to main content
The Playground (apps/playground) is a page and a small server for trying x402 on Stellar in a browser. Every payment it makes is real: a testnet key in your tab signs a Soroban authorization, a seller asks Rail402 to verify and settle it, and the transaction lands on the Stellar testnet, where its link opens in the Rail402 Explorer. Nothing is simulated, and the page draws each step from what actually happened. The Playground is hosted at playground.rail402.dev, against the hosted testnet facilitator, Bazaar and demo seller. You can also run it yourself.
The Playground serves stellar:testnet only. It refuses to start with any other network, and the page refuses payment requests on another network before anything is signed.

The test wallet

On your first visit the page creates a test wallet by itself and shows its progress: a fresh testnet key is made in the tab, Friendbot funds the account with testnet XLM, a USDC trustline is added and 1 USDC is bought on the testnet exchange, keeping 10 XLM for reserves and fees. Each step is a real transaction with its explorer link, and no XLM of your own is needed. If a step fails, the dialog marks it with its code and offers Try again; if the purchase fails, it links to Circle’s testnet faucet. Until the wallet holds test USDC, Run is held with playground_wallet_not_set_up and a Finish setup button. The header’s wallet pill shows the address and the USDC balance, and opens the wallet menu: the full address with a copy button, Add test USDC (buys another 1 USDC), the account in the explorer, and Reset wallet, which deletes the key after you confirm and creates a new one. The key is stored encrypted in the browser and never leaves it: How it works explains the storage. The menu can also save the key as a file for the CLI and the SDK (import it with rail402 keys import < <file>, or chmod 600 it before using RAIL402_SECRET_KEY_FILE). The wallet is used by one tab at a time; a second tab is read-only until the first one closes. Every paying run needs a per-call cap. It defaults to 0.01 USDC (0.05 USDC for the agent), the page clamps it at the operator’s ceiling of 0.10 USDC, and a run does not start without one. The session budget is 1.00 USDC per 24 hours.

The lab

The home page pays for real and plays the payment on a dark stage, one message at a time. Pick a mode: The URL field is editable: paste any x402 URL and Run pays it under your cap, exactly as typed. A link to the page can carry a URL (/?url=…); it fills the field and is never paid until you press Run. The swimlane has a lane for each party (you, the seller, the facilitator and Stellar; for the agent also the Bazaar and the tool). Each message appears as it happens, at a pace you can follow; the inspector beside it says in plain words what the current step did, with its key facts and a link to the docs, and the step list under it lets you open any step. When a step takes a while (the seller and the facilitator settling, a chain read), the inspector says what the run is waiting for and counts the seconds. The seller’s facilitator is named Rail402 only when the run shows it is. When the payment is proven on chain the inspector shows the proof: the amount paid to the seller, the part of an upto cap that was never taken, that the network fee came from the facilitator and not from you, the transaction in the explorer, and what each party did. A payment counts as settled only when the chain proves it: the transaction consumed this payment’s own nonce and moved its amount, so a seller that reports some other transaction gets “not proven”. Save the run report saves a JSON file built from the run’s events only; it holds no key, signature or payment header.

Try a refusal

Try a refusal runs a payment that must be refused, on the same stage. Before signing, each check passes when it is refused with the expected code, nothing is signed and your balance does not move (the session check pays once first): The session check pays once inside its window before the second payment is refused; its result links that first payment’s transaction, and its run report names it in the summary (transactions). The second payment is tried with the window’s total lowered to what it has spent, so an earlier authorization whose reservation is released during the check (it expired unused) cannot make room for it. After signing, Send it twice pays the weather route and then sends the same PAYMENT-SIGNATURE again: the copy is refused and you are charged once. Seller charges over the cap has a Playground seller ask Rail402 to settle 0.02 against a 0.01 upto cap; Rail402 refuses it and nothing moves.

Bazaar

The Bazaar page shows every listing in the catalog on one page, read from GET /discovery/resources. Type in plain words to search with GET /discovery/search, and narrow the list with the filters: HTTP, MCP tools, fixed price (exact), pay per use (upto) and verified sellers. Each filter shows how many listings it keeps. Choose a listing to see its price, its paid calls, its seller and its trust level, and open its public version history. Try it with your wallet makes a form from what the listing declares: its path and query parameters, its JSON body fields, or its MCP tool arguments, with the seller’s example values filled in. Set your cap and pay: a price above your cap is refused before anything is signed. The result shows what the call returned, what you paid, who paid the fee and a link to the transaction. Watch this payment in the Lab plays that same payment on the Lab’s stage, step by step, while the page stays open; nothing is paid again.

Sell and Agents

Two pages walk you through doing the same from your own code. Every command and code block has a copy button.
  • Sell goes from an API to a paid listing in four steps, with an Express example: install the seller packages, get an address to be paid to with the CLI, price a route with the seller helpers and Rail402 as its facilitator, then check it the way the Bazaar will with rail402 seller check. The imports of the route code are folded into one line and copied with it. Your route is listed after its first paid call, which has to come from another wallet: you can paste its URL into the Lab and pay it from the page.
  • Agents goes from zero to a paid tool call: install rail402-mcp and the CLI, create and fund a test wallet, add the server to Claude Desktop, Cursor or Claude Code (a tab for each, with the configuration or the command that client takes) with a limit of 0.05 USDC per call and 0.50 USDC per session, and ask your agent to pay a tool. Watch an agent pay opens the Lab’s agent mode.

Run it yourself

The Playground needs Node.js 24.11 or later and a source checkout. Build the workspace and the page, then start the server against the hosted testnet services:
Then open http://localhost:8080. PLAYGROUND_PAY_TO is a public testnet account with a USDC trustline that the lab sellers are paid to; without it, set LAB_ENABLED=false, and the page then offers only what works without the lab sellers. Set DOCS_URL if the page should link to docs other than https://docs.rail402.dev. Self-host lists every setting, the Docker image and local mode.