{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentionsapi-com/json-schema/mentionsapi-com-check-response-schema.json",
  "title": "CheckResponse",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentionsapi-com-openapi.json#/components/schemas/CheckResponse",
  "type": "object",
  "required": [
    "request_id",
    "id",
    "mode",
    "query",
    "brand",
    "providers",
    "created_at",
    "duration_ms",
    "cost_cents",
    "balance_after_cents",
    "cache_hit"
  ],
  "properties": {
    "request_id": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "mode": {
      "$ref": "#/$defs/CheckMode"
    },
    "query": {
      "type": "string"
    },
    "brand": {
      "type": "string"
    },
    "providers": {
      "type": "object",
      "description": "Keyed by chatgpt, claude, gemini, perplexity, ai_overview, ai_mode, or bing_copilot.",
      "additionalProperties": {
        "$ref": "#/$defs/ProviderCheckResult"
      }
    },
    "errors": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/CheckProviderError"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "duration_ms": {
      "type": "integer"
    },
    "cost_cents": {
      "type": "integer",
      "description": "Credits charged after proration and the cache-hit price."
    },
    "balance_after_cents": {
      "type": "integer",
      "description": "Credit balance after this call."
    },
    "cache_hit": {
      "type": "boolean"
    }
  },
  "$defs": {
    "BrandEntity": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "CheckCitation": {
      "type": "object",
      "required": [
        "url",
        "title"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "maxLength": 300,
          "description": "Quoted span, when the engine reports one."
        },
        "branding": {
          "$ref": "#/$defs/CitationBranding"
        }
      }
    },
    "CheckMode": {
      "type": "string",
      "enum": [
        "quick",
        "perplexity_live",
        "realistic",
        "chatgpt_live",
        "gemini_live",
        "ai_overview",
        "ai_mode",
        "bing_copilot",
        "all_live",
        "deep",
        "change_track"
      ],
      "description": "realistic is a deprecated alias of perplexity_live. deep and change_track return 501."
    },
    "CheckProviderError": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "CitationBranding": {
      "type": "object",
      "properties": {
        "logo_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "primary_color": {
          "type": [
            "string",
            "null"
          ]
        },
        "secondary_color": {
          "type": [
            "string",
            "null"
          ]
        },
        "og_image": {
          "type": [
            "string",
            "null"
          ]
        },
        "site_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "fetched_at": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ProviderCheckResult": {
      "type": "object",
      "required": [
        "mentioned",
        "rank",
        "context",
        "citations",
        "fan_out"
      ],
      "properties": {
        "mentioned": {
          "type": "boolean"
        },
        "rank": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "context": {
          "type": "string"
        },
        "surface_present": {
          "type": "boolean"
        },
        "citations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CheckCitation"
          }
        },
        "fan_out": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "brand_entities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BrandEntity"
          }
        },
        "sponsored": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SponsoredResult"
          }
        },
        "raw": {
          "type": "string",
          "description": "Present when include contains 'raw'."
        }
      }
    },
    "SponsoredResult": {
      "type": "object",
      "required": [
        "advertiser",
        "title",
        "url",
        "domain",
        "rendered"
      ],
      "properties": {
        "advertiser": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "domain": {
          "type": "string"
        },
        "rendered": {
          "type": "boolean"
        }
      }
    }
  }
}