{
  "openapi": "3.1.0",
  "info": {
    "title": "x402check",
    "version": "1.0.0",
    "description": "Live x402 conformance pre-flight. Pass ?url=<https x402 endpoint> and pay to get a structured PASS/WARN/FAIL verdict on its 402 challenge before you trust it with a real payment.",
    "x-guidance": "Call GET /check?url=<https x402 endpoint you're about to pay> to get a structured PASS/WARN/FAIL conformance verdict on its 402 challenge before trusting it with a real payment. Pay ~$0.002 USDC on Base per check. Humans can use the free rate-limited browser UI at / instead.",
    "contact": {
      "email": "arden.instance@gmail.com"
    }
  },
  "paths": {
    "/check": {
      "get": {
        "operationId": "checkX402Endpoint",
        "summary": "Conformance pre-flight check on another x402 endpoint",
        "tags": [
          "Check"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The x402 endpoint to check (must be https)"
          }
        ],
        "responses": {
          "200": {
            "description": "Conformance verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "PASS",
                        "WARN",
                        "FAIL"
                      ]
                    }
                  },
                  "required": [
                    "verdict"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/check-free": {
      "get": {
        "operationId": "checkX402EndpointFree",
        "summary": "Free rate-limited conformance check (powers the browser UI; no payment, no settlement receipt)",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The x402 endpoint to check (must be https)"
          }
        ],
        "responses": {
          "200": {
            "description": "Conformance verdict"
          },
          "429": {
            "description": "Rate limited — use the paid /check for programmatic access"
          }
        }
      }
    },
    "/base/block": {
      "get": {
        "operationId": "baseGetBlock",
        "summary": "Base mainnet block summary by number or tag",
        "tags": [
          "Base"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Block number (decimal or 0x-hex) or a named tag (latest/safe/finalized/…). Default: latest"
          }
        ],
        "responses": {
          "200": {
            "description": "Base mainnet data (application/json)"
          },
          "400": {
            "description": "Invalid query parameter"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "All upstream Base RPC nodes failed"
          }
        }
      }
    },
    "/base/tx": {
      "get": {
        "operationId": "baseGetTx",
        "summary": "Base mainnet transaction + receipt summary",
        "tags": [
          "Base"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "hash",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "0x-prefixed 32-byte transaction hash"
          }
        ],
        "responses": {
          "200": {
            "description": "Base mainnet data (application/json)"
          },
          "400": {
            "description": "Invalid query parameter"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "All upstream Base RPC nodes failed"
          }
        }
      }
    },
    "/base/balance": {
      "get": {
        "operationId": "baseGetBalance",
        "summary": "Native ETH + Base USDC balance for an address",
        "tags": [
          "Base"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "0x-prefixed 20-byte address"
          }
        ],
        "responses": {
          "200": {
            "description": "Base mainnet data (application/json)"
          },
          "400": {
            "description": "Invalid query parameter"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "All upstream Base RPC nodes failed"
          }
        }
      }
    },
    "/base/erc20": {
      "get": {
        "operationId": "baseGetErc20",
        "summary": "ERC-20 symbol/decimals/balanceOf on Base mainnet",
        "tags": [
          "Base"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "0x-prefixed ERC-20 contract address"
          },
          {
            "name": "holder",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "0x-prefixed holder address"
          }
        ],
        "responses": {
          "200": {
            "description": "Base mainnet data (application/json)"
          },
          "400": {
            "description": "Invalid query parameter"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "All upstream Base RPC nodes failed"
          }
        }
      }
    },
    "/base/gas": {
      "get": {
        "operationId": "baseGetGas",
        "summary": "Current Base mainnet gas price + latest base fee",
        "tags": [
          "Base"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Base mainnet data (application/json)"
          },
          "400": {
            "description": "Invalid query parameter"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "All upstream Base RPC nodes failed"
          }
        }
      }
    }
  }
}