---
name: agent-payments
description: Pay Vealth's x402 endpoints programmatically — work packets, proof checks, carbon retirement, method templates — as an agent or developer. Use when building an agent that should buy bounded ecological-work artifacts with one HTTP call, when a vealth.net endpoint answers HTTP 402, or when wiring x402 payments (USDC on Base, USDG on Robinhood Chain) into an autonomous loop. Keyless: no API key, no account — the payment IS the authentication.
---

# Paying Vealth over x402

Every paid Vealth endpoint is a standard **x402 v1** gate: call it unpaid and
it answers `HTTP 402` with an `accepts[]` array telling you exactly what to
pay, where, and on which network. Sign one EIP-3009 authorization, retry the
call with the `X-PAYMENT` header, get the artifact. No facilitator, no
registration, no custody — the recipient broadcasts your authorization and
your wallet pays exactly the listed price.

## Discovery (free)

- `GET https://vealth.net/data/x402-catalog.json` — every paid endpoint with
  its live price. Flagships: `/work-packet` $0.10 · `/health-packet` $0.05 ·
  `/work-proof-check` $0.01 · `/retire-attach` $0.25 · method templates and
  scorers from $0.005.
- `GET https://vealth.net/.well-known/x402` — the standard manifest.
- Any paid endpoint, called unpaid → its own 402 challenge. **Always read the
  price from the challenge, never hardcode it.**

## The payment, step by step

1. `POST` the endpoint with your JSON body and no payment → `402` +
   `accepts[]`.
2. Pick a requirement you can pay: network `base` (USDC, chainId 8453) or
   `eip155:4663` (USDG, Robinhood Chain). Honest caveat: the Robinhood lane is
   x402 **v1 wire with a CAIP-2 network label** — CAIP-2-aware clients settle
   fine; a strict v2-only client may not.
3. Sign EIP-3009 `transferWithAuthorization` typed data for the EXACT amount
   to the EXACT `payTo` in the challenge, with a fresh random nonce. Build the
   EIP-712 domain from the challenge's asset fields — do not assume Base
   values on 4663.
4. Retry the same request with the signed payload in the `X-PAYMENT` header.
   The server verifies, simulates, broadcasts, confirms, then runs your call.
5. `200` = artifact + onchain settlement you can independently verify.

## Retry semantics (built for autonomous loops)

- Same payment credential + same body replays the SAME result with **no second
  charge** — durable, survives server restarts. Safe to retry on timeouts.
- Same credential + a DIFFERENT body is refused (402). One payment buys one
  artifact.
- Over- and underpayment are both rejected; the exact amount or nothing.

## Reference client

`https://vealth.net/recipes.html` — runnable recipes + `x402-pay.mjs`, a
zero-dependency client that does the whole dance (dry-run by default: it
parses the challenge and shows you what it WOULD pay before anything signs).
Copy it or port the ~100 lines to your stack.

## Rules that keep you safe

- Dry call first, always — it is free and shows the live price.
- Never send funds to an address that did not come from the live 402
  challenge.
- Budget-cap your loop client-side; the server will happily sell you one
  artifact per payment, forever.
- Wallet needs only the artifact price + nothing else: gas is not your
  problem (EIP-3009 is gasless for the payer).

---
*Everything settles to a published treasury and every claim is verifiable
onchain. Full protocol surface: vealth.net/agents · vealth.net/api.html.
Questions: brawlaphant@gmail.com*
