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 model
I'll check the current gas price and my credit line, then buy the gas report if it's affordable.
get_price()
{"httpStatus":402,"meaning":"Payment Required","pricePerCall":"0.25","scheme":"batch-settlement","network":"eip155:10143","payTo":"0x4466592e02a5932E8FCf0614b4034389DAcedaBc"}
check_credit()
{"lineActive":true,"creditLimit":"100.00","debt":"10.00","capPerChannel":"40.00","escrowLeftInChannel":"9.25","approvedVendor":"0x4466592e02a5932E8FCf0614b4034389DAcedaBc","yourOwnStablecoin":"0.00"}
The model
The report costs 0.25 and my channel has 9.25 left, so I can afford it. Buying now.
buy_gas_report()
{"httpStatus":200,"report":{"chainId":10143,"blockNumber":"70844809","blockTime":"2026-10-14T02:15:12.000Z","transactionsInBlock":1,"gasUsed":"0","gasPriceGwei":102,"costOf800kGasCallMon":0.0816},"paid":"0.25","voucherTotal":"1.00","verifiedBy":"the x402 facilitator at x402-facilitator.molandak.org","escrowLeftInChannel":"9.00"}
Answer
Yes, this is a cheap time. The report (block 70844809, 2026-10-14) shows a gas price of 102 gwei, and an 800k-gas call would cost about 0.0816 MON. The block also had only 1 transaction and 0 gas used, so the network is nearly idle — low congestion means fees stay low. I spent 0.25 of vault credit on the report (channel escrow now 9.00).
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.
- 01sponsor opens a line for the agent: 400 collateral, 100 limit, 40 per channel, 30 days0xcc6cf5…9403cf
- 02sponsor approves the vendor for this agent0x4d007a…350b30
- 03sponsor sends the agent gas (MON only, no stablecoin)0x8f715c…715dc1
- 04sponsor sends the vendor gas0x699ef1…8695e5
- 05agent asks the vault to fund a 10.00 channel to the vendor0xfcef56…97ee0f
- 06vendor claims the agent's voucher for 0.75 total0x6f2c92…8df9fc
- 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.