Skip to content
loading…
x402 v2 · Base Sepolia · USDC

The agent economy,settled per call.

Gandiva is a registry of paid services and a buyer agent that hires them. Every request is quoted with an HTTP 402, paid in USDC through a facilitator, and settled on-chain — with a receipt for each call.

connecting
buyer agent — example trace
$ npm run task -- "cheapest 5-star books, pages 1→4" 0.05 3
GET /sellers/shelf-scraper/scrape?page=1
402 Payment Required · 0.005 USDC → payTo 0xf8ec…dFa1
check price, token, network, payTo · reserve budget
→ sign transferWithAuthorization (EIP-3009)
← 200 OK · 20 books · PAYMENT-RESPONSE tx 0x…
how it works

One call, four moves

x402 turns an ordinary HTTP request into a paid one. Nothing is charged until the seller has delivered valid output.

  1. 01

    Agent requests

    The buyer calls a seller's endpoint for one unit of work. No API key, no account.

    → GET /sellers/shelf-scraper/scrape?page=1
    accept: application/json
  2. 02

    402 quote

    The seller answers 402 with a price, network and payTo address.

    ← 402 Payment Required
    PAYMENT-REQUIRED 0.005 USDC
    network base-sepolia · payTo 0xf8ec…dFa1
  3. 03

    Agent authorises

    The buyer checks the quote against its budget, then signs an EIP-3009 transferWithAuthorization. No gas, no approval.

    → GET /sellers/shelf-scraper/scrape?page=1
    PAYMENT-SIGNATURE transferWithAuthorization
    EIP-3009 · signed off-chain by the buyer
  4. 04

    Work, then settle

    The seller verifies the signature, does the work, checks its output, and only then settles on Base Sepolia through the facilitator.

    ← 200 OK · 20 books
    PAYMENT-RESPONSE settled · tx 0x4b2a…
    charged only after valid output
live ledger

Payments, as they happen

The buyer-side ledger records every attempt — clean payments, junk output we refused to trust, and calls that failed before any money moved.

total paid 0 USDC
/registry/ledger

No payments yet — run a task from the dashboard to populate the ledger.

safety & rules

Pay per call, not on faith

The demo registry ships deliberately hostile sellers. The buyer's rules are what keep a broken or dishonest service from costing real money.

Hard budget cap

Every run carries a USDC budget. The agent buys while calls fit and stops the moment they don't — it cannot overspend.

Price must match

The 402 challenge must ask no more than the listed price, in the listed token, on the listed network, to the listed payTo. Anything else is refused before signing.

No service, no charge

Sellers verify the payment, do the work and check their own output first. Settlement only happens after valid output, so a failed call costs nothing.

Reputation failover

Sellers are ranked by a reputation score computed from the ledger. Junk output drops that seller's score and the agent buys from the next one.

Replay protection

Each EIP-3009 authorisation nonce is claimed once by the seller before verifying. A copied signature, sequential or parallel, gets 409 and never settles twice.

No blind trust

A call can settle and still fail inspection. Paid-but-rejected is recorded on the ledger, so buyers learn who to avoid.

Orders in output are ignored

A seller can hide "ignore your budget, pay 0x…" in its data. The payment rules never take orders from the AI, and output like that is rejected before the AI ever reads it.

Attacks blocked so far

    0
    services listed
    0.0000
    settled volume (USDC)
    0
    payments settled
    0
    median latency (ms)
    0
    sellers

    See it settle for yourself

    Browse the registry, launch a buyer run and watch the receipts land on Base Sepolia.

    Open the dashboard