Guides / Buying tariff data from an agent: x402 in practice

GUIDE · BUYING TARIFF DATA FROM AN AGENT: X402 IN PRACTICE

Buying tariff data from an agent: x402 in practice

How an agent pays per call with x402, and when a prepaid key is the better fit.

The problem

An agent needs one tariff rate. Creating an account, entering a card, and managing an API key is more work than the answer is worth. x402 turns the HTTP 402 status into a payment: the server quotes a price, the client signs a stablecoin transfer, the facilitator settles, the server returns the data.

The flow

GET /v1/landed-cost?code=6109.10.00&value_usd=10000
402 Payment Required
  accepts: [{ scheme: exact, network: eip155:8453, amount: "10000", asset: USDC }]

# client signs an EIP-3009 authorization and retries
GET ... PAYMENT-SIGNATURE: <base64 payload>
200 OK  { landed_cost_usd: 14197.14, ... }

No account, no key, no invoice. Settlement is on-chain USDC, and the server sees a transaction hash from the facilitator.

When a key is better

If you call thousands of times a day, a prepaid key removes per-call signing and lets you meter internally. This service supports both: x402 per call, or a prepaid key with a quota. MCP clients can send X-API-Key, and get 20 free paid-tool calls per day without one.

What to check before integrating

Checked 2026-12-01. Informational, not a customs ruling or legal advice.