{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/g62-ai/json-schema/g62-ai-search-schema.json",
  "title": "Search",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/g62-ai-openapi.json#/components/schemas/Search",
  "type": "object",
  "required": [
    "operationId",
    "state"
  ],
  "properties": {
    "operationId": {
      "type": "string",
      "pattern": "^live-[a-zA-Z0-9-]{8,100}$",
      "description": "A caller-generated live- UUID used for this search and every retry. Reusing it with changed inputs fails."
    },
    "state": {
      "type": "string",
      "description": "queued or running: poll; done: read result; failed: known failure; uncertain: operator reconciliation required. Never automatically resubmit an uncertain job."
    },
    "jobId": {
      "type": "string"
    },
    "creditCost": {
      "type": "integer"
    },
    "charged": {
      "type": "number"
    },
    "pollAfterMs": {
      "type": "integer"
    },
    "message": {
      "type": "string"
    },
    "evidenceNotice": {
      "type": "string"
    },
    "result": {
      "type": "object",
      "description": "Coverage and ranking metadata plus patent candidates. Abstracts are not automatically matched passages; full-text coverage varies by source.",
      "additionalProperties": true,
      "properties": {
        "hits": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "pn": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "abstract_snippet": {
                "type": "string"
              },
              "pub": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Publication date as YYYYMMDD when known."
              }
            }
          }
        },
        "partial": {
          "type": "boolean",
          "description": "Preserve coverage caveats; a populated list is not proof of exhaustive retrieval."
        }
      }
    }
  }
}