{
  "openapi": "3.1.0",
  "info": {
    "title": "BSVKey Contact Gauge",
    "version": "1.0.0",
    "description": "Scores whether to talk with a person for audience cross-pollination. $0.02 per evaluation, paid in Bitcoin BSV over x402. GET /v1/schema returns the paid endpoint URL."
  },
  "servers": [{ "url": "https://gauge.bsvkey.com" }],
  "paths": {
    "/v1/schema": {
      "get": {
        "summary": "Free: input fields, allowed values, price and paid endpoint URL",
        "responses": { "200": { "description": "Schema", "content": { "application/json": {} } } }
      }
    },
    "/v1/validate": {
      "post": {
        "summary": "Free: strict check of an evaluation body before paying",
        "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Input" } } } },
        "responses": {
          "200": { "description": "Valid" },
          "422": { "description": "Invalid, with errors list" }
        }
      }
    },
    "/v1/evaluate": {
      "post": {
        "summary": "Returns 402 with paidEndpoint. POST the same body there and pay over x402.",
        "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Input" } } } },
        "responses": { "402": { "description": "Payment required; see paidEndpoint" } }
      }
    }
  },
  "components": {
    "schemas": {
      "Input": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": { "type": "string", "maxLength": 200 },
          "platform": { "type": "string", "maxLength": 200 },
          "yourWork": { "type": "string", "maxLength": 200 },
          "sender": { "type": "string", "maxLength": 200 },
          "format": { "enum": ["dm", "call", "recorded", "live", "copost"] },
          "followers": { "type": ["number", "null"], "minimum": 0 },
          "engagement": { "enum": ["real", "some", "hollow", "unknown"] },
          "overlap": { "enum": ["adjacent", "same", "different", "unrelated", "unknown"] },
          "target": { "enum": ["direct", "some", "none", "unknown"] },
          "credibility": { "enum": ["strong", "ok", "weak", "unknown"] },
          "network": { "enum": ["high", "some", "none", "unknown"] },
          "give": { "enum": ["high", "some", "low", "unknown"] },
          "reciprocity": { "enum": ["yes", "maybe", "no", "unknown"] },
          "result": { "enum": ["investor", "customer", "partner", "content", "none"] },
          "minutes": { "type": "number", "minimum": 0, "maximum": 1440 },
          "depth": { "enum": ["mission", "product", "technical"] },
          "redFlag": { "type": "boolean" },
          "regulated": { "type": "boolean" },
          "controlledTopicsLikely": { "type": "boolean" },
          "foreignAudience": { "type": "boolean" },
          "preBrief": { "type": "boolean" },
          "competitorsListening": { "type": "boolean" },
          "mixesBrands": { "type": "boolean" }
        }
      }
    }
  }
}
