Kit-priced MCP tools
Fixed-price tools like get_token_price at $0.001. Spend policy (optional) → payment requirements → verify → execute → settle → ledger entry.
x402 pay-per-call — settle on chain in stablecoins.
Agents pay when they use tools and APIs, not on a flat monthly API plan. Web3 Agent Kit runs x402 verify-and-settle through network-aware facilitators — x402.org on testnet, Coinbase CDP on mainnet — so every priced MCP call can finish with an on-chain receipt.
Fixed-price tools like get_token_price at $0.001. Spend policy (optional) → payment requirements → verify → execute → settle → ledger entry.
paid_fetch probes HTTPS resources, surfaces 402 and PAYMENT-REQUIRED, retries with x402 v2 paymentPayload, returns response data plus payment_details.
transfer prepares unsigned USDC, USDC.e, native, or Solana stablecoin txs for funding or payouts. Signing stays in your wallet (not x402, but same assets agents use to pay).
Built on @x402/core, @x402/evm (exact EVM scheme), and @coinbase/x402 for CDP mainnet facilitator auth. paid_fetch is x402-only in this build (no MPP/Tempo payment protocol).
The kit picks the facilitator from X402_NETWORK — no manual URL switching per environment when you change network id.
Used when X402_NETWORK is a known testnet CAIP-2 id: eip155:84532 (Base Sepolia, default), solana devnet, eip155:4801.
X402_TESTNET_FACILITATOR_URLdefault https://x402.org/facilitator
Legacy X402_FACILITATOR_URL accepted as fallback when testnet URL is unset.
Used for all other X402_NETWORK values (e.g. Base mainnet eip155:8453). Requires CDP_API_KEY_ID and CDP_API_KEY_SECRET via @coinbase/x402.
https://api.cdp.coinbase.com/platform/v2/x402Kit-priced MCP tools use ExactEvmScheme on the configured EVM network.
For priced tools, router evaluates spend policy, resolves payTo (X402_PAY_TO_ADDRESS or agent evmAddress), builds accepts[] via facilitator. Returns a Payment Required error with data.paymentRequirements (scheme: exact, network, payTo, price).
Host wallet or signing service produces x402 v2 paymentPayload matching an accept. The kit never holds private keys.
Facilitator verifies → tool executes → facilitator settles on chain.
result.content carries tool output (JSON text). result.paymentReceipt carries settlement metadata from facilitator.
If spend policy is enabled, agent_spend_ledger records USD micro-amount with idempotent requestKey (SHA-256 of agent + tool + payload).
paid_fetch calls the HTTPS URL. On a Payment Required response from the HTTPS endpoint (or v1 JSON body), MCP returns a Payment Required error with upstream requirements.
Client signs x402 v2 paymentPayload only (v1 rejected). Second call verifies via facilitator, adds PAYMENT-SIGNATURE headers, executes HTTP request.
Prefer PAYMENT-RESPONSE / X-PAYMENT-RESPONSE from origin; else settle via facilitator. Response includes payment_made, payment_details, status, ok, data.
Variable pricing — amount comes from the third party. Trust spend policy does not cap paid_fetch; use discover_services maxUsdPrice operationally.
X402_NETWORKCAIP-2 network (default eip155:84532); drives facilitator tier automatically
X402_TESTNET_FACILITATOR_URLOverride for testnet facilitator (default https://x402.org/facilitator)
CDP_API_KEY_ID / CDP_API_KEY_SECRETRequired for mainnet Coinbase CDP facilitator
X402_PAY_TO_ADDRESSOptional fixed pay-to for kit tools; else agent evmAddress
Discovery alignment: discover_services filters — network, asset (usdc), scheme, payTo, maxUsdPrice — so agents find services that match your payment rail before paid_fetch.
get_token_priceFixed $0.001/call · full x402 + optional spend policy + ledgerpaid_fetchThird-party x402 HTTPS · variable price · v2 paymentPayload onlytransferNot x402 — unsigned same-chain transfers to fund paying walletsdiscover_services / get_serviceFree catalog browse; returns paymentsProtocolConfig and accepts before spendMicropayments (x402): exact EVM scheme on X402_NETWORK. Transfers (wallet rail): USDC / USDC.e on ethereum, base, sepolia, polygon, arbitrum-one, monad, tempo, and Solana USDC for prefunding pay-to wallets. Sender pays native gas unless your wallet stack sponsors it.
mcp_tool_call_logsEvery tools/call logged with status: ok, error, payment_required, spend_policy_denied, auth_error, invalid_params. Args and response JSON stored (credentials hashed).
GET /mcp/tool-call-logs?agentId=&toolName=&status=payment_required&from=&to=agent_spend_ledgerPer-agent USD micro totals for Trust Layer budgets after successful kit tool settlement.
JSON-RPC codes (payment-related)
Payment Requiredx402 payment required
Spend Policy DeniedTrust Layer budget exceeded
Resolution ErrorTool or payTo resolution error
One X402_NETWORK config switches testnet vs mainnet settlement infrastructure — fewer misconfigurations between dev and prod.
Kit tools run priced logic only after facilitator verification succeeds.
paymentRequired first, paymentPayload second — natural pause for approval UI.
Client signs; facilitators verify and settle; payTo can be agent wallet or platform override.
Ledger requestKey deduplication; tool call logs for operational audit.
x402 verify and settle on chain for kit tools and external APIs. Network-aware facilitators, per-call pricing, paymentReceipt and tool-call logs.
Payments are MCP tools/call with optional params.paymentPayload. Success bundles content + paymentReceipt.
Registration JSON declares x402Support: true and MCP endpoint.
Bazaar entries include accepts and payTo; paid_fetch executes what discovery finds.
Spend policy before -32402 on kit fixed prices; ledger after settle. paid_fetch and transfer limits composable in your app.
Dependencies: @x402/core, @x402/evm, @coinbase/x402. Env: X402_NETWORK, X402_TESTNET_FACILITATOR_URL, CDP_API_KEY_*, X402_PAY_TO_ADDRESS.
# Testnet (default Base Sepolia)
X402_NETWORK=eip155:84532
X402_TESTNET_FACILITATOR_URL=https://x402.org/facilitator
# CDP keys not requiredNo. Testnet X402_NETWORK values use the public x402.org facilitator. CDP_API_KEY_ID and CDP_API_KEY_SECRET are required when X402_NETWORK is mainnet.
Facilitator is chosen by network tier. Use X402_TESTNET_FACILITATOR_URL for testnet override; mainnet uses Coinbase CDP automatically.
MCP paid_fetch is x402-only (no MPP/Tempo payment protocol). USDC transfers on Tempo and other chains use the transfer tool separately.
X402_PAY_TO_ADDRESS if set; otherwise the session agent's bound evmAddress.
Payment Required. Budget blocks use Spend Policy Denied (Trust Layer).
Yes. GET /mcp/tool-call-logs with status=payment_required or filter by toolName and agentId.
Per-call pricing for agents. Testnet to mainnet facilitators. x402 verify, settle, and receipt — built into MCP.