v0.7.6 · Open source · Self-hosted · Testnet by default

The programmable Web3
cloud wallet for AI bots.

Self-host this open-source wallet on your own cloud server. Connect Codex, Claude Code and cloud agents to one wallet funded by you or your organization. Give each bot a revocable MoneyKey with its own budget, allowed service domains and human approval rules. Manage approvals and bills in one place.

Your wallet. Separate agent budgets. One place for approvals and bills.

Found a docs issue or an agent integration gap? The contribution guide helps you turn it into a pull request.

Why we built it: a Web3 cloud wallet for AI bots →

Many devices. One wallet you control.

Architecture · example
YOUR COMPUTERS

Codex · Claude Code

Local agents · a MoneyKey for each

mk_live_••••
YOUR CLOUD SERVERS

Agents & scripts

Remote jobs · separate spending limits

mk_live_••••
SELF-HOSTED BY YOU

MoneySwitch

One spending wallet

  • Per-request · daily · total limits
  • Allowed hosts · approvals · revocation
  • Bills for all your MoneyKeys
Wallet signing stays in this service
PAY PER REQUEST

Paid APIs

x402 · USDC

Solana · Base · Monad

Testnet by default

The devices share a payment service, not a private key. Keep agents outside the wallet service’s system-user and data-directory boundary.

A wallet for your agent fleet

Add agents without setting up another wallet.

Your laptop, desktop and cloud jobs can use one MoneySwitch deployment. Issue a different MoneyKey to each agent so its limits, approvals and bills stay separate.

01

Fund one small spending wallet

Deploy it on your cloud server. You control the service, wallet and data, and fund it with your own USDC.

02

Give each agent a MoneyKey

Set per-request, daily and total limits, allowed domains and an approval threshold. Revoke a key when its job is done.

03

See the payments in one place

The Dashboard shows each payment’s key, amount, URL, chain and transaction hash. You can check which key paid for which endpoint.

Today, MoneySwitch pays x402-priced APIs in USDC. It does not pay ordinary model subscriptions or every website checkout.

The payment path

The agent asks. Your wallet checks.

your AI · moneyswitch replay · illustrative

An illustrative replay of a payment and an over-limit request. The payment hash is a real 0.01 test-USDC transaction by Claude Code with an earlier version. Limits constrain spending; they do not detect prompt injection or stop misuse within an allowed budget. Verify the payment ↓

A real payment and an example spending limit

01

An AI paid for something by itself.

Claude Code was asked to buy a paid report. The API answered HTTP 402 with a price, MoneySwitch checked the key's limits and signed — and a real USDC transfer settled on Monad testnet. Claude never saw a private key. (Made with an earlier version of MoneySwitch.)

  • Skill + REST: GET /v1/status, POST /v1/fetch, GET /v1/history
  • Gas paid by the facilitator — the wallet spent 0 MON
Payment settledMonad testnet
Agent
Claude Code
Bought
/premium-report
Price
0.01 USDC
Protocol
x402 · EIP-3009
Wallet gas
0 MON
Agent holds
mk_live_••••
See the 5 testnet transactions ↓

02

A $500 request meets a $0.20 limit.

In this policy example, a payment request above the per-request limit is refused with PER_REQUEST_LIMIT_EXCEEDED. MoneySwitch does not produce a signature for that request.

  • Per-request cap, max_price, daily / total budget and approval threshold are checked before signing
  • An allowed payment can still be a bad decision. Keep budgets small and review bills.

Example: an agent requests a $500 API purchase with a $0.20 per-request cap.

BLOCKEDPER_REQUEST_LIMIT_EXCEEDED
signature none moved $0.00

How it works

Program spending with the same pattern as an API key.

An agent needs the service URL, a MoneyKey and the ability to make HTTP requests. MoneySwitch checks the key’s policy and handles wallet signing. x402 is the payment mechanism behind the API.

  1. 1

    Agent

    An agent on your laptop or cloud server reads the skill and calls REST POST /v1/fetch.

  2. 2

    MoneyKey

    A revocable mk_live_… token issued by your administrator. Each key has its own limits; the service stores only its SHA-256 hash.

  3. 3

    Policy

    Check per-request, daily and total limits, max_price, allowed hosts and the approval threshold before signing.

  4. 4

    x402

    The API returns HTTP 402 with a price. MoneySwitch signs a USDC authorization from the small spending wallet on your server.

  5. 5

    USDC

    A facilitator settles the transfer and pays the gas. MoneySwitch supports USDC x402 payments on Solana, Base and Monad, with testnets enabled by default. The selected network must be enabled for the key and accepted by the API; an explicit network choice does not fall back to another chain.

  6. 6

    Paid API

    Receives USDC. No MoneySwitch account needed.

The service holds an encrypted hot wallet and the secret needed to unlock it after a restart. Anyone who can read the server’s data directory can use the wallet; anyone who can change its database can bypass policy. Separate agents from that machine or system user, restrict data access, and keep only a small balance. A MoneyKey does not grant wallet export or administrator access through the API.

Spending controls

A separate spending policy for each agent.

Revocable MoneyKeys

Give the agent a MoneyKey, not the wallet’s private key. Revoke that key to stop future API use. Keep wallet files and administrator credentials outside the agent’s access.

Per-request limit & max_price

Any single payment above the key's cap, or above the caller's max_price, is refused.

Daily & total budgets

Checked and reserved inside one database transaction, so concurrent calls can't overspend.

Human approval line

At or above the threshold, payment waits for approval. The person holding that key uses its 4–6 digit PIN, or an administrator signs in to approve. Keep the PIN with the person, not the agent. New approval requests expire after 30 minutes; approving does not extend that deadline. The agent then resumes the same request with approval_id. New public hosts also require approval; approval adds the host to that key.

Host allowlist

Governs every outbound request, including free ones. A public host that is not listed asks a person first, and nothing is sent until it is approved; private and special-use addresses can never be added that way.

SSRF guard

Requests to MoneySwitch’s own listening address (127.0.0.1, localhost, 0.0.0.0, ::1) are refused. The match is literal, not a DNS-rebinding defence; see SECURITY.md.

Also: every answer says charged: yes | no | maybe · payments with an unknown outcome count as spent, and the AI must not retry them · MoneyKey tokens are shown exactly once and stored only as SHA-256 hashes · a revoked key stops working immediately. Full threat model in SECURITY.md.

Your deployment

Self-host in the cloud. Keep control of the wallet.

One deployment spends for one payer: you or your organization. Run MoneySwitch on infrastructure you control, fund its wallet with your own USDC, and issue keys to your agents. This is self-hosted software, not a hosted wallet account.

Across your computers

Your laptop and desktop agents connect to the same service. Each gets a different key and spending budget.

Local and cloud agents

A cloud job uses the same wallet as your local agents through HTTP. Serve the wallet over HTTPS and keep its data isolated.

An organization’s own spending

Issue keys for staff agents and company bots. The organization funds the wallet; each key has its own limits and payment records.

Self-hosting means you operate the wallet service and protect its data. MoneySwitch does not hold funds on your behalf.

Scope today: your own spending wallet and x402 API payments. No customer deposits, fiat on/off-ramps, swaps, bridges or wallet imports. Your main wallet stays separate.

On-chain proof

Not a mockup. Every payment is a real transaction.

Verified real-USDC x402 payments on Solana, Base and Monad. These recent development checks link to their on-chain receipts; historical testnet records are shown separately below.

Solana · CoinGecko

0.01 USDC for on-chain market data. Mainnet settlement finalized.

View transaction ↗

Base · CoinGecko / Quicknode

0.01 USDC for CoinGecko market data and 0.001 USDC for a Quicknode RPC request. Both settled on mainnet.

CoinGecko ↗ · Quicknode ↗

Monad · AgentVerse

0.20 USDC to purchase two cells from our demo merchant. Mainnet payment and delivery verified.

View transaction ↗

5real testnet settlements
0.19test USDC settled in total
0 MONgas paid by the wallet
3mainnets with verified real-USDC payments

The records below were made on Monad testnet on 25 September and 2 October with versions before v0.7. Test USDC has no monetary value.

eip155:10143 Historical testnet records · test USDC, no real value
Time (UTC)TypeResourceUSDCTransaction

On Monad mainnet, with real USDC (made on 27 September, also with a version before v0.7): a key scoped to api.nansen.ai paid Nansen’s x402 API (0.01 USDC, tx 0x98297ba4…e5e9c ↗); later a Qwen agent spent a $0.09 key budget on five more queries by itself, and one more query was paid in an earlier Qwen run. The five Qwen hashes are in the blog post. On 5 October one wallet paid Nansen on both mainnets with v0.7.0: Base (0.01 USDC, tx 0x69d0f6f0…f2a5 ↗) and Monad (0.01 USDC, tx 0xd68d307a…af7e ↗).

Quickstart

Deploy once. Connect your agents.

$ git clone https://github.com/dongsheng123132/moneyswitch
$ cd moneyswitch
$ pnpm install --frozen-lockfile
$ pnpm build
$ node apps/server-pkg/dist/cli.js --data-dir ./data   # server + Dashboard on :4020
  • The first start prints an administrator token and a one-time sign-in link (valid 30 minutes, single use). Open the link: you are signed in and land on the Wallet page. Set MONEYSWITCH_PUBLIC_URL to the address people reach the server at: approval links and the skill text use it.
  • Wallet: create a dedicated spending wallet and write down the 12 recovery words, shown once. Start with test USDC on a testnet. It unlocks itself after a restart.
  • MoneyKeys: create one per agent with per-request, daily and total limits, allowed hosts, approval threshold and expiry. Keep the approval PIN with the person. Copy the key’s skill paragraph into the agent. To change a key’s limits, revoke it and issue a new one.
  • With Monad testnet enabled, a testnet key can use the test payment endpoint, even if mainnets are also enabled. When that endpoint is selected, the generated skill already asks for one test payment (no real value). Observe the result and transaction hash; do not ask the agent to pay again.
  • Approvals: a payment at or above its threshold waits for the key’s PIN holder or a signed-in administrator. Bills: review each payment’s key, amount, URL, chain, transaction hash and charged yes / no / maybe.
  • On a server: Docker Compose and HTTPS with persistent volume, health check, backup and rollback, see deploy/README.zh-CN.md. Do not run the server and the AI on the same machine under the same system user: the AI could edit the database and get around the limits.

Requires Node.js 22+ and pnpm. Testnet by default; enabling a mainnet means real USDC. See the README for deployment options.

Open source

Permissive where you embed it. Copyleft where you host it.

Apache-2.0

Skill & helpers

packages/skill (renders the text that tells an AI how to pay), packages/net (outbound proxy handling) and apps/demo-seller (a test x402 API).

AGPL-3.0-only

Server & Dashboard

The server, the Dashboard and the core, db, wallet and x402 packages stay copyleft: anyone who hosts a modified version must offer its source code to the people who use it.

Build the cloud wallet
your AI bots need.

Try a testnet payment, share where you got stuck, or send a PR that improves the docs or an agent integration.