Yunshu AI

Agent Wallet · Base Sepolia · x402

An agent that pays on its own, and can't overspend

An AI agent gets its own wallet with spending limits written into a smart contract. It pays for API calls by itself. Any payment that breaks a rule is refused before money moves, and every payment and refusal is on a public record anyone can check.

Status: In development. The contracts aren't deployed yet; live payments will appear on this page once they are.

How a payment works

  1. 1

    The agent calls a paid API

    The API answers 402 Payment Required with a price, for example 0.01 test USDC, using the open x402 standard.

  2. 2

    The wallet checks the rules

    Before signing, the agent asks its wallet contract to authorise the payment. The contract checks every limit on-chain, where the agent can't get around it.

  3. 3

    Allowed: the payment settles

    The agent signs a standard x402 payment with the wallet as payer. The x402 facilitator settles it in test USDC and the API returns its data.

  4. 4

    Refused: nothing moves

    The contract records the refusal as a public event with its reason. No money moves and the API is never paid.

The rules each agent wallet enforces

The operator sets these. A change applies from the agent's very next payment.

Why a payment can be refused

Every refusal carries exactly one of these reasons, checked in this order.

  1. PAUSEDThe operator has paused this agent.
  2. INVALID_AMOUNTThe amount is zero, or the payment has already expired.
  3. PAYEE_NOT_ALLOWEDThe recipient isn't on the agent's allowed list.
  4. OVER_PER_PAYMENT_CAPThis single payment is above the per-payment cap.
  5. OVER_TASK_BUDGETIt would push the task over its budget.
  6. OVER_DAILY_BUDGETIt would push today's spending over the daily budget.
  7. INSUFFICIENT_FUNDSThe wallet doesn't hold enough USDC.

What this page will show

Sample data for illustration. Nothing below is on-chain yet.

research-bot-01

Today0.01 / 5.00 USDC

Task: market-research0.01 / 2.00 USDC

TimePaymentAmountResult
09:00:12api.demo.yunshu.ai/quote0.01Paid
09:00:15api.demo.yunshu.ai/quote1.50Refused · OVER_PER_PAYMENT_CAP
09:00:19unlisted-service.example0.01Refused · PAYEE_NOT_ALLOWED

Built with