x402 · USDG · Robinhood Chain

Let your agent spend. Inside the moat.

Moat holds USDG for your AI agent and checks every payment against your rules: a daily budget, a max per call, a list of allowed APIs and an off switch. The agent pays for what it needs. Never more.

Live simulator

You set the rules. The agent spends.

Change the limits on the left, then make the agent pay for things on the right. Try an expensive call, an API that isn't on the list, or an agent stuck in a loop.

Your rules

Daily budget$5.00
Max per call
Allowed APIs
Pause all spending
In the moat$20.00

Agent wants to pay research-agent

Spent today$0.00 / $5.00
0paid
0blocked
$0.00stopped by Moat
// every payment attempt shows up here
Simulated in your browser: no real payments. The APIs on this page are made-up examples.
How it works

The money stays behind the wall.

01
Fill the moat

Put USDG into your Moat. It's yours: top up or take it out at any time.

02
Set the rules

Daily budget, max per call, the APIs the agent may pay, and an off switch.

03
Give the agent a key

The agent gets a spending key that can only pay through Moat. It can't send money anywhere else.

04
Every payment is checked

When an API answers with a 402, Moat checks the rules first. Pass: it pays. Fail: it refuses.

Rules

Six walls around your money.

Daily budget

A hard limit per day. When it's used up, payments stop until tomorrow.

Max per call

One payment can't be bigger than your cap. A surprise $40 call is refused.

Allowed APIs

The agent can only pay hosts on your list. Anything new needs your OK.

Off switch

Pause all spending with one click. The agent keeps running, the money doesn't.

Alerts

Get a message when the agent reaches 80% of its budget or gets blocked.

Full log

Every payment and every refusal, with the amount, the API and the transaction.

Setup

Two files.

Write the rules, then point your agent's payments at Moat. Works with any x402 API.

moat.yaml

agent: research-agent
budget:
  per_day: 5.00 USDG
  per_call: 0.25 USDG
allow:
  - weather.example
  - prices.example
  - summarize.example
alerts:
  at: 80%
  to: telegram

agent.js

import { moat } from "moat"

// the key can only pay through Moat
const pay = moat(process.env.MOAT_KEY)

const res = await pay.fetch(
  "https://weather.example/now?city=Lisbon"
)
// 402 → Moat checks rules → pays 2¢ → 200 OK
// over a limit → refused, nothing paid
FAQ

Questions

Can the agent take all the money?

No. Its key can only make payments through Moat, and only inside your rules. It can't withdraw or send money to its own address.

What if the agent's key leaks?

Whoever has it can still only spend inside your rules, on your allowed APIs. Pause or replace the key with one click.

Can I take my money out?

Yes, any time. Only you can withdraw from your Moat.

Does the agent need ETH for gas?

No. Payments go through x402: the agent's key signs a USDG transfer and the facilitator pays gas.

Which APIs work with it?

Any API that takes x402 payments in USDG on Robinhood Chain, including APIs behind a pay gate or from a paid-API directory.

Is there a token?

No. Moat works with USDG only.

Give it money.
Keep the moat.

Your agent pays for what it needs, and not a cent more.