{
  "openapi": "3.1.0",
  "info": {
    "title": "TinkerMCP Studio API",
    "version": "3.1.0",
    "description": "Live 4-feed pre-trade and off-market signal mixer API, 140-tool MCP registry, syndication bundles, and x402 / sandbox-metered intelligence endpoints."
  },
  "servers": [
    {
      "url": "https://tinkermcp.com",
      "description": "tinkermcp.com production edge"
    }
  ],
  "x-spoke-host": "tinkermcp.com",
  "x-x402-protocol": {
    "network": "eip155:8453",
    "asset": "USDC",
    "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "requestHeaders": [
      "X-PAYMENT",
      "PAYMENT-SIGNATURE"
    ],
    "responseHeaders": [
      "PAYMENT-REQUIRED",
      "X-Payment-Response"
    ],
    "sandboxAuthHeader": "Authorization: Bearer shinn_sbx_..."
  },
  "security": [
    {
      "BearerSandboxAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerSandboxAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "shinn_sbx_...",
        "description": "Sandbox or provisioned spoke API key passed via `Authorization: Bearer shinn_sbx_...`. Issue a sandbox token at `/sandbox`."
      },
      "X402PaymentHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-PAYMENT",
        "description": "Base Mainnet (eip155:8453) USDC signed x402 payment payload paired with `PAYMENT-REQUIRED` challenge headers."
      }
    },
    "headers": {
      "PAYMENT-REQUIRED": {
        "description": "Base64/JSON x402 payment requirement returned with HTTP 402.",
        "schema": {
          "type": "string"
        }
      },
      "X-Payment-Response": {
        "description": "Signed x402 settlement receipt returned on paid HTTP 200 responses.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "ErrorEnvelope": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      },
      "X402Challenge": {
        "type": "object",
        "required": [
          "error",
          "network",
          "asset",
          "amount_usdc"
        ],
        "properties": {
          "error": {
            "type": "string",
            "example": "payment_required"
          },
          "network": {
            "type": "string",
            "example": "eip155:8453"
          },
          "asset": {
            "type": "string",
            "example": "USDC"
          },
          "amount_usdc": {
            "type": "string",
            "example": "0.02"
          },
          "pay_to": {
            "type": "string"
          },
          "sandbox_url": {
            "type": "string",
            "example": "https://tinkermcp.com/sandbox"
          }
        }
      },
      "CalculatorResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "tools_indexed": {
            "type": "integer"
          },
          "matches": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CompareResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "DossierResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "BenchmarkResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "MeterPreviewResponse": {
        "type": "object",
        "required": [
          "ok",
          "host",
          "auth_mode",
          "x402"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "auth_mode": {
            "type": "string",
            "example": "Authorization: Bearer shinn_sbx_..."
          },
          "remaining_credits": {
            "type": "integer"
          },
          "x402": {
            "$ref": "#/components/schemas/X402Challenge"
          }
        }
      }
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Live health check and 140-tool registry count",
        "description": "Returns worker health and indexed MCP tool count.",
        "responses": {
          "200": {
            "description": "Health JSON"
          }
        }
      }
    },
    "/api-docs": {
      "get": {
        "operationId": "getApiDocs",
        "summary": "Interactive Developer SDK & OpenAPI Docs Hub",
        "description": "Mobile-safe developer quickstart with cURL, Python, TypeScript, and Claude/Cursor MCP config snippets.",
        "responses": {
          "200": {
            "description": "Interactive HTML developer docs"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "summary": "OpenAPI 3.1.0 machine specification",
        "description": "Returns live OpenAPI 3.1.0 JSON tailored to tinkermcp.com.",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.0 JSON"
          }
        }
      }
    },
    "/.well-known/mcp.json": {
      "get": {
        "operationId": "getWellKnownMcp",
        "summary": "Model Context Protocol (MCP) discovery manifest",
        "description": "Returns Claude Desktop / Cursor MCP transport metadata and 140+ tool bundle links.",
        "responses": {
          "200": {
            "description": "MCP discovery JSON"
          }
        }
      }
    },
    "/api/v1/calculator": {
      "get": {
        "operationId": "getV1Calculator",
        "summary": "140-tool MCP sandbox search & cost calculator",
        "description": "Searches indexed MCP endpoints and calculates per-call sandbox / x402 inference cost.",
        "security": [
          {
            "BearerSandboxAuth": []
          },
          {
            "X402PaymentHeader": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "html"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON or interactive HTML",
            "headers": {
              "X-Payment-Response": {
                "$ref": "#/components/headers/X-Payment-Response"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalculatorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 Base USDC payment challenge",
            "headers": {
              "PAYMENT-REQUIRED": {
                "$ref": "#/components/headers/PAYMENT-REQUIRED"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402Challenge"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compare": {
      "get": {
        "operationId": "getV1Compare",
        "summary": "Programmatic competitor comparison matrix JSON",
        "description": "Compares TinkerMCP live venue telemetry against unverified MCP directories.",
        "security": [
          {
            "BearerSandboxAuth": []
          },
          {
            "X402PaymentHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Comparison JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompareResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 Base USDC payment challenge",
            "headers": {
              "PAYMENT-REQUIRED": {
                "$ref": "#/components/headers/PAYMENT-REQUIRED"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402Challenge"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dossiers": {
      "get": {
        "operationId": "getV1Dossiers",
        "summary": "Structured MCP tool & venue signal dossiers",
        "description": "Returns verified MCP tool telemetry and signal latency dossiers.",
        "security": [
          {
            "BearerSandboxAuth": []
          },
          {
            "X402PaymentHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Dossiers JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DossierResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 Base USDC payment challenge",
            "headers": {
              "PAYMENT-REQUIRED": {
                "$ref": "#/components/headers/PAYMENT-REQUIRED"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402Challenge"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/benchmarks": {
      "get": {
        "operationId": "getV1Benchmarks",
        "summary": "Pre-trade & MCP venue latency benchmarks",
        "description": "Returns live benchmark rows across indexed MCP feeds and execution venues.",
        "security": [
          {
            "BearerSandboxAuth": []
          },
          {
            "X402PaymentHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Benchmarks JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BenchmarkResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 Base USDC payment challenge",
            "headers": {
              "PAYMENT-REQUIRED": {
                "$ref": "#/components/headers/PAYMENT-REQUIRED"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402Challenge"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/meter-preview": {
      "get": {
        "operationId": "getV1MeterPreview",
        "summary": "Sandbox token & x402 Base USDC metering preview",
        "description": "Checks `Authorization: Bearer shinn_sbx_...` quota and returns x402 Base USDC (`eip155:8453`) header metadata.",
        "security": [
          {
            "BearerSandboxAuth": []
          },
          {
            "X402PaymentHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Metering preview JSON",
            "headers": {
              "X-Payment-Response": {
                "$ref": "#/components/headers/X-Payment-Response"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeterPreviewResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 Base USDC challenge",
            "headers": {
              "PAYMENT-REQUIRED": {
                "$ref": "#/components/headers/PAYMENT-REQUIRED"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402Challenge"
                }
              }
            }
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "getApiStatus",
        "summary": "Catalog status & indexed count",
        "description": "Returns live TinkerMCP catalog counts.",
        "responses": {
          "200": {
            "description": "JSON status"
          }
        }
      }
    },
    "/api/live/{slug}": {
      "get": {
        "operationId": "getLiveVenueFeed",
        "summary": "Live venue edge comparison feed",
        "description": "Returns live venue telemetry for a slug.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chart telemetry"
          }
        }
      }
    },
    "/api/connect-platform": {
      "post": {
        "operationId": "postConnectPlatform",
        "summary": "Connect custom venue URL",
        "description": "Registers a custom venue feed URL.",
        "responses": {
          "200": {
            "description": "Connected venue"
          }
        }
      }
    },
    "/api/syndication/bundles": {
      "get": {
        "operationId": "getSyndicationBundles",
        "summary": "140+ MCP syndication catalog",
        "description": "Lists syndication MCP server bundles.",
        "responses": {
          "200": {
            "description": "JSON catalog"
          }
        }
      }
    },
    "/api/syndication/openapi-31.json": {
      "get": {
        "operationId": "getSyndicationOpenApi",
        "summary": "Full OpenAPI 3.1 bundle",
        "description": "Returns full syndication OpenAPI 3.1 bundle.",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.0 spec"
          }
        }
      }
    },
    "/api/syndication/sync": {
      "post": {
        "operationId": "postSyndicationSync",
        "summary": "Run marketplace_openapi_actor_sync",
        "description": "Triggers catalog sync.",
        "responses": {
          "200": {
            "description": "Sync receipt"
          }
        }
      }
    },
    "/api/privacy/consent": {
      "get": {
        "operationId": "getPrivacyConsent",
        "summary": "Consent policy",
        "description": "Returns privacy policy.",
        "responses": {
          "200": {
            "description": "JSON policy"
          }
        }
      },
      "post": {
        "operationId": "savePrivacyConsent",
        "summary": "Record consent choice",
        "description": "Records privacy choice.",
        "responses": {
          "200": {
            "description": "Saved"
          }
        }
      }
    },
    "/api/panopticon/status": {
      "get": {
        "operationId": "getPanopticonStatus",
        "summary": "Panopticon hook status",
        "description": "Returns Panopticon hook status.",
        "responses": {
          "200": {
            "description": "Status"
          }
        }
      }
    }
  }
}