{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parallel-ai/json-schema/parallel-ai-v1-search-request-schema.json",
  "title": "V1SearchRequest",
  "description": "Search request.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parallel-ai-search-api-openapi.yml#/components/schemas/V1SearchRequest",
  "properties": {
    "objective": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Objective",
      "description": "Natural-language description of the underlying question or goal driving the search. Used together with search_queries to focus results on the most relevant content. Should be self-contained with enough context to understand the intent of the search."
    },
    "search_queries": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Search Queries",
      "description": "Concise keyword search queries, 3-6 words each. At least one query is required, provide 2-3 for best results. Used together with objective to focus results on the most relevant content."
    },
    "mode": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "turbo",
            "fast",
            "basic",
            "advanced"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Mode",
      "description": "Search mode preset: supported values are `turbo`, `fast`, `basic`, and `advanced`. Turbo mode is optimized for the fastest responses. Use Fast mode for high quality search within a 1-second latency budget. Basic mode offers low latency and works best with 2-3 high-quality search_queries. Advanced mode provides higher quality with more advanced retrieval and compression. Defaults to `advanced` when omitted."
    },
    "max_chars_total": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Chars Total",
      "description": "Upper bound on total characters across excerpts from all results."
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Session Id",
      "description": "Session identifier to track calls across separate search and extract calls, to be used as part of a larger task. Specifying it may give better contextual results for subsequent API calls."
    },
    "client_model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Model",
      "description": "The model generating this request and consuming the results. Enables optimizations and tailors default settings for the model's capabilities."
    },
    "advanced_settings": {
      "anyOf": [
        {
          "$ref": "#/$defs/AdvancedSearchSettings"
        },
        {
          "type": "null"
        }
      ],
      "description": "Advanced configuration for source policy, fetch policy, and excerpt settings. May impact result quality and latency unless used carefully. When omitted, excerpts are enabled by default."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "search_queries"
  ],
  "$defs": {
    "AdvancedSearchSettings": {
      "properties": {
        "source_policy": {
          "anyOf": [
            {
              "$ref": "#/$defs/SourcePolicy"
            },
            {
              "type": "null"
            }
          ],
          "description": "Domain and date filtering preferences for search results."
        },
        "fetch_policy": {
          "anyOf": [
            {
              "$ref": "#/$defs/FetchPolicy"
            },
            {
              "type": "null"
            }
          ],
          "description": "Fetch policy: determines when to return cached content from the index (faster) vs fetching live content (fresher). Default is to disable live fetch and return cached content from the index. Note: enabling live fetch significantly increases search latency because it requires fetching content from source websites."
        },
        "excerpt_settings": {
          "anyOf": [
            {
              "$ref": "#/$defs/V1ExcerptSettings"
            },
            {
              "type": "null"
            }
          ],
          "description": "Controls excerpt sizes. Provide excerpt settings for fine-grained control, or omit to use defaults."
        },
        "location": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Location",
          "description": "ISO 3166-1 alpha-2 country code for geo-targeted search results."
        },
        "max_results": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Results",
          "description": "Upper bound on the number of results to return. Defaults to 10 if not provided."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AdvancedSearchSettings",
      "description": "Advanced search configuration.\n\nThese settings may impact result quality and latency unless used carefully.\nSee https://docs.parallel.ai/search/advanced-search-settings for more info."
    },
    "FetchPolicy": {
      "properties": {
        "max_age_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Age Seconds",
          "description": "Maximum age of cached content in seconds to trigger a live fetch. Minimum value 600 seconds (10 minutes)."
        },
        "timeout_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timeout Seconds",
          "description": "Timeout in seconds for fetching live content if unavailable in cache."
        },
        "disable_cache_fallback": {
          "type": "boolean",
          "title": "Disable Cache Fallback",
          "description": "If false, fallback to cached content older than max-age if live fetch fails or times out. If true, returns an error instead.",
          "default": false
        }
      },
      "type": "object",
      "title": "FetchPolicy",
      "description": "Policy for live fetching web results."
    },
    "SourcePolicy": {
      "properties": {
        "include_domains": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Include Domains",
          "description": "List of domains to restrict the results to. If specified, only sources from these domains will be included. Accepts plain domains (e.g., example.com, subdomain.example.gov) or bare domain extension starting with a period (e.g., .gov, .edu, .co.uk). The combined number of domains in include_domains and exclude_domains cannot exceed 200."
        },
        "exclude_domains": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Exclude Domains",
          "description": "List of domains to exclude from results. If specified, sources from these domains will be excluded. Accepts plain domains (e.g., example.com, subdomain.example.gov) or bare domain extension starting with a period (e.g., .gov, .edu, .co.uk). The combined number of domains in include_domains and exclude_domains cannot exceed 200."
        },
        "after_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "After Date",
          "description": "Optional start date for filtering search results. Results will be limited to content published on or after this date. Provided as an RFC 3339 date string (YYYY-MM-DD)."
        }
      },
      "type": "object",
      "title": "SourcePolicy",
      "description": "Source policy for web search results.\n\nThis policy governs which sources are allowed/disallowed in results."
    },
    "V1ExcerptSettings": {
      "properties": {
        "max_chars_per_result": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Chars Per Result",
          "description": "Optional upper bound on the total number of characters to include per url. Excerpts may contain fewer characters than this limit to maximize relevance and token efficiency."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "V1ExcerptSettings",
      "description": "Optional settings for returning relevant excerpts."
    }
  }
}