{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/specstream-ai/json-schema/specstream-ai-web-search-answer-schema.json",
  "title": "WebSearchAnswer",
  "description": "A kept answer, as the caller got it, with the words they sent and when.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/specstream-ai-openapi.json#/components/schemas/WebSearchAnswer",
  "additionalProperties": false,
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Id"
    },
    "request_id": {
      "title": "Request Id",
      "type": "string"
    },
    "query": {
      "title": "Query",
      "type": "string"
    },
    "kind": {
      "anyOf": [
        {
          "enum": [
            "list",
            "fact"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Kind"
    },
    "columns": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Columns"
    },
    "answer": {
      "anyOf": [
        {
          "$ref": "#/$defs/WebSearchValue"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "rows": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/WebSearchRow"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Rows"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/WebSearchSource"
      },
      "title": "Sources",
      "type": "array"
    },
    "handoff": {
      "anyOf": [
        {
          "$ref": "#/$defs/WebSearchHandoff"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "took_ms": {
      "title": "Took Ms",
      "type": "integer"
    },
    "price_usd": {
      "title": "Price Usd",
      "type": "number"
    },
    "passages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/WebSearchPassage"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Passages"
    },
    "page": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Page"
    },
    "next_page": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page"
    },
    "read_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Read At"
    },
    "corrected_query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Corrected Query"
    },
    "operators": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/WebSearchOperator"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Operators"
    },
    "relaxed": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/WebSearchRelaxed"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Relaxed"
    },
    "news": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "News"
    },
    "images": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Images"
    },
    "engines_asked": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Engines Asked"
    },
    "pages_pending": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Pages Pending"
    },
    "request": {
      "title": "Request",
      "type": "string"
    },
    "created_at": {
      "title": "Created At",
      "type": "string"
    }
  },
  "required": [
    "request_id",
    "query",
    "sources",
    "took_ms",
    "price_usd",
    "request",
    "created_at"
  ],
  "type": "object",
  "$defs": {
    "WebSearchCall": {
      "additionalProperties": false,
      "description": "POST /v1/web-search: the GET's query parameters as a JSON body, same names and defaults,\nchecked as the GET checks them, so the question is never in an address.",
      "properties": {
        "q": {
          "title": "Q",
          "type": "string"
        },
        "passages": {
          "default": false,
          "title": "Passages",
          "type": "boolean"
        },
        "compact": {
          "default": false,
          "title": "Compact",
          "type": "boolean"
        },
        "source_max_chars": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "maximum": 10000,
          "minimum": 1,
          "title": "Source Max Chars"
        },
        "num": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Num"
        },
        "page": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Page"
        },
        "speed": {
          "default": "default",
          "title": "Speed",
          "type": "string"
        },
        "language": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Language"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Country"
        },
        "safe": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Safe"
        },
        "news": {
          "default": false,
          "title": "News",
          "type": "boolean"
        },
        "images": {
          "default": false,
          "title": "Images",
          "type": "boolean"
        },
        "engines": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Engines"
        },
        "engines_asked": {
          "default": false,
          "title": "Engines Asked",
          "type": "boolean"
        },
        "image_size": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image Size"
        },
        "min_width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Min Width"
        },
        "min_height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Min Height"
        },
        "max_width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Width"
        },
        "max_height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Height"
        },
        "image_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image Type"
        },
        "image_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image Color"
        },
        "image_aspect": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image Aspect"
        },
        "pages_wait_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "maximum": 3500,
          "minimum": 0,
          "title": "Pages Wait Ms"
        },
        "like": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Pages you want more of.",
          "title": "Like"
        },
        "unlike": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Pages you do not want.",
          "title": "Unlike"
        }
      },
      "required": [
        "q"
      ],
      "title": "WebSearchCall",
      "type": "object"
    },
    "WebSearchHandoff": {
      "additionalProperties": false,
      "description": "The full table as a find: its estimated rows and the request to compile, whose quote\nprices it.",
      "properties": {
        "line": {
          "title": "Line",
          "type": "string"
        },
        "request": {
          "title": "Request",
          "type": "string"
        },
        "rows_estimated": {
          "title": "Rows Estimated",
          "type": "integer"
        },
        "rows_basis": {
          "enum": [
            "request",
            "page",
            "seen"
          ],
          "title": "Rows Basis",
          "type": "string"
        },
        "count_page": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Count Page"
        },
        "next": {
          "$ref": "#/$defs/WebSearchNext"
        }
      },
      "required": [
        "line",
        "request",
        "rows_estimated",
        "rows_basis",
        "count_page",
        "next"
      ],
      "title": "WebSearchHandoff",
      "type": "object"
    },
    "WebSearchNext": {
      "additionalProperties": false,
      "description": "The one call that goes on to the full table, with its arguments: the MCP tool and the\nAPI call that do the same.",
      "properties": {
        "tool": {
          "const": "compile",
          "title": "Tool",
          "type": "string"
        },
        "arguments": {
          "additionalProperties": true,
          "title": "Arguments",
          "type": "object"
        },
        "http": {
          "$ref": "#/$defs/WebSearchCall"
        }
      },
      "required": [
        "tool",
        "arguments",
        "http"
      ],
      "title": "WebSearchNext",
      "type": "object"
    },
    "WebSearchOperator": {
      "additionalProperties": false,
      "description": "How one kind of operator held on a reply's sources. A source shown to break an operator\nis never returned; the others either show they meet it (``shown``) or print nothing that\nsays either way.",
      "properties": {
        "kind": {
          "title": "Kind",
          "type": "string"
        },
        "shown": {
          "title": "Shown",
          "type": "integer"
        },
        "engines": {
          "items": {
            "type": "string"
          },
          "title": "Engines",
          "type": "array"
        }
      },
      "required": [
        "kind",
        "shown",
        "engines"
      ],
      "title": "WebSearchOperator",
      "type": "object"
    },
    "WebSearchPassage": {
      "additionalProperties": false,
      "properties": {
        "url": {
          "title": "Url",
          "type": "string"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "url",
        "title",
        "text"
      ],
      "title": "WebSearchPassage",
      "type": "object"
    },
    "WebSearchRelaxed": {
      "additionalProperties": false,
      "description": "One operator relaxed for this reply when no source held it.",
      "properties": {
        "kind": {
          "title": "Kind",
          "type": "string"
        },
        "operator": {
          "title": "Operator",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "operator"
      ],
      "title": "WebSearchRelaxed",
      "type": "object"
    },
    "WebSearchRow": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "page": {
          "title": "Page",
          "type": "string"
        },
        "snippet": {
          "title": "Snippet",
          "type": "string"
        },
        "probability": {
          "title": "Probability",
          "type": "number"
        },
        "fields": {
          "additionalProperties": {
            "$ref": "#/$defs/WebSearchValue"
          },
          "title": "Fields",
          "type": "object"
        },
        "sources": {
          "default": [],
          "items": {
            "type": "integer"
          },
          "title": "Sources",
          "type": "array"
        }
      },
      "required": [
        "name",
        "page",
        "snippet",
        "probability",
        "fields"
      ],
      "title": "WebSearchRow",
      "type": "object"
    },
    "WebSearchSource": {
      "additionalProperties": false,
      "description": "One search result the call read, in rank order.",
      "properties": {
        "url": {
          "title": "Url",
          "type": "string"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "site": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Site"
        },
        "snippet": {
          "title": "Snippet",
          "type": "string"
        },
        "cited": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Cited"
        },
        "published": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published"
        },
        "modified": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Modified"
        },
        "source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Source"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "file_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "File Type"
        },
        "read_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Read At"
        },
        "excerpt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Excerpt"
        },
        "meta": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Meta"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Image Url"
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Width"
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Height"
        },
        "mime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mime"
        },
        "thumbnail_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail Url"
        },
        "thumbnail_width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail Width"
        },
        "thumbnail_height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail Height"
        }
      },
      "required": [
        "url",
        "title",
        "snippet"
      ],
      "title": "WebSearchSource",
      "type": "object"
    },
    "WebSearchValue": {
      "additionalProperties": false,
      "properties": {
        "value": {
          "title": "Value",
          "type": "string"
        },
        "page": {
          "title": "Page",
          "type": "string"
        },
        "seen_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Seen At"
        },
        "confirmed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Confirmed"
        },
        "sources": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sources"
        }
      },
      "required": [
        "value",
        "page"
      ],
      "title": "WebSearchValue",
      "type": "object"
    }
  }
}