Start with a wallet that has one job

Your agent needs a payer wallet for Base mainnet, chain ID 8453. Make it a hot wallet with a limited balance and a narrow purpose: paying for HTTP requests.

Don't connect it to a personal treasury. Don't give the private key to the model. The agent can ask for a payment, but signing should happen inside the wallet process or SDK.

Store the key outside prompts and logs. Set spending limits in your application. Keep the wallet replaceable.

That separation matters once your agent starts making calls on its own.

Add a $10 USDC starter balance

Fund the wallet with $10 USDC on Base. That gives the agent room to test payment handling before you add larger limits.

The current agentutility registry lists 794 endpoints, with prices from $0.001 to $0.50 per request. At those listed prices, $10 covers 20 calls at the top end or 10,000 calls at the low end, before any other costs.

Start with less if you're testing a new payment loop. A failed retry shouldn't drain the wallet.

You may also want a small amount of Base ETH if the agent will submit a separate on-chain transaction, such as an ERC-8004 registration. x402 payment handling and wallet transactions aren't always the same flow, so check what your chosen SDK and service expect.

Use the SDK's signed-authorization helpers

An x402 server can answer an unpaid request with HTTP 402 Payment Required. That response contains the payment details your agent needs, including the amount, recipient, network, and resource.

Your SDK's signed-authorization helper should read those details, ask the wallet to sign, and return the payment header for the retry. Sign the exact requirement from the response. Don't invent an amount from a cached value.

An illustrative flow looks like this:

const response = await fetch("https://api.example.com/paid-resource");

if (response.status === 402) {
  const requirements = await response.json();

  const authorization = await wallet.signPaymentAuthorization({
    requirements
  });

  const paidResponse = await fetch("https://api.example.com/paid-resource", {
    headers: {
      "PAYMENT-SIGNATURE": authorization
    }
  });

  if (!paidResponse.ok) {
    throw new Error(`Paid request failed: ${paidResponse.status}`);
  }

  return paidResponse.json();
}

The method name will vary by SDK. The sequence won't: request, read 402, sign the returned terms, retry with the authorization.

Log the request ID, amount, resource, and final status. Never log the private key or raw signing material.

Test one paid request by hand

Before giving the wallet to an autonomous loop, make one request with a fixed budget.

Check that:

  • The request reaches the intended Base endpoint.
  • The 402 response contains usable payment requirements.
  • The signed authorization is attached to the retry.
  • The response body matches the resource you paid for.
  • A repeated request doesn't happen just because the first response was slow.

Set a timeout. Add a retry limit. If the payment succeeds but the response fails, your application needs a clear policy for that case. It may retry the resource, stop for review, or record the result for later reconciliation.

Add ERC-8004 only if discovery needs it

ERC-8004 registration is optional. Add it when your agent needs a public, chain-visible identity that other agents or applications can inspect.

Registration can come after the first successful x402 call. The wallet should already be able to receive USDC, sign payment authorizations, and report failures in a way you can inspect.

Keep the registration decision separate from payment setup. An agent can pay for HTTP resources without registering an ERC-8004 identity, and a registered identity doesn't remove the need for a properly funded payer wallet.

At launch, the useful milestone is small: one wallet, $10 USDC, one signed x402 request, and a spending limit you understand. Start there.