Skip to content

Monad testnet · real HTTP 402 · real escrow

An agent that pays with credit

This page calls a paid API. Unpaid, it answers 402. Paid with the agent's signed voucher, it answers with data, and the money comes out of escrow the vault put up. The agent's key is printed below. Take it.

Qwen 3.8, with tools

Give the agent a job

A model plans the work, checks the price and its credit, buys from the paid API and answers. Try the third task: tell it to send the money to you.

Each run may buy up to 3 reports at 0.25 from the paid API, on the vault's credit. The model cannot spend more: the limit is in the code and the cap is in the contract.

A recorded run. Press Run the agent for a live one.

qwen/qwen3.8-27b · 1 paid call · spent 0.25

Task: Is now a cheap time to send a transaction on Monad testnet? Buy what you need to answer.

The same loop, by hand

Or make each call yourself

No payment

Ask without paying

The vendor sells a gas and block report for Monad testnet at 0.25 per call.

With a voucher

Pay with the agent's voucher

Your browser signs a voucher with the agent's key and retries. The vendor has Monad's x402 facilitator verify it, checks the escrow on chain, and only then answers.

With the leaked key

Now try to steal it

You have the agent's key. Ask the live vault to send the money somewhere else.

Vault money in the channel
…
Agent's own stablecoin
0.00
Vendor has claimed
…
Agent's debt / limit
…

The requests you make appear here, with the answers.

The agent's private key, published on purpose

Leak the key. The money stays.

0xad7c0fec••••••••••••••••••••••••••••••••••••••••

Address 0xEc7029…c76D6e. It holds a little MON for gas and no stablecoin.

  • What the key can do. Sign vouchers, and ask the vault to fund a channel to the one vendor the sponsor approved, 0x446659…cedaBc.
  • What it cannot do. Move the money anywhere else. The vault at 0x959c59…3787dD reverts, as the buttons above show.
  • The most a thief can do. Spend the credit line at that vendor, up to the limit, and burn the agent's gas. The sponsor revokes the line in one transaction.

2026-10-13 · tools/agent.ts

The same loop, run from a terminal

The agent got a 402, had the vault fund the channel, paid for 3 calls with signed vouchers, and the vendor claimed and settled on chain.

  1. 01sponsor opens a line for the agent: 400 collateral, 100 limit, 40 per channel, 30 days0xcc6cf5…9403cf
  2. 02sponsor approves the vendor for this agent0x4d007a…350b30
  3. 03sponsor sends the agent gas (MON only, no stablecoin)0x8f715c…715dc1
  4. 04sponsor sends the vendor gas0x699ef1…8695e5
  5. 05agent asks the vault to fund a 10.00 channel to the vendor0xfcef56…97ee0f
  6. 06vendor claims the agent's voucher for 0.75 total0x6f2c92…8df9fc
  7. 07vendor settles the claimed funds to itself0x610d98…f64a42

Limits: the token is a test token. The facilitator verifies vouchers but does not settle; the vendor claims on chain itself. This demo vendor keeps no memory between requests, so it does not track the highest voucher it has seen; a production vendor does.