{
  "swagger": "2.0",
  "info": {
    "title": "SourceStrand Agent Preview Connector",
    "version": "1.0.0",
    "description": "Copilot-friendly OpenAPI 2.0 subset for SourceStrand AI data streams. The connector focuses on free previews, route intent, and payment-intent handoff; x402 paid retry must happen in an authorized wallet or x402-capable client."
  },
  "host": "api.sourcestrand.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/agent-tools.json": {
      "get": {
        "operationId": "getAgentTools",
        "summary": "Get SourceStrand agent tool catalog",
        "description": "Returns preview-first tool metadata, endpoint templates, source trust fields, and x402 handoff guidance for AI assistants.",
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/assistant-compatibility.json": {
      "get": {
        "operationId": "getAssistantCompatibility",
        "summary": "Get assistant-specific integration guidance",
        "description": "Returns setup guidance for ChatGPT, Gemini, Claude, Perplexity, and Microsoft Copilot, including function-call tool declarations and safe payment handoff rules.",
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/agent/route-intent": {
      "get": {
        "operationId": "routeBuyerIntent",
        "summary": "Route buyer question to best preview",
        "description": "Use this first when the buyer asks a natural-language question and the agent needs the safest free preview endpoint before any x402 paid request.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "type": "string",
            "minLength": 2,
            "maxLength": 240,
            "description": "Buyer question, for example Taiwan semiconductor supplier packaging or HS 8542 Taiwan export demand."
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "400": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/preview/tw-data-packs/{pack}": {
      "get": {
        "operationId": "previewTaiwanDataPack",
        "summary": "Preview Taiwan data pack",
        "description": "Returns a free record-backed preview with sample records, lineage, limitations, freshness_policy, agent_cache, and paid_unlock metadata.",
        "parameters": [
          {
            "name": "pack",
            "in": "path",
            "required": true,
            "type": "string",
            "enum": [
              "supplier-discovery",
              "trade-import-export",
              "regulated-supplier-compliance",
              "export-control-screening",
              "factory-operational-risk",
              "public-company-signals",
              "compliance-risk"
            ]
          },
          {
            "name": "buyer_hint",
            "in": "query",
            "required": false,
            "type": "string",
            "description": "Optional attribution handle for the assistant, partner, or campaign."
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "400": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/preview/tw-company/dossier": {
      "get": {
        "operationId": "previewTaiwanCompanyDossier",
        "summary": "Preview Taiwan company dossier routing",
        "description": "Shows how SourceStrand can stitch company brief, procurement, semiconductor, entity graph, trade, compliance, and factory context after resolving a business_id or company name.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "type": "string",
            "minLength": 2,
            "maxLength": 160
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "400": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/preview/changes/tw-data-packs": {
      "get": {
        "operationId": "previewTaiwanDataPackChanges",
        "summary": "Preview Taiwan data-pack change feed",
        "description": "Returns sample diff fields and repeat-refresh guidance for a Taiwan data pack before paid follow-up.",
        "parameters": [
          {
            "name": "pack",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "supplier-discovery",
              "trade-import-export",
              "regulated-supplier-compliance",
              "export-control-screening",
              "factory-operational-risk",
              "public-company-signals",
              "compliance-risk"
            ]
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "type": "string",
            "description": "Optional ISO datetime. Use previous successful fetch if unavailable."
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "400": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/preview/watchlist/tw-data-products": {
      "get": {
        "operationId": "previewTaiwanDataWatchlist",
        "summary": "Preview Taiwan data watchlist routing",
        "description": "Turns a company or sector query into suggested watch keys, repeat-refresh checks, and paid follow-ups.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "type": "string",
            "minLength": 2,
            "maxLength": 160
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "400": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    },
    "/v1/payment/intent": {
      "get": {
        "operationId": "createPaymentIntent",
        "summary": "Create x402 payment-intent handoff",
        "description": "Creates a payment intent for a selected paid resource URL. Agents without explicit payment authority should return approval_url to the human buyer instead of paying automatically.",
        "parameters": [
          {
            "name": "resource_url",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Full paid SourceStrand resource URL selected from route-intent or preview paid_unlock metadata."
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "400": {
            "description": "JSON response",
            "schema": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    }
  },
  "definitions": {
    "JsonObject": {
      "type": "object",
      "additionalProperties": true
    }
  }
}