switch402

Do You Need ETH for Gas to Pay an x402 API? Paying in USDC on Base, Explained

No, not for an x402 exact payment in USDC. Per the x402 exact-scheme spec for EVM chains, the client signs an EIP-3009 transferWithAuthorization message off-chain, and the facilitator broadcasts it and pays the gas; it cannot change the amount or the recipient. Here is how to read the payment terms switch402 returns, which USDC contract they point to, and what an agent wallet needs to hold. All facts checked Oct 30, 2026.

  • No ETH needed to pay

    The wallet signs a message; it never sends a transaction for the payment. The spec says the facilitator pays the gas and acts only as the transaction broadcaster.

  • Only USDC on Base

    switch402 asks for asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, which is USDC on Base per Circle's published contract list.

  • Amounts use 6 decimals

    amount 8000 means 0.008 USDC. The authorization is for that exact value and that payTo address only.

  • Short-lived signatures

    maxTimeoutSeconds is 60, so a signed payment is meant to be used straight away, not stored.

Reading switch402's live 402 payment terms

FieldLive valueWhat it means
x402Version2x402 v2 terms, sent in the PAYMENT-REQUIRED header and the JSON body
schemeexactPay exactly this amount, signed with EIP-3009 for USDC
networkeip155:8453Base mainnet (chain ID 8453)
asset0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913USDC on Base, matching Circle's list
amount80000.008 USDC (6 decimals)
payTo0x3c1A1E01e790Cd326495631B3b38Bd7068F08d6Fswitch402's receiving address
maxTimeoutSeconds60How long the signed payment is valid for
extraname "USD Coin", version "2"The token's EIP-712 domain, used to build the signature

Values are from an unpaid POST /v1/scrape on Oct 30, 2026. Always check the asset address against the token issuer before paying any x402 API.

Sources, checked Oct 30, 2026: x402 exact scheme on EVM (spec), Circle: USDC contract addresses, api.switch402.com/openapi.json. Prices can change; check the source before you decide.

What a balance buys: $1 of USDC on Base covers 125 successful scrapes at $0.008, and $5 covers 625. Failed calls are not charged, and the wallet needs no ETH for these payments.

Code example

curl: decode the PAYMENT-REQUIRED header yourself (free)

curl -s -D - -o /dev/null -X POST https://api.switch402.com/v1/scrape \
  -H 'Content-Type: application/json' -H 'User-Agent: my-agent/1.0' \
  -d '{"url":"https://example.com"}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 -d
# {"x402Version":2,...,"accepts":[{"scheme":"exact","network":"eip155:8453",
#   "amount":"8000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",...}]}

JavaScript: check the asset before you let an agent pay

// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from '@x402/fetch'
import { ExactEvmScheme } from '@x402/evm'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount(process.env.AGENT_KEY)
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(account) }],
})

const USDC_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
const probe = await fetch('https://api.switch402.com/v1/scrape', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'User-Agent': 'my-agent/1.0' },
  body: JSON.stringify({ url: 'https://example.com' }),
})
const terms = (await probe.json()).accepts[0]
if (terms.asset !== USDC_BASE || Number(terms.amount) > 8000) throw new Error('unexpected terms')

const res = await fetchWithPayment('https://api.switch402.com/v1/scrape', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'User-Agent': 'my-agent/1.0' },
  body: JSON.stringify({ url: 'https://example.com' }),
})
const { markdown } = await res.json()

FAQ

Is switch402 live?
Yes. POST https://api.switch402.com/v1/scrape with {"url": "..."} returns the page as markdown for $0.008 USDC on Base per call, paid over x402 and charged only on success. A lower-cost endpoint, /v1/scrape/lite, is $0.003 per call.
Do I need ETH on Base to pay x402 APIs?
Not for x402 exact payments in USDC: the facilitator pays the gas, per the x402 exact-scheme spec for EVM. You need a little ETH on Base only if the wallet sends ordinary transactions itself, such as moving USDC to another address.
How do I get USDC on Base into an agent wallet?
Send or withdraw USDC to the agent wallet address and choose the Base network, from any exchange or wallet that supports it. Check that the token received is the USDC contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. Use a dedicated wallet with a small balance for an agent.
Can the server or facilitator take more than the price?
No. The wallet signs an authorization for an exact value to an exact payTo address within a short validity window, and the spec says the facilitator cannot modify the amount or destination.
Is there a testnet I can try first?
x402 works on Base Sepolia, where Circle lists test USDC at 0x036CbD53842c5426634e7929541eC2318f3dCF7e. switch402 itself only accepts Base mainnet (eip155:8453), so test there with your own x402 server.
Am I charged when a call fails?
Not on switch402. Payment settles only after content comes back; no provider returning content (502) and a paused service (503) are not charged.

Next steps