Build USDC transfer authorization

$0.003 per call · USDC via x402 · POST /api/transfer-authorization

Build the EIP-3009 transferWithAuthorization typed data for a gasless USDC transfer on Base/Polygon/Arbitrum/Optimism/Ethereum/Monad/Celo/Avalanche/Sei - the exact EIP-712 object an agent signs with its OWN key to authorize an x402 payment. Send POST /api/transfer-authorization with the required fields from, to and amount and pay $0.003 per call over x402 or MPP (there is no free tier). It returns a JSON object with typedData and network.

We construct it; we never sign or send. Non-custodial.

Category: Payments & x402 · Tags: x402 eip-3009 eip-712 usdc transfer authorization gasless multichain

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
fromstringyespayer address (the wallet that will sign) Also accepted as source, src, start.
tostringyesrecipient address Also accepted as target, dest, destination, end.
amountnumberyesUSDC amount (e.g. 0.01)
networkstringnochain: base | polygon | arbitrum | optimism | ethereum | monad | celo | avalanche | sei | robinhood (default base)
validForSecondsnumbernohow long the authorization is valid (default 3600)

Example request

curl -i -X POST https://agent402.tools/api/transfer-authorization \
  -H "Content-Type: application/json" \
  -d '{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","amount":0.01,"network":"base"}'

Without payment this returns HTTP 402 Payment Required with the exact price for transfer-authorization; any x402 v2 or MPP client pays it and retries.

Example response

{
  "typedData": {
    "domain": {
      "name": "USD Coin",
      "version": "2",
      "chainId": 8453,
      "verifyingContract": "0x833589f…"
    },
    "primaryType": "TransferWithAuthorization",
    "message": {}
  },
  "network": "base"
}
FieldTypeAlways presentIn the example
typedDataobjectyes3 fields: domain, primaryType, message
networkstringyesbase

From an MCP client

catalog.call {
  "slug": "transfer-authorization",
  "params": {
    "from": "0x1111111111111111111111111111111111111111",
    "to": "0x2222222222222222222222222222222222222222",
    "amount": 0.01,
    "network": "base"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for transfer-authorization; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/transfer-authorization", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "from": "0x1111111111111111111111111111111111111111",
    "to": "0x2222222222222222222222222222222222222222",
    "amount": 0.01,
    "network": "base"
  }),
});

Related tools

Verify x402 settlement

$0.004 · GET /api/x402-verify

Confirm a USDC payment actually settled: given a tx hash (and network), returns whether it succeeded and the USDC transf…

USDC balance

$0.003 · GET /api/usdc-balance

Read the USDC balance of any address on Base, Polygon, Arbitrum, Optimism, Ethereum, Monad, Celo, Avalanche, or Sei. Rea…

B20 payment memos

$0.005 · GET /api/b20-memos

Payment memos attached to B20 transfers: pairs each Memo(address,bytes32) log with its Transfer at the previous log inde…

Rate a call you paid for

$0.001 · POST /api/feedback

Tell this server whether a call you paid for delivered what it promised. Bound to the receipt: give it the settlement tr…

Gas price

$0.001 · GET /api/gas-estimate

Current gas price on Base, Polygon, Arbitrum, Optimism, Ethereum, Monad, Celo, Avalanche, Sei, or Robinhood Chain - for …

My usage (wallet-keyed purchase history)

$0.005 · POST /api/my-usage

Your own purchase history, keyed to the wallet that pays for the call - no wallet parameter, no signup: the x402 payment…