{
  "openapi": "3.1.0",
  "info": {
    "title": "jamesshinn.ai Commercial Data API",
    "version": "3.1.0",
    "description": "JamesShinn.ai live AI agent benchmarks, MCP endpoint discovery, sandbox metering, and commercial intelligence API."
  },
  "servers": [
    {
      "url": "https://jamesshinn.ai",
      "description": "jamesshinn.ai production edge"
    }
  ],
  "paths": {
    "/.well-known/mcp.json": {
      "get": {
        "summary": "MCP server manifest",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "Streamable-HTTP MCP tool execution",
        "responses": {
          "200": {
            "description": "OK"
          },
          "402": {
            "description": "Payment Required — $49/mo Builder Pass, $199/mo Commercial Pass, or $0.02/crawl Base USDC x402"
          }
        }
      }
    },
    "/v1/call/{slug}": {
      "get": {
        "summary": "Metered commercial feed lookup",
        "responses": {
          "200": {
            "description": "OK"
          },
          "402": {
            "description": "Payment Required — $49/mo Builder Pass or $0.02/crawl Base USDC x402"
          }
        }
      }
    },
    "/bulk/{slug}": {
      "get": {
        "summary": "Bulk Parquet dataset download",
        "responses": {
          "200": {
            "description": "OK"
          },
          "402": {
            "description": "Payment Required — $199/mo Commercial Pass or $0.02/crawl Base USDC x402"
          }
        }
      }
    },
    "/api/cohort/feed": {
      "get": {
        "summary": "Anonymized Micro-PE 97% deal feed ($299/mo)",
        "responses": {
          "200": {
            "description": "OK (3-row preview unauthenticated; full feed with $299/mo key)"
          },
          "402": {
            "description": "Payment Required — $299/mo Micro-PE Subscription Pass"
          }
        }
      }
    },
    "/api/telemetry/bot-radar": {
      "get": {
        "summary": "Verified AI crawler demand telemetry",
        "responses": {
          "200": {
            "description": "OK"
          },
          "402": {
            "description": "Payment Required — Commercial AI Crawler Pass"
          }
        }
      }
    },
    "/api/privacy/request": {
      "post": {
        "summary": "CCPA / GDPR privacy request submission",
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/api-docs": {
      "get": {
        "operationId": "getApiDocs",
        "summary": "Interactive Developer SDK & OpenAPI Docs Hub",
        "description": "Mobile-safe developer quickstart with copyable cURL, Python, TypeScript, and Claude Desktop / Cursor MCP snippets.",
        "responses": {
          "200": {
            "description": "Interactive HTML developer documentation page"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "summary": "OpenAPI 3.1.0 machine specification",
        "description": "Returns live OpenAPI 3.1.0 JSON tailored to jamesshinn.ai.",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.0 JSON"
          }
        }
      }
    },
    "/api/v1/calculator": {
      "get": {
        "operationId": "getV1Calculator",
        "summary": "Interactive domain risk & ROI calculator and D1 lookup",
        "description": "Queries live jamesshinn.ai D1 records and computes deterministic scoring/ROI bands.",
        "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": "Calculator 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 jamesshinn.ai verified telemetry against industry alternatives.",
        "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 entity & record dossiers",
        "description": "Returns structured dossiers and verification provenance from jamesshinn.ai.",
        "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": "Live domain telemetry benchmarks",
        "description": "Returns statistical benchmark rows for jamesshinn.ai.",
        "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": "Inspects `Authorization: Bearer shinn_sbx_...` quota status 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 payment challenge",
            "headers": {
              "PAYMENT-REQUIRED": {
                "$ref": "#/components/headers/PAYMENT-REQUIRED"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402Challenge"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-spoke-host": "jamesshinn.ai",
  "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 token passed via `Authorization: Bearer shinn_sbx_...`. Mint 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://jamesshinn.ai/sandbox"
          }
        }
      },
      "CalculatorResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "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"
          }
        }
      }
    }
  }
}