{
  "openapi": "3.1.0",
  "info": {
    "title": "M2M Sentinel \u2014 Base Contract Capability Checks Before You Sign",
    "version": "2.2.0",
    "summary": "Can this Base contract be paused, frozen, upgraded, or self-destruct? Static bytecode evidence with proxy and EIP-7702 resolution, returned before your agent signs. Evidence for your policy, never a safety verdict.",
    "description": "Every protected response carries provenance. Contract analysis reports selected opcode and selector observations, common proxy resolution, evidence quality, and explicit limitations. It does not classify contracts as safe, malicious, or exploitable. When the engine cannot obtain evidence-grade data it returns `capabilityRating: \"UNVERIFIED\"`, or HTTP 503 `DATA_SOURCE_UNAVAILABLE`. No live value is estimated or defaulted.",
    "contact": {
      "name": "M2M Sentinel API",
      "email": "contact@m2msentinel.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://m2msentinel.com/terms"
    },
    "termsOfService": "https://m2msentinel.com/terms"
  },
  "servers": [
    {
      "url": "https://api.m2msentinel.com",
      "description": "Production High-Performance Gateway (Direct Edge)"
    },
    {
      "url": "https://m2msentinel.com",
      "description": "Production Web & Fallback Gateway"
    }
  ],
  "tags": [
    {
      "name": "Status",
      "description": "Health and capability discovery. No credential required."
    },
    {
      "name": "Operator",
      "description": "Temporary, explicitly enabled operator bootstrap utilities. These routes are disabled by default."
    },
    {
      "name": "Onboarding",
      "description": "Free-tier and paid key provisioning. No credential required."
    },
    {
      "name": "Demo",
      "description": "Live no-wallet analysis of a fixed sample allowlist."
    },
    {
      "name": "Capabilities",
      "description": "Static contract capability observations. Requires an API key or a settled x402 payment."
    },
    {
      "name": "Market",
      "description": "Sourced Base market data. Requires an API key or a settled x402 payment."
    },
    {
      "name": "Keys",
      "description": "Key self-service. Requires the key itself."
    },
    {
      "name": "MCP",
      "description": "Model Context Protocol (MCP) streamable HTTP and Server-Sent Events transports."
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "BearerAuth": []
    },
    {
      "X402Payment": []
    }
  ],
  "paths": {
    "/v1/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getStatus",
        "summary": "Instantaneous dependency health",
        "description": "Reports the live state of persistence, Base RPC trust, verdict quality and payment settlement. Returns 503 when both persistence and RPC are unreachable. Historical availability is published only for windows with sufficient recorded health samples. The legacy core series measures persistence plus Base RPC; gateway, paid x402 route and RapidAPI marketplace series are reported independently.",
        "security": [],
        "responses": {
          "200": {
            "description": "Health snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "503": {
            "description": "All core dependencies are unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          }
        }
      }
    },
    "/v1/operator/rapidapi-proxy-digest": {
      "get": {
        "tags": [
          "Operator"
        ],
        "operationId": "bootstrapRapidApiProxySecretDigest",
        "summary": "Derive the RapidAPI gateway proxy-secret digest during a one-time bootstrap",
        "description": "Disabled unless RAPIDAPI_BOOTSTRAP_TOKEN contains at least 32 characters. Call this route through RapidAPI and authenticate with x-m2m-rapidapi-bootstrap. The request must include a non-empty RapidAPI-injected x-rapidapi-proxy-secret plus at least one non-empty RapidAPI context header (x-rapidapi-user, x-rapidapi-subscription, x-rapidapi-host, or x-rapidapi-key). The response contains only the lowercase SHA-256 digest; the raw proxy secret is never reflected or persisted. After copying the digest into RAPIDAPI_PROXY_SECRET_SHA256, remove RAPIDAPI_BOOTSTRAP_TOKEN and any raw RAPIDAPI_PROXY_SECRET value, which makes this route return 404.",
        "security": [
          {
            "RapidApiBootstrap": []
          }
        ],
        "parameters": [
          {
            "name": "x-rapidapi-proxy-secret",
            "in": "header",
            "required": true,
            "description": "The non-empty private proxy secret injected by RapidAPI. It is hashed in memory and is never returned.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "writeOnly": true
            }
          },
          {
            "name": "x-rapidapi-user",
            "in": "header",
            "required": false,
            "description": "RapidAPI forwarding context. At least one of this header, x-rapidapi-subscription, x-rapidapi-host, or x-rapidapi-key must be non-empty.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "x-rapidapi-subscription",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "x-rapidapi-host",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "x-rapidapi-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "writeOnly": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The proxy secret digest. No raw secret or identifying metadata is included.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "sha256"
                  ],
                  "properties": {
                    "sha256": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$",
                      "description": "Store this value as RAPIDAPI_PROXY_SECRET_SHA256."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Bootstrap is disabled because no strong RAPIDAPI_BOOTSTRAP_TOKEN is configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stats": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getAggregateStats",
        "summary": "Public telemetry metadata or operator-authorized aggregate detail",
        "description": "Without operator authorization this returns no exact adoption, funnel, utilization, attribution, or revenue counters. A Bearer OPERATOR_STATS_TOKEN returns identifier-free global daily counters. No IP address, wallet, API key, contract address, path parameter, user agent, referrer, or per-user identifier is collected.",
        "security": [],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400,
              "default": 30
            }
          },
          {
            "name": "bucket",
            "in": "query",
            "description": "Operator-only. Selects the analytics bucket to read. 'test' returns the segregated bucket that authenticated live probes write to, so operator traffic can be reconciled separately from customer traffic. Supplying this parameter without operator authorization returns 401.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "test"
              ],
              "default": "production"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Redacted public metadata, or detailed counters when operator-authorized",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PublicStats"
                    },
                    {
                      "$ref": "#/components/schemas/AggregateStats"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/events": {
      "post": {
        "tags": [
          "Status"
        ],
        "operationId": "recordAggregateProductEvent",
        "summary": "Record an allowlisted first-party aggregate event",
        "description": "Accepts only pageViewed and ctaClicked plus fixed enum dimensions. Commercial outcomes are recorded authoritatively by server routes. Unknown fields, free text and identifiers are refused.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicProductEvent"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Valid aggregate event accepted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/demo/audit/{address}": {
      "get": {
        "tags": [
          "Demo"
        ],
        "operationId": "demoAuditContract",
        "summary": "Run live capability analysis for an allowlisted sample",
        "description": "Uses the same live Base RPC, proxy resolution, and bytecode analysis pipeline as the paid audit route. Only the published samples are accepted; results are not stored or precomputed.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/Address"
          }
        ],
        "responses": {
          "200": {
            "description": "Live sample analysis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/plans": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getPlans",
        "summary": "Authoritative plan and pricing catalogue",
        "description": "The single source of truth for pricing. The website renders this endpoint; if any page disagrees with it, this endpoint governs.",
        "security": [],
        "responses": {
          "200": {
            "description": "Plan catalogue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plans"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscribe/free/challenge": {
      "post": {
        "tags": [
          "Onboarding"
        ],
        "operationId": "createFreeChallenge",
        "summary": "Request a wallet challenge for a free key",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userWallet"
                ],
                "properties": {
                  "userWallet": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "examples": [
                      "0x6d6C398390cfb88f1CD42715B84906a0Bd6652aa"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Challenge issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/subscribe/free/claim": {
      "post": {
        "tags": [
          "Onboarding"
        ],
        "operationId": "claimFreeKey",
        "summary": "Exchange a signed challenge for a free key",
        "description": "Allocated once per wallet. The raw key is returned exactly once and is never recoverable afterwards.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "intentId",
                  "signature"
                ],
                "properties": {
                  "intentId": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "personal_sign signature over intent.messageToSign"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Key issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "A free key already exists for this wallet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/subscribe/intents": {
      "post": {
        "tags": [
          "Onboarding"
        ],
        "operationId": "createPurchaseIntent",
        "summary": "Create a signable purchase intent with a frozen quote",
        "description": "The exact USDC amount (and, when a live ETH quote exists, the exact wei amount), duration and optional same-key renewal target are frozen into the message you sign. The intent is valid for 15 minutes. Renewals require the active same-tier paid key in x-api-key; changing tiers requires a new key.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tier",
                  "userWallet"
                ],
                "properties": {
                  "tier": {
                    "type": "string",
                    "enum": [
                      "STARTER",
                      "GROWTH",
                      "PRO"
                    ]
                  },
                  "userWallet": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "Must be the wallet that will send the payment."
                  },
                  "durationDays": {
                    "type": "integer",
                    "enum": [
                      31,
                      90,
                      365
                    ],
                    "default": 31
                  },
                  "renewExistingKey": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, present the active same-tier paid key in x-api-key. The key expiry is extended atomically and its raw secret does not change."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intent created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseIntent"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/subscribe/crypto": {
      "post": {
        "tags": [
          "Onboarding"
        ],
        "operationId": "claimSubscription",
        "summary": "Claim a subscription key after on-chain payment",
        "description": "Requires 3 block confirmations and a credentialed RPC. The signer of the intent, the transaction sender and the payment sender must be the same wallet. A transaction hash can be redeemed exactly once.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "intentId",
                  "signature",
                  "txHash"
                ],
                "properties": {
                  "intentId": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string"
                  },
                  "txHash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment verified and key provisioned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedKey"
                }
              }
            }
          },
          "400": {
            "description": "Intent, amount, sender or finality check failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/audit/{address}": {
      "get": {
        "tags": [
          "Capabilities"
        ],
        "operationId": "auditContract",
        "summary": "Static bytecode capability and proxy observations",
        "description": "Reports selected bytecode patterns and common proxy structures. `notASafetyGuarantee` is always true; absence of a pattern is not evidence of safety.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Address"
          }
        ],
        "responses": {
          "200": {
            "description": "Capability report. `capabilityRating` is `UNVERIFIED` and `capabilityScore` is null when RPC trust is below evidence grade.",
            "headers": {
              "X-Sentinel-RPC-Provider": {
                "$ref": "#/components/headers/RpcProvider"
              },
              "X-Sentinel-Trust-Level": {
                "$ref": "#/components/headers/TrustLevel"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-Credits-Remaining": {
                "$ref": "#/components/headers/CreditsRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/security/score/{address}": {
      "get": {
        "tags": [
          "Capabilities"
        ],
        "operationId": "getCapabilityScoreLegacyPath",
        "summary": "Legacy URL for the static capability coverage index",
        "description": "Higher values mean fewer selected static patterns were observed. This is not a security score or safety probability. `capabilityScore` is null whenever evidence-grade analysis is unavailable.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Address"
          }
        ],
        "responses": {
          "200": {
            "description": "Score and deduction breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScoreResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/gas/fees": {
      "get": {
        "tags": [
          "Market"
        ],
        "operationId": "getGasFees",
        "summary": "Observed Base gas price",
        "responses": {
          "200": {
            "description": "Gas observation with provenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GasResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DataSourceUnavailable"
          }
        }
      }
    },
    "/v1/dex/metrics": {
      "get": {
        "tags": [
          "Market"
        ],
        "operationId": "getDexMetrics",
        "summary": "Aggregate DEX liquidity and volume for tracked Base tokens",
        "description": "The `coverage` object states exactly which tokens were aggregated. This is not a whole-chain total.",
        "responses": {
          "200": {
            "description": "Aggregate with coverage and provenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DexMetricsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DataSourceUnavailable"
          }
        }
      }
    },
    "/v1/token/price/{symbol}": {
      "get": {
        "tags": [
          "Market"
        ],
        "operationId": "getTokenPrice",
        "summary": "Liquidity-weighted Base token price",
        "description": "Median of the five deepest indexed pools, so a single manipulated pool cannot move the published price. Unknown symbols return 404 with the supported list; a price is never guessed.",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "USDC",
                "WETH",
                "AERO"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Priced token with provenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPriceResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "description": "Symbol is not tracked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DataSourceUnavailable"
          }
        }
      }
    },
    "/v1/whales/signals": {
      "get": {
        "tags": [
          "Market"
        ],
        "operationId": "getWhaleSignals",
        "summary": "Large ERC-20 transfers observed on Base",
        "description": "Sourced from eth_getLogs over a bounded recent block range and valued using live pool prices. ERC-20 Transfer events only.",
        "responses": {
          "200": {
            "description": "Observed signals with the exact query window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhaleResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DataSourceUnavailable"
          }
        }
      }
    },
    "/v1/keys/self": {
      "get": {
        "tags": [
          "Keys"
        ],
        "operationId": "getOwnKey",
        "summary": "Metadata for the presented key",
        "description": "Requires an API key; an x402 payment cannot access this route. The raw key is never echoed.",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Key metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeySelf"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/keys/revoke": {
      "post": {
        "tags": [
          "Keys"
        ],
        "operationId": "revokeOwnKey",
        "summary": "Permanently revoke the presented key",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm"
                ],
                "properties": {
                  "confirm": {
                    "type": "boolean",
                    "const": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/keys/recovery/challenge": {
      "post": {
        "tags": [
          "Keys"
        ],
        "operationId": "createPaidKeyRecoveryChallenge",
        "summary": "Create a non-enumerating paid-key recovery challenge",
        "description": "Returns the same 202 envelope for known and unknown wallets. An optional original subscription txHash bootstraps legacy paid keys. Free and revoked keys cannot be recovered.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userWallet"
                ],
                "properties": {
                  "userWallet": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "txHash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$",
                    "description": "Original subscription payment; needed only for a legacy key without a wallet index."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Structurally identical real or decoy challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryIntent"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/keys/recovery/claim": {
      "post": {
        "tags": [
          "Keys"
        ],
        "operationId": "claimPaidKeyRecovery",
        "summary": "Rotate a paid API key with its subscriber-wallet signature",
        "description": "Atomically revokes the previous secret and returns a replacement exactly once. The tier and expiration are preserved.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "intentId",
                  "signature"
                ],
                "properties": {
                  "intentId": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replacement key issued and previous key revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "Challenge already consumed or target changed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "MCP"
        ],
        "operationId": "postMcpStreamableHttp",
        "summary": "Current MCP Streamable HTTP endpoint",
        "description": "Processes one MCP JSON-RPC request, notification, or response per POST. Negotiates the current 2026-07-28 protocol and stateless 2025-era clients. Tool execution enforces API-key or x402 access at the API layer.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response as JSON or an SSE response stream, according to protocol negotiation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "MCP notification or response accepted with no response message"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "description": "Origin rejected"
          },
          "406": {
            "description": "Required MCP response content type was not accepted"
          }
        }
      },
      "get": {
        "tags": [
          "MCP"
        ],
        "operationId": "getMcpStreamableHttp",
        "summary": "Open an MCP server event stream when negotiated",
        "description": "The current MCP endpoint may open an SSE stream for server messages. Stateless clients with no listenable stream receive 405.",
        "security": [],
        "responses": {
          "200": {
            "description": "MCP event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "No event stream is available for this stateless request"
          }
        }
      }
    },
    "/sse": {
      "get": {
        "tags": [
          "MCP"
        ],
        "operationId": "getMcpSseStream",
        "summary": "Legacy MCP HTTP+SSE stream",
        "description": "Compatibility endpoint for protocol 2024-11-05 clients. New clients use the single /mcp Streamable HTTP endpoint.",
        "security": [],
        "responses": {
          "200": {
            "description": "SSE event stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "tags": [
          "MCP"
        ],
        "operationId": "postMcpJsonRpcMessage",
        "summary": "Legacy MCP HTTP+SSE JSON-RPC message handler",
        "description": "Compatibility message endpoint paired with /sse for protocol 2024-11-05 clients. New clients POST to /mcp.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/samples": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "listSamples",
        "summary": "Index of free response samples",
        "description": "Lists the free, frozen examples of each paid response. Published so an agent can read the exact schema of a paid route before spending anything.",
        "security": [],
        "responses": {
          "200": {
            "description": "Sample index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "samples": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/sample": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "getSample",
        "summary": "Free frozen example of a paid response",
        "description": "A structurally complete example of one paid response, captured from the same code path the paid route uses. Free and never payment-gated. The values are not current: the payload is nested under `response` and the envelope carries `sample: true` and `capturedAt` so a snapshot can never be mistaken for live data. Frozen rather than live for two reasons: a live preview of gas, price or liquidity data would give away the thing being sold, and a sample that calls an upstream provider can fail, which would mark the listing failing in directories that re-probe it.",
        "security": [],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "gas-fees",
                "dex-metrics",
                "token-price",
                "whale-signals"
              ]
            },
            "description": "Which paid response to preview."
          }
        ],
        "responses": {
          "200": {
            "description": "Frozen sample",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "sample",
                    "capturedAt",
                    "paidRoute",
                    "response"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "SAMPLE"
                    },
                    "sample": {
                      "type": "boolean",
                      "const": true
                    },
                    "capturedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "note": {
                      "type": "string"
                    },
                    "paidRoute": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "network": {
                      "type": "string"
                    },
                    "response": {
                      "type": "object",
                      "description": "The paid payload, exactly as the paid route shapes it."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No sample by that name"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Header only. Credentials supplied in a query string are rejected with HTTP 401 and must be rotated."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Alternative to x-api-key."
      },
      "RapidApiBootstrap": {
        "type": "apiKey",
        "in": "header",
        "name": "x-m2m-rapidapi-bootstrap",
        "description": "Temporary operator token used only for GET /v1/operator/rapidapi-proxy-digest. RAPIDAPI_BOOTSTRAP_TOKEN must be at least 32 characters; remove it immediately after bootstrap. The comparison is performed on fixed-length SHA-256 digests in constant time."
      },
      "X402Payment": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 v2 micro-payment. Call without a credential to receive HTTP 402 and a PAYMENT-REQUIRED challenge, settle it, then retry with this header."
      }
    },
    "parameters": {
      "Address": {
        "name": "address",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "examples": {
          "usdc": {
            "value": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        }
      }
    },
    "headers": {
      "RpcProvider": {
        "schema": {
          "type": "string"
        },
        "description": "Provider (or joined providers) that answered."
      },
      "TrustLevel": {
        "schema": {
          "type": "string",
          "enum": [
            "HIGH_TRUST_PRIMARY",
            "QUORUM_PUBLIC",
            "DEGRADED_LOW_TRUST"
          ]
        }
      },
      "RateLimitRemaining": {
        "schema": {
          "type": "integer"
        },
        "description": "Requests remaining in the current minute."
      },
      "CreditsRemaining": {
        "schema": {
          "type": "integer"
        },
        "description": "Decision credits remaining in the current issuance-anchored 31-day cycle."
      },
      "PaymentRequired": {
        "schema": {
          "type": "string",
          "format": "byte"
        },
        "description": "Base64-encoded JSON x402 v2 challenge."
      },
      "PaymentResponse": {
        "schema": {
          "type": "string",
          "format": "byte"
        },
        "description": "Base64-encoded JSON x402 v2 settlement receipt."
      },
      "RetryAfter": {
        "schema": {
          "type": "integer"
        },
        "description": "Seconds to wait before retrying."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed input",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid credential, or a credential was supplied in the query string",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "No credential supplied for a payable route, or the issuance-anchored 31-day credit allowance is exhausted",
        "headers": {
          "PAYMENT-REQUIRED": {
            "$ref": "#/components/headers/PaymentRequired"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/X402PaymentRequired"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "Verb not supported. HEAD is refused on protected routes because it would execute a metered handler while suppressing the body.",
        "headers": {
          "Allow": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "A plan burst limit or bounded public/intent retry limit was exceeded",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "A required dependency is unavailable; the request failed closed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "DataSourceUnavailable": {
        "description": "The upstream data source is unavailable. No value is returned rather than an estimated one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string",
            "examples": [
              "UNAUTHORIZED",
              "PAYMENT_REQUIRED",
              "DATA_SOURCE_UNAVAILABLE",
              "RATE_LIMITED",
              "CREDITS_EXHAUSTED",
              "METHOD_NOT_ALLOWED"
            ]
          },
          "message": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "description": "Correlation id for a server-side error."
          }
        }
      },
      "X402PaymentRequired": {
        "type": "object",
        "required": [
          "x402Version",
          "resource",
          "accepts"
        ],
        "properties": {
          "x402Version": {
            "type": "integer",
            "const": 2
          },
          "error": {
            "type": "string"
          },
          "resource": {
            "type": "object",
            "required": [
              "url"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "description": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              }
            }
          },
          "accepts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "scheme",
                "network",
                "amount",
                "asset",
                "payTo",
                "maxTimeoutSeconds"
              ],
              "properties": {
                "scheme": {
                  "type": "string",
                  "const": "exact"
                },
                "network": {
                  "type": "string",
                  "const": "eip155:8453"
                },
                "amount": {
                  "type": "string"
                },
                "asset": {
                  "type": "string"
                },
                "payTo": {
                  "type": "string"
                },
                "maxTimeoutSeconds": {
                  "type": "integer"
                },
                "extra": {
                  "type": "object"
                }
              }
            }
          },
          "extensions": {
            "type": "object"
          }
        }
      },
      "Provenance": {
        "type": "object",
        "description": "Where a value came from and how old it is. Present on every data response.",
        "properties": {
          "source": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "trustLevel": {
            "type": "string",
            "enum": [
              "HIGH_TRUST_PRIMARY",
              "QUORUM_PUBLIC",
              "DEGRADED_LOW_TRUST"
            ]
          },
          "agreement": {
            "type": "integer",
            "description": "Providers that returned the selected result."
          },
          "sampled": {
            "type": "integer",
            "description": "Providers that answered at all."
          },
          "retrievedAt": {
            "type": "string",
            "format": "date-time"
          },
          "ageSeconds": {
            "type": "integer"
          },
          "network": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Verdict": {
        "type": "object",
        "required": [
          "capabilityRating",
          "reachability",
          "evidenceGrade",
          "reason",
          "explanation",
          "executableCapabilities"
        ],
        "properties": {
          "capabilityRating": {
            "type": "string",
            "enum": [
              "NO_SELECTED_CAPABILITIES_DETECTED",
              "REVIEW_RECOMMENDED",
              "MULTIPLE_FLAGS",
              "NOT_A_CONTRACT",
              "UNVERIFIED"
            ]
          },
          "reachability": {
            "type": "string",
            "const": "NOT_ESTABLISHED"
          },
          "evidenceGrade": {
            "type": "boolean",
            "description": "False when RPC trust or proxy resolution was insufficient to publish a capability label."
          },
          "reason": {
            "type": "string"
          },
          "explanation": {
            "type": "string"
          },
          "executableCapabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AnalysisSemantics": {
        "type": "object",
        "required": [
          "analysisKind",
          "notASafetyGuarantee",
          "reachability",
          "limitations"
        ],
        "properties": {
          "analysisKind": {
            "type": "string",
            "const": "STATIC_BYTECODE_CAPABILITY_HEURISTIC"
          },
          "notASafetyGuarantee": {
            "type": "boolean",
            "const": true
          },
          "reachability": {
            "type": "string",
            "const": "NOT_ESTABLISHED"
          },
          "limitations": {
            "type": "array",
            "minItems": 3,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Capability": {
        "type": "object",
        "required": [
          "type",
          "confidence",
          "reachability",
          "evidence"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "DELEGATECALL",
              "SELFDESTRUCT",
              "MINT_SELECTOR",
              "PAUSE_SELECTOR",
              "FREEZE_SELECTOR"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "HIGH",
              "MEDIUM",
              "LOW"
            ]
          },
          "reachability": {
            "type": "string",
            "const": "NOT_ESTABLISHED"
          },
          "byteOffsetHex": {
            "type": "string"
          },
          "selectorHex": {
            "type": "string"
          },
          "snippetHex": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          }
        }
      },
      "Dissection": {
        "type": "object",
        "properties": {
          "isValidContract": {
            "type": "boolean"
          },
          "bytecodeSizeBytes": {
            "type": "integer"
          },
          "targetBytecodeHash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cryptographic SHA-256 hash of the analyzed bytecode"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Capability"
            }
          },
          "detectedCapabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "properties": {
              "disclaimer": {
                "type": "string"
              }
            }
          }
        }
      },
      "ProxyResolution": {
        "type": "object",
        "properties": {
          "isProxy": {
            "type": "boolean"
          },
          "proxyType": {
            "type": "string",
            "enum": [
              "NONE",
              "EIP1967_DIRECT",
              "EIP1822_UUPS",
              "ZEPPELINOS_LEGACY",
              "EIP1967_BEACON",
              "EIP1967_BEACON_UNRESOLVED",
              "EIP1167_MINIMAL_PROXY",
              "DELEGATECALL_PROXY_SUSPECTED",
              "CYCLE_DETECTED",
              "MAX_DEPTH_EXCEEDED"
            ]
          },
          "targetAddress": {
            "type": "string"
          },
          "beaconAddress": {
            "type": "string"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "HIGH",
              "MEDIUM",
              "LOW"
            ]
          },
          "resolutionPath": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "via": {
                  "type": "string"
                }
              }
            }
          },
          "warning": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Reproducibility": {
        "type": "object",
        "description": "Deterministic reproducibility metadata and cryptographic bytecode hashes for independent verification.",
        "properties": {
          "chainId": {
            "type": "integer",
            "example": 8453
          },
          "network": {
            "type": "string",
            "example": "eip155:8453"
          },
          "contractAddress": {
            "type": "string"
          },
          "runtimeBytecodeHash": {
            "type": [
              "string",
              "null"
            ],
            "description": "SHA-256 hash of the target contract deployed runtime bytecode."
          },
          "isProxy": {
            "type": "boolean"
          },
          "implementationAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "implementationBytecodeHash": {
            "type": [
              "string",
              "null"
            ],
            "description": "SHA-256 hash of the implementation bytecode if target is a proxy."
          },
          "rulesetVersion": {
            "type": "string",
            "example": "2.2.0"
          },
          "engineVersion": {
            "type": "string",
            "example": "2.2.0"
          },
          "evidenceGrade": {
            "type": "boolean"
          },
          "trustLevel": {
            "type": "string"
          },
          "retrievedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AuditResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "payoutWallet": {
            "type": "string"
          },
          "audit": {
            "type": "object",
            "required": [
              "address",
              "analysisKind",
              "notASafetyGuarantee",
              "reachability",
              "limitations"
            ],
            "properties": {
              "address": {
                "type": "string"
              },
              "analysisKind": {
                "type": "string",
                "const": "STATIC_BYTECODE_CAPABILITY_HEURISTIC"
              },
              "notASafetyGuarantee": {
                "type": "boolean",
                "const": true
              },
              "reachability": {
                "type": "string",
                "const": "NOT_ESTABLISHED"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "proxyResolution": {
                "$ref": "#/components/schemas/ProxyResolution"
              },
              "dissection": {
                "$ref": "#/components/schemas/Dissection"
              },
              "capabilityRating": {
                "type": "string"
              },
              "verdict": {
                "$ref": "#/components/schemas/Verdict"
              },
              "capabilityScore": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 100
              },
              "scoreBreakdown": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "scoreMeaning": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "evidenceGrade": {
                "type": "boolean"
              },
              "reproducibility": {
                "$ref": "#/components/schemas/Reproducibility"
              },
              "network": {
                "type": "string"
              },
              "provenance": {
                "$ref": "#/components/schemas/Provenance"
              }
            }
          }
        }
      },
      "ScoreResponse": {
        "type": "object",
        "required": [
          "status",
          "address",
          "analysisKind",
          "notASafetyGuarantee",
          "reachability",
          "limitations"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "analysisKind": {
            "type": "string",
            "const": "STATIC_BYTECODE_CAPABILITY_HEURISTIC"
          },
          "notASafetyGuarantee": {
            "type": "boolean",
            "const": true
          },
          "reachability": {
            "type": "string",
            "const": "NOT_ESTABLISHED"
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilityScore": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scoreBreakdown": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "capability": {
                  "type": "string"
                },
                "confidence": {
                  "type": "string"
                },
                "points": {
                  "type": "integer"
                }
              }
            }
          },
          "scoreMeaning": {
            "type": [
              "string",
              "null"
            ]
          },
          "capabilityRating": {
            "type": "string"
          },
          "evidenceGrade": {
            "type": "boolean"
          },
          "verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "capabilitiesDetected": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        }
      },
      "GasResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "gasPrice": {
            "type": "object",
            "properties": {
              "wei": {
                "type": "integer"
              },
              "gwei": {
                "type": "number"
              }
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        }
      },
      "DexMetricsResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "metrics": {
            "type": "object",
            "properties": {
              "indexedPools": {
                "type": "integer"
              },
              "totalVolume24hUsd": {
                "type": "integer"
              },
              "totalLiquidityDepthUsd": {
                "type": "integer"
              },
              "topPairs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "pair": {
                      "type": "string"
                    },
                    "dex": {
                      "type": "string"
                    },
                    "pairAddress": {
                      "type": "string"
                    },
                    "liquidityUsd": {
                      "type": "integer"
                    },
                    "volume24hUsd": {
                      "type": "integer"
                    },
                    "priceUsd": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "coverage": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "trackedTokens": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sourcesQueried": {
                "type": "integer"
              },
              "sourcesSucceeded": {
                "type": "integer"
              },
              "degraded": {
                "type": "boolean"
              }
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        }
      },
      "TokenPriceResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "token": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "decimals": {
                "type": "integer"
              },
              "priceUsd": {
                "type": "number"
              },
              "change24hPercent": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "volume24hUsd": {
                "type": "integer"
              },
              "liquidityUsd": {
                "type": "integer"
              },
              "fdvUsd": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "marketCapUsd": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "pricedFrom": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "deepestPool": {
                    "type": "object"
                  },
                  "priceSpreadPercent": {
                    "type": "number",
                    "description": "Spread across the pools used. A large spread indicates thin or manipulated liquidity."
                  }
                }
              },
              "poolsConsidered": {
                "type": "integer"
              }
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        }
      },
      "WhaleResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "signals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "txHash": {
                  "type": "string"
                },
                "blockNumber": {
                  "type": "integer"
                },
                "logIndex": {
                  "type": "integer"
                },
                "tokenAddress": {
                  "type": "string"
                },
                "tokenSymbol": {
                  "type": "string"
                },
                "sender": {
                  "type": "string"
                },
                "receiver": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "amountUsd": {
                  "type": "integer"
                },
                "priceUsdUsedForValuation": {
                  "type": "number"
                }
              }
            }
          },
          "query": {
            "type": "object",
            "properties": {
              "fromBlock": {
                "type": "integer"
              },
              "toBlock": {
                "type": "integer"
              },
              "blocksScanned": {
                "type": "integer"
              },
              "minimumUsd": {
                "type": "number"
              },
              "tokensQueried": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tokensReadable": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "degraded": {
                "type": "boolean"
              }
            }
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        }
      },
      "PublicStats": {
        "type": "object",
        "required": [
          "status",
          "windowDays",
          "generatedAt",
          "privacy",
          "detailAccess"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "SUCCESS"
          },
          "windowDays": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "privacy": {
            "type": "string"
          },
          "detailAccess": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "PublicProductEvent": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "event",
              "page",
              "campaign"
            ],
            "additionalProperties": false,
            "properties": {
              "event": {
                "const": "pageViewed"
              },
              "page": {
                "type": "string",
                "enum": [
                  "home",
                  "pricing",
                  "docs",
                  "checkout",
                  "demo",
                  "status"
                ]
              },
              "campaign": {
                "type": "string",
                "enum": [
                  "direct",
                  "organic",
                  "github",
                  "npm",
                  "pypi",
                  "mcp",
                  "x402",
                  "partner"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "event",
              "cta",
              "campaign"
            ],
            "additionalProperties": false,
            "properties": {
              "event": {
                "const": "ctaClicked"
              },
              "cta": {
                "const": "subscribe"
              },
              "page": {
                "type": "string",
                "enum": [
                  "home",
                  "pricing",
                  "docs",
                  "checkout",
                  "demo",
                  "status"
                ]
              },
              "tier": {
                "type": "string",
                "enum": [
                  "FREE",
                  "STARTER",
                  "GROWTH",
                  "PRO",
                  "ENTERPRISE"
                ]
              },
              "campaign": {
                "type": "string",
                "enum": [
                  "direct",
                  "organic",
                  "github",
                  "npm",
                  "pypi",
                  "mcp",
                  "x402",
                  "partner"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "event",
              "cta",
              "campaign"
            ],
            "additionalProperties": false,
            "properties": {
              "event": {
                "const": "ctaClicked"
              },
              "cta": {
                "type": "string",
                "enum": [
                  "demo",
                  "freeKey",
                  "subscribe",
                  "docs",
                  "sdk",
                  "renew",
                  "recover",
                  "payUsdc",
                  "payEth",
                  "claim",
                  "restart"
                ]
              },
              "page": {
                "type": "string",
                "enum": [
                  "home",
                  "pricing",
                  "docs",
                  "checkout",
                  "demo",
                  "status"
                ]
              },
              "campaign": {
                "type": "string",
                "enum": [
                  "direct",
                  "organic",
                  "github",
                  "npm",
                  "pypi",
                  "mcp",
                  "x402",
                  "partner"
                ]
              }
            }
          }
        ]
      },
      "AggregateStats": {
        "type": "object",
        "required": [
          "status",
          "bucket",
          "windowDays",
          "generatedAt",
          "totals",
          "revenue",
          "privacy"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "SUCCESS"
          },
          "bucket": {
            "type": "string",
            "enum": [
              "production",
              "test"
            ],
            "description": "Which analytics bucket produced these counters. 'test' is authenticated non-customer probe traffic and must never be reported as customer conversion."
          },
          "windowDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 400
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "totals": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "demoRequested": {
                "type": "integer"
              },
              "demoSucceeded": {
                "type": "integer"
              },
              "demoUnsupported": {
                "type": "integer"
              },
              "paymentChallengeIssued": {
                "type": "integer"
              },
              "x402Settled": {
                "type": "integer"
              },
              "authenticatedDecisionServed": {
                "type": "integer"
              },
              "freeChallengeCreated": {
                "type": "integer"
              },
              "freeKeyIssued": {
                "type": "integer"
              },
              "subscriptionIntentCreated": {
                "type": "integer"
              },
              "subscriptionKeyIssued": {
                "type": "integer"
              },
              "subscriptionRenewed": {
                "type": "integer"
              },
              "keyRecovered": {
                "type": "integer"
              },
              "quotaExhausted": {
                "type": "integer"
              },
              "x402RevenueMicrousd": {
                "type": "integer"
              },
              "subscriptionRevenueMicrousd": {
                "type": "integer"
              }
            }
          },
          "productEvents": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Allowlisted event dimensions plus an aggregate count."
            }
          },
          "revenue": {
            "type": "object",
            "properties": {
              "x402Usd": {
                "type": "number"
              },
              "subscriptionsUsd": {
                "type": "number"
              }
            }
          },
          "privacy": {
            "type": "string"
          }
        }
      },
      "AvailabilityWindow": {
        "type": "object",
        "required": [
          "availabilityPercent",
          "sampleCount",
          "sufficientData"
        ],
        "properties": {
          "availabilityPercent": {
            "type": [
              "number",
              "null"
            ]
          },
          "sampleCount": {
            "type": "integer",
            "minimum": 0
          },
          "sufficientData": {
            "type": "boolean"
          }
        }
      },
      "AvailabilitySeries": {
        "type": "object",
        "required": [
          "measured",
          "availabilityPercent",
          "sampleCount",
          "windows"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "measured": {
            "type": "boolean"
          },
          "availabilityPercent": {
            "type": [
              "number",
              "null"
            ]
          },
          "sampleCount": {
            "type": "integer",
            "minimum": 0
          },
          "windows": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/AvailabilityWindow"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "AvailabilitySummary": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AvailabilitySeries"
          },
          {
            "type": "object",
            "required": [
              "scope",
              "componentAvailability"
            ],
            "properties": {
              "scope": {
                "type": "string",
                "const": "CORE_PERSISTENCE_AND_BASE_RPC"
              },
              "componentAvailability": {
                "type": "object",
                "required": [
                  "gateway",
                  "paidRoute",
                  "rapidApi"
                ],
                "properties": {
                  "gateway": {
                    "$ref": "#/components/schemas/AvailabilitySeries"
                  },
                  "paidRoute": {
                    "$ref": "#/components/schemas/AvailabilitySeries"
                  },
                  "rapidApi": {
                    "$ref": "#/components/schemas/AvailabilitySeries"
                  }
                }
              }
            }
          }
        ]
      },
      "Status": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ONLINE",
              "DEGRADED",
              "OFFLINE"
            ]
          },
          "deploymentPhase": {
            "type": "string",
            "const": "PRODUCTION"
          },
          "commerciallyPromoted": {
            "type": "boolean",
            "const": false,
            "description": "Reports whether the operator is running paid marketing for this service. It is not a restriction on use and not a statement about availability: the paid API is live, settles real USDC payments on Base, and serves any caller with a valid API key or x402 payment."
          },
          "x402ProtocolVersion": {
            "type": "integer"
          },
          "network": {
            "type": "string"
          },
          "components": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "OPERATIONAL",
                    "DEGRADED",
                    "DOWN",
                    "ENABLED",
                    "DISABLED"
                  ]
                },
                "detail": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "blockNumber": {
            "type": [
              "integer",
              "null"
            ]
          },
          "availability": {
            "$ref": "#/components/schemas/AvailabilitySummary"
          },
          "uptimeClaim": {
            "type": [
              "number",
              "null"
            ],
            "description": "Backward-compatible core 24-hour sample availability for persistent storage plus Base RPC. Null until enough core samples exist. Customer-path availability is reported separately under availability.componentAvailability."
          },
          "uptimeNote": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "priceUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "monthlyCredits": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Hard cap per issuance-anchored 31-day access cycle. Never null for a purchasable plan."
          },
          "dailyCredits": {
            "type": [
              "integer",
              "null"
            ]
          },
          "burstPerMinute": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sla": {
            "type": [
              "string",
              "null"
            ]
          },
          "purchasable": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "usdcBaseUnits": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Plans": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "billingModel": {
            "type": "string"
          },
          "settlement": {
            "type": "object"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "x402PerDecisionUsd": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          }
        }
      },
      "IntentEnvelope": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "intent": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "tier": {
                "type": "string"
              },
              "userWallet": {
                "type": "string"
              },
              "durationDays": {
                "type": "integer",
                "enum": [
                  31,
                  90,
                  365
                ],
                "description": "Present on paid purchase intents."
              },
              "renewExistingKey": {
                "type": "boolean",
                "description": "Present on paid purchase intents; true when the payment extends the presented key."
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "messageToSign": {
                "type": "string"
              }
            }
          },
          "next": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PurchaseIntent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/IntentEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "payment": {
                "type": "object",
                "properties": {
                  "payTo": {
                    "type": "string"
                  },
                  "network": {
                    "type": "string"
                  },
                  "priceUsd": {
                    "type": "number"
                  },
                  "usdc": {
                    "type": "object",
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "baseUnits": {
                        "type": "string"
                      },
                      "decimals": {
                        "type": "integer"
                      }
                    }
                  },
                  "nativeEth": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Null when no live ETH quote was available; settle in USDC instead."
                  }
                }
              }
            }
          }
        ]
      },
      "RecoveryIntent": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "ACCEPTED"
          },
          "intent": {
            "type": "object",
            "required": [
              "id",
              "userWallet",
              "expiresAt",
              "messageToSign"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "userWallet": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "messageToSign": {
                "type": "string"
              }
            }
          },
          "next": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IssuedKey": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "apiKey": {
            "type": "string",
            "description": "Returned exactly once for a new or recovered key. Storage uses a server-keyed HMAC-SHA-256 lookup index plus a separate randomly salted SHA-256 verifier; the plaintext key is not persisted. Paid keys can later be wallet-rotated; renewal keeps the current raw secret and omits this field."
          },
          "tier": {
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "txHash": {
            "type": "string"
          },
          "renewed": {
            "type": "boolean"
          },
          "durationDays": {
            "type": "integer",
            "enum": [
              31,
              90,
              365
            ]
          }
        }
      },
      "KeySelf": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "key": {
            "type": "object",
            "properties": {
              "keyHashPrefix": {
                "type": "string"
              },
              "tier": {
                "type": "string"
              },
              "created": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "expiresAt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "userWallet": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "revoked": {
                "type": "boolean"
              }
            }
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          }
        }
      }
    }
  }
}
