← All tools

commerce-decision

Before an autonomous agent pays an x402 challenge, bind the request, accepted payment offer, and machine spending policy into a deterministic GO/WARN/BLOCK decision with SHA-256 commitments.

Price
$0.01 USDC equivalent
Endpoint
POST /v1/commerce-decision
Network
Base mainnet · eip155:8453
Asset
USDC
MCP tool
commerce-decision
External payability
PASS · 2026-10-08T19:55:01.298Z

When an agent should use it

Input schema

{
  "type": "object",
  "properties": {
    "request": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "maxLength": 16
        },
        "resource": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "parameters": {
          "type": "object"
        },
        "body": {},
        "content_type": {
          "type": "string",
          "maxLength": 128
        }
      },
      "required": [
        "resource"
      ],
      "additionalProperties": false
    },
    "payment_required": {
      "type": "object",
      "properties": {
        "x402Version": {
          "type": "integer",
          "enum": [
            2
          ]
        },
        "resource": {
          "type": "object"
        },
        "accepts": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "type": "object"
          }
        },
        "extensions": {
          "type": "object"
        }
      },
      "required": [
        "x402Version",
        "accepts"
      ],
      "additionalProperties": true
    },
    "policy": {
      "type": "object",
      "properties": {
        "max_amount_atomic": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "max_per_day_atomic": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "spend_24h_atomic": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "allowed_networks": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "string"
          }
        },
        "allowed_assets": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "string"
          }
        },
        "allowed_payees": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "string"
          }
        },
        "blocked_payees": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "string"
          }
        },
        "max_timeout_seconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3600
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "request",
    "payment_required",
    "policy"
  ],
  "additionalProperties": false
}

Example request

{
  "request": {
    "method": "POST",
    "resource": "https://seller.example/v1/data",
    "body": {
      "symbol": "ETH"
    }
  },
  "payment_required": {
    "x402Version": 2,
    "accepts": [
      {
        "scheme": "exact",
        "network": "eip155:8453",
        "amount": "20000",
        "asset": "0x833589fCD6eDb6E08f4c7b7cC6A8Bf10A74A5f7",
        "payTo": "0x1111111111111111111111111111111111111111",
        "maxTimeoutSeconds": 60
      }
    ]
  },
  "policy": {
    "max_amount_atomic": "50000",
    "max_per_day_atomic": "5000000",
    "spend_24h_atomic": "700000",
    "allowed_networks": [
      "eip155:8453"
    ]
  }
}

Example output

{
  "decision": "GO",
  "selected_offer": {
    "scheme": "exact",
    "network": "eip155:8453",
    "amount": "20000"
  },
  "policy_valid": true,
  "request_hash": "...",
  "offer_hash": "...",
  "policy_hash": "...",
  "preflight_root": "..."
}

x402 flow

POST /v1/commerce-decision
→ HTTP 402 + PAYMENT-REQUIRED
→ buyer authorizes locally
→ retry same request with PAYMENT-SIGNATURE
→ one governed execution + machine-readable JSON

Discovery: OpenAPI · x402 · llms.txt

A valid 402/payability probe is operational evidence, not proof of independent demand, future settlement, or semantic correctness.