
Let your agentfund itself
Top up your PacketExchange balance with one signed USDC payment on Base, then spend it on voice, SMS and numbers. No card on file, no person in the loop, no gas to hold.
Three HTTP steps, about as long as one API call
x402 is an open standard that uses the HTTP 402 Payment Required status to let software pay for what it needs. An x402 client such as x402-fetch runs every step for you.
Ask to top up
POST /topups/x402 with the amount in dollars. With no payment attached, the API answers HTTP 402 with the exact terms: network, USDC amount, receiving address and the signing domain.
Sign and retry
The wallet signs a USDC transferWithAuthorization for exactly those terms, puts it in an X-PAYMENT header and sends the same request again. It needs no ETH: we broadcast it and pay the gas.
Credited, with a receipt
We verify the signature, settle the USDC on-chain and credit your balance. The response returns the new balance and an X-PAYMENT-RESPONSE header with the transaction hash.
A few lines, and the balance is funded
Wrap fetch with an x402 helper and the 402, sign and retry steps happen on their own. The call returns once your balance is credited, with the settlement transaction hash.
An agent pays its own way
Your agent tops up when its balance runs low and carries on sending SMS and calls, with no card on file and nobody approving each payment.
USDC on Base
Pay in USDC on Base mainnet. The balance is credited in US dollars and behaves exactly like a card, crypto or wire top-up from then on.
Your keys stay yours
USDC moves straight from your wallet to our receiving address. The signed authorization carries a one-time nonce, so it cannot be replayed.
No gas to hold
We broadcast the signed authorization and cover the network fee, so the wallet only needs the USDC it is paying with.
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
// The agent's wallet holds USDC on Base. No ETH needed: gas is covered.
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const wallet = createWalletClient({ account, chain: base, transport: http() });
// Handles the 402 -> sign -> retry handshake for you.
const fetchWithPay = wrapFetchWithPayment(fetch, wallet);
const res = await fetchWithPay("https://packetexchange.io/api/v1/topups/x402", {
method: "POST",
headers: { "Authorization": "Bearer wmmn_live_sk_...", "Content-Type": "application/json" },
body: JSON.stringify({ amountUsd: 25 }),
});
console.log(await res.json()); // { status: "confirmed", txHash, newBalance, ... }Before you wire it in
- What it is
- A way to fund your prepaid balance. It is not a charge per API request: SMS, calls and numbers still bill from the balance, exactly as they do for any other top-up.
- Amount
- From $5 to $50,000 per top-up.
- Network
- USDC on Base mainnet. Every 402 challenge names the network and the USDC contract, so the wallet always signs for the right chain.
- Access
- An API key with the
billing:writescope. Top-ups pass the same account and velocity checks as every other funding method. - From an agent
- MCP clients can use the
wmmn_topup_x402tool, which calls the same endpoint. - For people
- x402 needs a wallet that can sign, so it is a rail for software. In the dashboard you top up by card, crypto deposit or bank wire.