{
  "openapi": "3.1.0",
  "info": {
    "title": "LLM Visibility Tracker API",
    "version": "1.0.0",
    "description": "Real-time AI Search Visibility, LLM Brand Citation, Competitor Share-of-Voice & Google AI Overview API. Track ChatGPT, Perplexity, Claude, Gemini & Google AI Mode mentions at 1/10th the cost of $499/mo GEO suites. Supports x-api-key (lv_live_*), Remote MCP (OAuth 2.1), and keyless Base Mainnet USDC x402.",
    "contact": {
      "name": "LLM Visibility Tracker Engineering",
      "url": "https://llmvisibilitytracker.com",
      "email": "support@llmvisibilitytracker.com"
    }
  },
  "servers": [
    {
      "url": "https://api.llmvisibilitytracker.com",
      "description": "Production AI Visibility Gateway"
    }
  ],
  "security": [
    { "ApiKeyHeader": [] },
    { "BearerAuth": [] }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key prefixed with lv_live_ (claim 3,000 Free Credits at https://llmvisibilitytracker.com/signup)"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token (lv_live_* API key or mcp_at_* OAuth 2.1 access token)"
      }
    },
    "schemas": {
      "CitedSource": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "domain": { "type": "string" },
          "position": { "type": "integer" },
          "snippet": { "type": "string" }
        }
      },
      "PromptCheckData": {
        "type": "object",
        "properties": {
          "prompt": { "type": "string" },
          "brand": { "type": ["string", "null"] },
          "model": { "type": "string", "enum": ["chatgpt", "perplexity", "claude", "gemini"] },
          "model_version": { "type": "string" },
          "web_search": { "type": "boolean" },
          "brand_mentioned": { "type": "boolean" },
          "brand_cited": { "type": "boolean" },
          "mention_count": { "type": "integer" },
          "mention_rank": { "type": ["integer", "null"] },
          "sentiment": { "type": "string", "enum": ["positive", "neutral", "negative", "not_mentioned"] },
          "visibility_score": { "type": "integer", "minimum": 0, "maximum": 100 },
          "cited_urls": { "type": "array", "items": { "$ref": "#/components/schemas/CitedSource" } },
          "excerpt": { "type": "string" },
          "answer_markdown": { "type": "string" },
          "checked_at": { "type": "string", "format": "date-time" }
        }
      },
      "CompetitorSovData": {
        "type": "object",
        "properties": {
          "prompt": { "type": "string" },
          "model": { "type": "string", "enum": ["chatgpt", "perplexity", "claude", "gemini"] },
          "winner": { "type": ["string", "null"] },
          "total_brand_mentions": { "type": "integer" },
          "competitors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "brand": { "type": "string" },
                "mentioned": { "type": "boolean" },
                "mention_count": { "type": "integer" },
                "first_position_rank": { "type": ["integer", "null"] },
                "share_of_voice_pct": { "type": "number" },
                "cited_count": { "type": "integer" },
                "sentiment": { "type": "string" }
              }
            }
          },
          "cited_urls": { "type": "array", "items": { "$ref": "#/components/schemas/CitedSource" } },
          "answer_excerpt": { "type": "string" },
          "checked_at": { "type": "string", "format": "date-time" }
        }
      },
      "AiOverviewData": {
        "type": "object",
        "properties": {
          "keyword": { "type": "string" },
          "brand": { "type": ["string", "null"] },
          "location_code": { "type": "integer" },
          "language_code": { "type": "string" },
          "has_ai_overview": { "type": "boolean" },
          "brand_mentioned": { "type": "boolean" },
          "brand_cited": { "type": "boolean" },
          "brand_citation_positions": { "type": "array", "items": { "type": "integer" } },
          "total_citations": { "type": "integer" },
          "summary_excerpt": { "type": "string" },
          "markdown": { "type": "string" },
          "references": { "type": "array", "items": { "$ref": "#/components/schemas/CitedSource" } },
          "checked_at": { "type": "string", "format": "date-time" }
        }
      },
      "DomainMentionsData": {
        "type": "object",
        "properties": {
          "domain": { "type": "string" },
          "platform": { "type": "string", "enum": ["google", "chat_gpt"] },
          "location_code": { "type": "integer" },
          "visibility_score": { "type": "integer" },
          "total_mentions": { "type": "integer" },
          "ai_search_volume": { "type": "integer" },
          "impressions": { "type": "integer" },
          "citation_share_pct": { "type": "number" },
          "sentiment": {
            "type": "object",
            "properties": {
              "positive_pct": { "type": "number" },
              "neutral_pct": { "type": "number" },
              "negative_pct": { "type": "number" }
            }
          },
          "platform_breakdown": { "type": "array", "items": { "type": "object" } },
          "top_cited_pages": { "type": "array", "items": { "type": "object" } },
          "data_source": { "type": "string" },
          "checked_at": { "type": "string", "format": "date-time" }
        }
      }
    }
  },
  "paths": {
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Gateway health & supported models check (0 Credits)",
        "security": [],
        "responses": {
          "200": {
            "description": "Gateway is operational",
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "provider": "https://llmvisibilitytracker.com",
                  "status": "ok",
                  "msg": "success",
                  "data": {
                    "service": "llmvisibilitytracker-gateway",
                    "status": "healthy",
                    "models_supported": ["chatgpt", "perplexity", "claude", "gemini", "google_ai_overview"],
                    "endpoints_count": 4
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/visibility/prompt-check": {
      "get": {
        "operationId": "checkLlmBrandPrompt",
        "summary": "Check Brand Mention, Rank & Sentiment in ChatGPT, Perplexity, Claude or Gemini",
        "description": "Runs a real-time prompt against ChatGPT, Perplexity, Claude, or Gemini and returns brand mention boolean, 1-based rank, sentiment, visibility score, excerpt, and cited URLs. Costs 50 Credits ($0.005) standard or 400 Credits ($0.04) with web_search=true. 24h PG+Redis cache.",
        "parameters": [
          { "name": "prompt", "in": "query", "required": true, "schema": { "type": "string" }, "example": "What are the top 3 developer payment APIs in 2026?" },
          { "name": "brand", "in": "query", "required": false, "schema": { "type": "string" }, "example": "stripe.com" },
          { "name": "model", "in": "query", "required": false, "schema": { "type": "string", "enum": ["chatgpt", "perplexity", "claude", "gemini"], "default": "chatgpt" } },
          { "name": "web_search", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } }
        ],
        "responses": {
          "200": {
            "description": "Prompt visibility check result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": { "type": "integer", "example": 0 },
                    "provider": { "type": "string", "example": "https://llmvisibilitytracker.com" },
                    "status": { "type": "string", "example": "ok" },
                    "data": { "$ref": "#/components/schemas/PromptCheckData" }
                  }
                },
                "example": {
                  "code": 0,
                  "provider": "https://llmvisibilitytracker.com",
                  "status": "ok",
                  "msg": "success",
                  "meta": { "cached": false, "took_ms": 2840 },
                  "data": {
                    "prompt": "What are the top 3 developer payment APIs in 2026?",
                    "brand": "stripe.com",
                    "model": "chatgpt",
                    "model_version": "gpt-4o-mini-2024-07-18",
                    "web_search": false,
                    "brand_mentioned": true,
                    "brand_cited": true,
                    "mention_count": 3,
                    "mention_rank": 1,
                    "sentiment": "positive",
                    "visibility_score": 92,
                    "cited_urls": [
                      { "title": "Stripe API Reference", "url": "https://stripe.com/docs/api", "domain": "stripe.com", "position": 1 }
                    ],
                    "excerpt": "1. Stripe: Renowned for its developer experience, clean REST APIs, typed SDKs, and built-in fraud prevention."
                  }
                }
              }
            }
          },
          "402": { "description": "Insufficient credits or x402 Base Mainnet USDC payment required ($0.005 USDC)" }
        }
      }
    },
    "/v1/visibility/competitor-sov": {
      "get": {
        "operationId": "compareCompetitorShareOfVoice",
        "summary": "Compare Competitor AI Share-of-Voice Matrix on a Buying-Intent Prompt",
        "description": "Evaluates 2 to 8 competing brands head-to-head on a single LLM prompt and returns Share-of-Voice %, 1-based rank, sentiment, and category winner. Costs 50 Credits ($0.005). 24h PG+Redis cache.",
        "parameters": [
          { "name": "prompt", "in": "query", "required": true, "schema": { "type": "string" }, "example": "What are the best developer payment APIs in 2026?" },
          { "name": "brands", "in": "query", "required": true, "schema": { "type": "string" }, "example": "stripe,adyen,paddle" },
          { "name": "model", "in": "query", "required": false, "schema": { "type": "string", "enum": ["chatgpt", "perplexity", "claude", "gemini"], "default": "chatgpt" } }
        ],
        "responses": {
          "200": {
            "description": "Competitor Share-of-Voice comparison matrix",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": { "type": "integer" },
                    "status": { "type": "string" },
                    "data": { "$ref": "#/components/schemas/CompetitorSovData" }
                  }
                },
                "example": {
                  "code": 0,
                  "provider": "https://llmvisibilitytracker.com",
                  "status": "ok",
                  "data": {
                    "prompt": "What are the best developer payment APIs in 2026?",
                    "model": "chatgpt",
                    "winner": "stripe",
                    "total_brand_mentions": 6,
                    "competitors": [
                      { "brand": "stripe", "mentioned": true, "mention_count": 3, "first_position_rank": 1, "share_of_voice_pct": 50.0, "cited_count": 2, "sentiment": "positive" },
                      { "brand": "adyen", "mentioned": true, "mention_count": 2, "first_position_rank": 2, "share_of_voice_pct": 33.3, "cited_count": 1, "sentiment": "positive" },
                      { "brand": "paddle", "mentioned": true, "mention_count": 1, "first_position_rank": 3, "share_of_voice_pct": 16.7, "cited_count": 1, "sentiment": "neutral" }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/visibility/ai-overview": {
      "get": {
        "operationId": "getGoogleAiOverview",
        "summary": "Extract Google AI Mode & AI Overview Answer, Citations & Brand Positions",
        "description": "Extracts live Google AI Mode generative answer markdown, all cited reference URLs and domains, and brand citation positions. Costs 80 Credits ($0.008). 24h PG+Redis cache.",
        "parameters": [
          { "name": "keyword", "in": "query", "required": true, "schema": { "type": "string" }, "example": "best payment api for developers" },
          { "name": "brand", "in": "query", "required": false, "schema": { "type": "string" }, "example": "stripe.com" },
          { "name": "location_code", "in": "query", "required": false, "schema": { "type": "integer", "default": 2840 } },
          { "name": "language_code", "in": "query", "required": false, "schema": { "type": "string", "default": "en" } }
        ],
        "responses": {
          "200": {
            "description": "Google AI Overview citations result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": { "type": "integer" },
                    "status": { "type": "string" },
                    "data": { "$ref": "#/components/schemas/AiOverviewData" }
                  }
                },
                "example": {
                  "code": 0,
                  "provider": "https://llmvisibilitytracker.com",
                  "status": "ok",
                  "data": {
                    "keyword": "best payment api for developers",
                    "brand": "stripe.com",
                    "location_code": 2840,
                    "has_ai_overview": true,
                    "brand_mentioned": true,
                    "brand_cited": true,
                    "brand_citation_positions": [1, 4],
                    "total_citations": 6,
                    "references": [
                      { "title": "Stripe API Reference", "url": "https://stripe.com/docs/api", "domain": "stripe.com", "position": 1 }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/visibility/domain-mentions": {
      "get": {
        "operationId": "getDomainLlmMentions",
        "summary": "Audit Domain-Wide Aggregated LLM Mentions, AI Search Volume & Cited Pages",
        "description": "Returns domain-level aggregated LLM mentions, AI search volume, impressions, citation share %, platform breakdown, and top cited URLs. Pre-cached top 50 benchmark domains (e.g. stripe.com, vercel.com, supabase.com, linear.app) cost 50 Credits ($0.005) on any tier; uncached live custom domains require a funded account and cost 3,500 Credits ($0.35) with 72h PG+Redis caching.",
        "parameters": [
          { "name": "domain", "in": "query", "required": true, "schema": { "type": "string" }, "example": "stripe.com" },
          { "name": "platform", "in": "query", "required": false, "schema": { "type": "string", "enum": ["google", "chat_gpt"], "default": "google" } },
          { "name": "location_code", "in": "query", "required": false, "schema": { "type": "integer", "default": 2840 } }
        ],
        "responses": {
          "200": {
            "description": "Aggregated domain LLM mention scorecard",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": { "type": "integer" },
                    "status": { "type": "string" },
                    "data": { "$ref": "#/components/schemas/DomainMentionsData" }
                  }
                },
                "example": {
                  "code": 0,
                  "provider": "https://llmvisibilitytracker.com",
                  "status": "ok",
                  "data": {
                    "domain": "stripe.com",
                    "platform": "google",
                    "location_code": 2840,
                    "visibility_score": 94,
                    "total_mentions": 48210,
                    "ai_search_volume": 1842000,
                    "impressions": 6120400,
                    "citation_share_pct": 38.4,
                    "data_source": "benchmark_snapshot"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
