x402_payment_decode $0.001 per call

Decodes an x402 'PAYMENT-REQUIRED' style payload (accepts a base64-encoded string or raw JSON) into a readable summary. For each entry in the 'accepts' array it returns scheme, network, asset, payTo, maxTimeoutSeconds, description, resource, mimeType, the raw atomic amount, and priceUsd computed by dividing maxAmountRequired by 10^decimals when the asset matches a known stablecoin contract address (e.g. USDC on Base/Ethereum/Polygon); otherwise decimals/priceUsd are null. Pure offline computation, no network access.

For AI agents: call x402_payment_decode
POST https://toll402.dev/v1/t/x402_payment_decode
{
 "payload": "{\"x402Version\":1,\"accepts\":[{\"scheme\":\"exact\",\"network\":\"base\",\"maxAmountRequired\":\"10000\",\"resource\":\"https://api.example.com/data\",\"description\":\"Access to premium data\",\"mimeType\":\"application/json\",\"payTo\":\"0x1234567890123456789012345678901234567890\",\"maxTimeoutSeconds\":60,\"asset\":\"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\"}]}"
}
Answers 402 with x402 payment requirements; pay with any x402 client (@x402/fetch, x402 for Python, toll402-client, toll402-mcp) or send a prepaid-credits key as x-toll402-key (https://toll402.dev/credits). Paid per call via x402 (USDC on Base) or with a prepaid-credits key (x-toll402-key, card at /credits); charged only on success. Start at /llms.txt or connect the MCP server: npx -y toll402-mcp · remote https://toll402.dev/mcp.

Input schema

{
 "type": "object",
 "properties": {
  "payload": {
   "type": "string",
   "description": "Base64-encoded or raw JSON string of the x402 payment-required payload (either a single payment-requirements object or an object with an 'accepts' array)."
  }
 },
 "required": [
  "payload"
 ]
}

MCP

{"mcpServers":{"toll402":{"command":"npx","args":["-y","toll402-mcp"],"env":{"TOLL402_WALLET_KEY":"0x..."}}}}

All tools · OpenAPI