Non-custodial crypto payments for AI agents. Buy and sell over a single HTTP 402 challenge, in any coin — Bitcoin, EVM, stablecoins, Solana, Tron, and more. The 402 Online Protocol, live.
The agent + merchant surface for the 402 Online Protocol — a non-custodial way for AI agents, humans, and merchants to pay and be paid over plain HTTP.
A buyer requests a priced resource; the server answers HTTP 402 with a list of every way to pay (accepts[]) — one entry per accepted coin. The buyer picks one, pays the seller's own wallet the exact amount. The platform detects the payment on-chain and settles automatically (within a few minutes). To settle instantly, the buyer can optionally POST the transaction hash to /v1/verify. No cryptographic proof is needed; the chain itself is the proof. No one in the middle holds funds.
Everything an agent or merchant needs to charge for — and pay for — digital goods, without custody.
Price a resource in fiat; offer every coin you can receive. Buyers pay your wallet. HMAC-signed webhooks on settlement + a settlement ledger.
Fetch a 402 door, pick any coin, pay the exact amount — the platform auto-detects it on-chain and settles. Optionally POST the tx hash to settle instantly. No seller key needed — the challengeId authorizes; on-chain confirmation gates settlement.
BTC (+Lightning), ETH + all ERC-20s, USDT/USDC, Solana, Tron, XRP, Monero, UCASH, custom tokens. Anything with an address.
Funds move direct buyer→seller — the platform never touches the payment. The fee is a separate prepaid credit the seller prepays; no intermediary ever holds the transaction. Not a money transmitter.
The human behind each agent gets a full dashboard on pay.u.cash to audit, track, and analyze every transaction. Autonomy plus transparency.
API-key auth, idempotent verify, settlement history, and an MCP tool surface + JS/Python SDKs.
The 402 door serves a payable HTML page (addresses, exact amounts, QR codes) to browsers — and JSON to machines. One link works for both.
Each merchant publishes a machine-readable catalog (/catalog.json, schema.org) + a UCP profile (/.well-known/ucp). Buyers create multi-item checkout sessions (mixed-currency carts) via /checkout-sessions, with AP2 mandate authorization + RFC 9421-signed responses. Non-custodial; settles on our detect + redirect rails.
Become a seller in four calls. Base URL: https://agents.u.cash
# register (wallet-first; no email loop)
curl -X POST https://agents.u.cash/v1/signup \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","password":"longpass"}'
# -> {"response":{"api_key":"…","activated":false}}
# top up >= $1 to activate (pays + activates on confirmation)
curl -X POST https://agents.u.cash/v1/top-up \
-H 'X-Api-Key: $KEY' -d '{"amount":1}'
# set your receive address (where buyers pay you)
curl -X POST https://agents.u.cash/v1/wallets \
-H 'X-Api-Key: $KEY' -d '{"asset":"btc","address":"bc1q…"}'
# create a priced resource
curl -X POST https://agents.u.cash/v1/resources \
-H 'X-Api-Key: $KEY' -d '{"amount":0.05}'
# -> {"response":{"res_id":"res_…"}}
# share: https://agents.u.cash/r/{res_id}
POST /v1/stripe with your own Stripe keys (the key + product are verified first), then register the returned webhook endpoint in your Stripe dashboard. Buyers then get a card entry in accepts[] alongside the coins; card payments settle direct to your Stripe account.# fetch the 402 door (no key needed)
curl https://agents.u.cash/r/res_… | jq '.response.accepts[0]'
# -> {"scheme":"detect","asset":"btc","payTo":"bc1q…","amount":"16230","challengeId":"chal_…"}
# pay `payTo` exactly `amount` from your wallet. The platform detects
# the on-chain payment and settles automatically (GET /r/{res_id} ->
# {"settled":true} within minutes) — nothing else required.
# To settle instantly instead, POST the on-chain tx hash (optional):
curl -X POST https://agents.u.cash/v1/verify \
-H 'Content-Type: application/json' \
-d '{"challengeId":"chal_…","hash":""}'
# -> {"settled":true} | {"status":"pending","confirmations":0,"required":3}
https://agents.u.cash/r/{res_id} gets a payable page with QR codes instead of JSON. Crypto buyers pay a detect entry direct to the seller's own wallet; if the seller connected Stripe (POST /v1/stripe), buyers also get a card (redirect) option.# buyer-side: create a multi-item checkout session (merchant from ?cloud=)
curl -X POST https://agents.u.cash/checkout-sessions?cloud=<merchant-token> \
-H 'Content-Type: application/json' \
-d '{"line_items":[{"item":{"id":"res_..."},"quantity":1}],"currency":"USD"}'
# -> {"id":"cs_...","status":"incomplete","line_items":[...],"ap2":{"merchant_authorization":"..."}}
# complete -> mints the per-coin payment challenges
curl -X POST https://agents.u.cash/checkout-sessions/cs_.../complete?cloud=<merchant-token>
# the buyer pays each challenge; the session auto-completes on settlement
# GET /orders/cs_... -> per-item fulfillment status
Auth: send api_key in the X-Api-Key header (from /v1/signup). Full machine spec: OpenAPI · llms.txt.
| Method | Endpoint | Auth | Purpose |
|---|---|---|---|
| POST | /v1/signup | public | Register → api_key (wallet-first) |
| POST | /v1/top-up | key | ≥$1 checkout; activates the account on confirmation |
| GET | /v1/agent | key | Balance, activation, wallets, webhook, earnings summary |
| POST | /v1/agent | key | Set the settlement webhook URL |
| POST | /v1/wallets | key | Set your receive address for an asset |
| POST | /v1/stripe | key | Connect your own Stripe account → card (redirect) rail; key + product verified first |
| GET | /v1/stripe | key | Masked Stripe config + the webhook endpoint to register |
| POST | /v1/custom-tokens | key | Add a custom token (ERC-20/TRC-20/SPL); then /v1/wallets to set its receive address |
| GET | /v1/custom-tokens | key | List your custom tokens |
| DEL | /v1/custom-tokens?code= | key | Remove a custom token |
| GET | /v1/settings | key | Read safe settings (confirmations, webhook url+secret, currency, payment prefs, notifications, branding) |
| PUT | /v1/settings | key | Partially update safe settings; webhook.rotate_secret mints a new signing secret |
| GET | /v1/settlements | key | Earnings log (settled/underpaid payments) |
| Method | Endpoint | Auth | Purpose |
|---|---|---|---|
| POST | /v1/resources | key | Create a priced resource → res_id |
| GET | /v1/resources | key | List resources (or fetch one ?res_id=, with settled state) |
| POST | /v1/challenge | key | Build the multi-coin accepts[] for a resource |
| Method | Endpoint | Auth | Purpose |
|---|---|---|---|
| GET | /r/{res_id} | public | The 402 door → 402 + accepts[] (JSON) or a payable page (HTML); 200 if settled |
| POST | /v1/verify | challengeId | Verify + settle instantly (tx hash) — optional; payment also auto-settles via on-chain detection. Buyer-push, no key needed |
Rate limits (per IP): signup 10/hr, others 30–60/min, /r/ 120/min. Over → 429 uxc_rate_limited. Errors: {success:false, error_code, message}.
| Method | Endpoint | Auth | Purpose |
|---|---|---|---|
| POST | /checkout-sessions | ?cloud= | Create a checkout session (multi-item cart, mixed-currency) |
| GET | /checkout-sessions/{id} | ?cloud= | Fetch a session (incomplete -> ready_for_complete -> completed) |
| POST | /checkout-sessions/{id}/complete | ?cloud= | Mint payment challenges; optional AP2 mandate |
| GET | /orders/{id} | ?cloud= | The order (per-item fulfillment status) |
| POST | /catalog/search | ?cloud= | Search the merchant catalog |
UCP endpoints resolve the merchant from the host or ?cloud=<token>; no X-Api-Key. Responses are RFC 9421-signed (ES256). Rate-limited per IP (checkout 60/min, catalog 120/min, orders 60/min).
agents.u.cash is built for autonomous agents. Drive the whole seller surface as tools, or integrate from code with zero-dependency SDKs.
https://pay.u.cash/admin with the email + password from signup to see the agent 402 sales, credit balance, and per-sale fee history.Run the stdio MCP server with your API key and Claude (or any MCP client) gets tools: uxc_create_resource, uxc_set_wallet, uxc_list_resources, uxc_get_settlements, uxc_view_door, uxc_verify_payment…
// claude_desktop_config.json
{
"mcpServers": {
"agents-u-cash": {
"command": "php",
"args": ["/path/agents/mcp/server.php"],
"env": { "UXC_API_KEY": "your_key" }
}
}
}
# Python
pip install agents-u-cash
# JavaScript
npm install agents-u-cash
from agents_u_cash import AgentsUCash
agent = AgentsUCash(api_key="…")
agent.set_wallet("btc", "bc1q…")
res = agent.create_resource(amount=0.05)
acc = agent.create_challenge(res["res_id"])
llms.txt — the full API, flows, concepts, and links in one plain-text file (point an LLM here).accepts[], security model).