> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# LLM Context

> LLM Context

## Request contract

* **Method and path:** POST /apis/v1/brave/llm/context
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/brave/llm/context`
* **accept:** header; optional
* **api-version:** header; optional
* **cache-control:** header; optional
* **user-agent:** header; optional
* **x-loc-city:** header; optional
* **x-loc-country:** header; optional
* **x-loc-lat:** header; optional
* **x-loc-long:** header; optional
* **x-loc-postal-code:** header; optional
* **x-loc-state:** header; optional
* **x-loc-state-name:** header; optional

[Complete OpenAPI definition](https://aisa.one/docs/openapi/brave-search.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "post_any_brave_search_apis_v1_brave_llm_context",
  "method": "POST",
  "path": "/apis/v1/brave/llm/context",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "deprecated": false,
      "description": "The default supported media type is application/json.",
      "examples": {
        "0": {
          "value": "application/json"
        }
      },
      "in": "header",
      "name": "accept",
      "required": false,
      "schema": {
        "allOf": [
          {
            "enum": [
              "application/json",
              "*/*"
            ],
            "title": "Accept",
            "type": "string"
          },
          {
            "default": "application/json"
          }
        ],
        "description": "The default supported media type is application/json.",
        "examples": [
          "application/json"
        ],
        "title": "Media type"
      }
    },
    {
      "deprecated": false,
      "description": "The API version to use.                 This is denoted by the format <code>YYYY-MM-DD</code>.                 Default is the latest that is available. Read                 more about <a href=\"/documentation/guides/versioning\">API versioning</a>.",
      "in": "header",
      "name": "api-version",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The API version to use.                 This is denoted by the format <code>YYYY-MM-DD</code>.                 Default is the latest that is available. Read                 more about <a href=\"/documentation/guides/versioning\">API versioning</a>.",
        "title": "API version"
      }
    },
    {
      "deprecated": false,
      "description": "Brave Search will return cached content by default.                 To prevent caching set the Cache-Control header to <code>no-cache</code>.                 This is currently done as best effort.",
      "in": "header",
      "name": "cache-control",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "const": "no-cache",
            "enum": [
              "no-cache"
            ],
            "title": "CacheControl",
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "Brave Search will return cached content by default.                 To prevent caching set the Cache-Control header to <code>no-cache</code>.                 This is currently done as best effort.",
        "title": "Cache control"
      }
    },
    {
      "deprecated": false,
      "description": "The user agent originating the request.                 Brave search can utilize the user agent to provide a different                 experience depending on the device as described by the string.                 The user agent should follow the commonly used browser agent                 strings on each platform. For more information on curating user agents,                 see <a href=\"https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent\">RFC 9110</a>.",
      "examples": {
        "Android": {
          "description": "Android",
          "value": "Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.71 Mobile Safari/537.36"
        },
        "Windows": {
          "description": "Windows",
          "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        "iOS": {
          "description": "iOS",
          "value": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63 Mobile/15E148 Safari/604.1"
        },
        "macOS": {
          "description": "macOS",
          "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        }
      },
      "in": "header",
      "name": "user-agent",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The user agent originating the request.                 Brave search can utilize the user agent to provide a different                 experience depending on the device as described by the string.                 The user agent should follow the commonly used browser agent                 strings on each platform. For more information on curating user agents,                 see <a href=\"https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent\">RFC 9110</a>.",
        "title": "User agent"
      }
    },
    {
      "deprecated": false,
      "description": "The generic name of the client city",
      "examples": {
        "City in USA": {
          "value": "Ann Arbor"
        }
      },
      "in": "header",
      "name": "x-loc-city",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The generic name of the client city",
        "title": "X-Loc-City"
      }
    },
    {
      "deprecated": false,
      "description": "The two letter country code for the client’s country.                 For a list of country codes,                 see <a href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\">ISO 3166-1 alpha-2</a>",
      "examples": {
        "Country alpha-2 code": {
          "value": "US"
        }
      },
      "in": "header",
      "name": "x-loc-country",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "enum": [
              "AD",
              "AE",
              "AF",
              "AG",
              "AI",
              "AL",
              "AM",
              "AO",
              "AQ",
              "AR",
              "AS",
              "AT",
              "AU",
              "AW",
              "AX",
              "AZ",
              "BA",
              "BB",
              "BD",
              "BE",
              "BF",
              "BG",
              "BH",
              "BI",
              "BJ",
              "BL",
              "BM",
              "BN",
              "BO",
              "BQ",
              "BR",
              "BS",
              "BT",
              "BV",
              "BW",
              "BY",
              "BZ",
              "CA",
              "CC",
              "CD",
              "CF",
              "CG",
              "CH",
              "CI",
              "CK",
              "CL",
              "CM",
              "CN",
              "CO",
              "CR",
              "CU",
              "CV",
              "CW",
              "CX",
              "CY",
              "CZ",
              "DE",
              "DJ",
              "DK",
              "DM",
              "DO",
              "DZ",
              "EC",
              "EE",
              "EG",
              "EH",
              "ER",
              "ES",
              "ET",
              "FI",
              "FJ",
              "FK",
              "FM",
              "FO",
              "FR",
              "GA",
              "GB",
              "GD",
              "GE",
              "GF",
              "GG",
              "GH",
              "GI",
              "GL",
              "GM",
              "GN",
              "GP",
              "GQ",
              "GR",
              "GS",
              "GT",
              "GU",
              "GW",
              "GY",
              "HK",
              "HM",
              "HN",
              "HR",
              "HT",
              "HU",
              "ID",
              "IE",
              "IL",
              "IM",
              "IN",
              "IO",
              "IQ",
              "IR",
              "IS",
              "IT",
              "JE",
              "JM",
              "JO",
              "JP",
              "KE",
              "KG",
              "KH",
              "KI",
              "KM",
              "KN",
              "KP",
              "KR",
              "KW",
              "KY",
              "KZ",
              "LA",
              "LB",
              "LC",
              "LI",
              "LK",
              "LR",
              "LS",
              "LT",
              "LU",
              "LV",
              "LY",
              "MA",
              "MC",
              "MD",
              "ME",
              "MF",
              "MG",
              "MH",
              "MK",
              "ML",
              "MM",
              "MN",
              "MO",
              "MP",
              "MQ",
              "MR",
              "MS",
              "MT",
              "MU",
              "MV",
              "MW",
              "MX",
              "MY",
              "MZ",
              "NA",
              "NC",
              "NE",
              "NF",
              "NG",
              "NI",
              "NL",
              "NO",
              "NP",
              "NR",
              "NU",
              "NZ",
              "OM",
              "PA",
              "PE",
              "PF",
              "PG",
              "PH",
              "PK",
              "PL",
              "PM",
              "PN",
              "PR",
              "PS",
              "PT",
              "PW",
              "PY",
              "QA",
              "RE",
              "RO",
              "RS",
              "RU",
              "RW",
              "SA",
              "SB",
              "SC",
              "SD",
              "SE",
              "SG",
              "SH",
              "SI",
              "SJ",
              "SK",
              "SL",
              "SM",
              "SN",
              "SO",
              "SR",
              "SS",
              "ST",
              "SV",
              "SX",
              "SY",
              "SZ",
              "TC",
              "TD",
              "TF",
              "TG",
              "TH",
              "TJ",
              "TK",
              "TL",
              "TM",
              "TN",
              "TO",
              "TR",
              "TT",
              "TV",
              "TW",
              "TZ",
              "UA",
              "UG",
              "UM",
              "US",
              "UY",
              "UZ",
              "VA",
              "VC",
              "VE",
              "VG",
              "VI",
              "VN",
              "VU",
              "WF",
              "WS",
              "YE",
              "YT",
              "ZA",
              "ZM",
              "ZW"
            ],
            "title": "Country",
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The two letter country code for the client’s country.                 For a list of country codes,                 see <a href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\">ISO 3166-1 alpha-2</a>",
        "title": "X-Loc-Country"
      }
    },
    {
      "deprecated": false,
      "description": "The latitude of the client’s geographical location in degrees,                 to provide relevant local results. The latitude must be greater                 than or equal to -90.0 degrees and less than or equal to +90.0 degrees.",
      "examples": {
        "None": {}
      },
      "in": "header",
      "name": "x-loc-lat",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "maximum": 90,
            "minimum": -90,
            "type": "number"
          },
          {
            "type": "null"
          }
        ],
        "description": "The latitude of the client’s geographical location in degrees,                 to provide relevant local results. The latitude must be greater                 than or equal to -90.0 degrees and less than or equal to +90.0 degrees.",
        "title": "X-Loc-Lat"
      }
    },
    {
      "deprecated": false,
      "description": "The longitude of the client’s geographical location in degrees,                 to provide relevant local results. The longitude must be greater                 than or equal to -180.0 and less than or equal to +180.0 degrees.",
      "examples": {
        "None": {}
      },
      "in": "header",
      "name": "x-loc-long",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "maximum": 180,
            "minimum": -180,
            "type": "number"
          },
          {
            "type": "null"
          }
        ],
        "description": "The longitude of the client’s geographical location in degrees,                 to provide relevant local results. The longitude must be greater                 than or equal to -180.0 and less than or equal to +180.0 degrees.",
        "title": "X-Loc-Long"
      }
    },
    {
      "deprecated": false,
      "description": "The client’s postal code",
      "examples": {
        "Postal code in Ann Harbor, Michigan, US": {
          "value": "48105"
        }
      },
      "in": "header",
      "name": "x-loc-postal-code",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The client’s postal code",
        "title": "X-Loc-Postal-Code"
      }
    },
    {
      "deprecated": false,
      "description": "A code which could be up to three characters, that represent the client’s state/region.                 The region is the first-level subdivision (the broadest or least specific) of the                 <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
      "examples": {
        "Michigan State/Region code in USA": {
          "value": "MI"
        }
      },
      "in": "header",
      "name": "x-loc-state",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "A code which could be up to three characters, that represent the client’s state/region.                 The region is the first-level subdivision (the broadest or least specific) of the                 <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
        "title": "X-Loc-State"
      }
    },
    {
      "deprecated": false,
      "description": "The name of the client’s state/region.                 The region is the first-level subdivision (the broadest or least specific) of the                 <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
      "examples": {
        "Michigan generic state name in USA": {
          "value": "Michigan"
        }
      },
      "in": "header",
      "name": "x-loc-state-name",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The name of the client’s state/region.                 The region is the first-level subdivision (the broadest or least specific) of the                 <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
        "title": "X-Loc-State-Name"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "context_threshold_mode": {
              "anyOf": [
                {
                  "enum": [
                    "disabled",
                    "strict",
                    "lenient",
                    "balanced"
                  ],
                  "title": "SummarizerContextThresholdMode",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The mode to use to determine the threshold for including content in context."
            },
            "count": {
              "description": "The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50.",
              "maximum": 50,
              "minimum": 1,
              "title": "Count",
              "type": "integer"
            },
            "country": {
              "allOf": [
                {
                  "enum": [
                    "AR",
                    "AU",
                    "AT",
                    "BE",
                    "BR",
                    "CA",
                    "CL",
                    "DK",
                    "FI",
                    "FR",
                    "DE",
                    "GR",
                    "HK",
                    "IN",
                    "ID",
                    "IT",
                    "JP",
                    "KR",
                    "MY",
                    "MX",
                    "NL",
                    "NZ",
                    "NO",
                    "CN",
                    "PL",
                    "PT",
                    "PH",
                    "RU",
                    "SA",
                    "ZA",
                    "ES",
                    "SE",
                    "CH",
                    "TW",
                    "TR",
                    "GB",
                    "US",
                    "ALL"
                  ],
                  "title": "SearchCountry",
                  "type": "string"
                },
                {
                  "default": "US"
                }
              ],
              "description": "The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries."
            },
            "enable_local": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether to enable local recall. Not setting this value means auto-detect: local recall is used if a location is provided (<code>X-Loc-Lat</code> with <code>X-Loc-Long</code>, or <code>X-Loc-City</code>).",
              "title": "Enable Local"
            },
            "enable_source_metadata": {
              "default": false,
              "description": "Enable source metadata enrichment (site_name, favicon, thumbnail, description, fetched_content_timestamp) in the sources attribute of the response.",
              "title": "Enable Source Metadata",
              "type": "boolean"
            },
            "freshness": {
              "default": "",
              "description": "<p>Filters search results by page age. The age of a page is determined by the most relevant date reported by the content, such as its published or last modified date. The following values are supported:</p>\n<ul>\n<li><strong>pd</strong> - Pages aged 24 hours or less.</li>\n<li><strong>pw</strong> - Pages aged 7 days or less.</li>\n<li><strong>pm</strong> - Pages aged 31 days or less.</li>\n<li><strong>py</strong> - Pages aged 365 days or less.</li>\n<li><strong>YYYY-MM-DDtoYYYY-MM-DD</strong> - A custom date range is also supported by specifying start and end dates e.g. <code>2022-04-01to2022-07-30</code>.</li>\n</ul>",
              "examples": [
                "",
                "pm",
                "2022-04-01to2022-07-30"
              ],
              "title": "Freshness",
              "type": "string"
            },
            "goggles": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Goggles act as a custom re-ranking on top of Brave’s search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. For more details, see the <a href=\"/documentation/resources/goggles\">Goggles documentation</a>. The parameter can be a single Goggle or a list of up to 3 Goggles.",
              "title": "Goggles"
            },
            "maximum_number_of_tokens": {
              "default": 8192,
              "description": "Approximate maximum number of tokens to include in context. The default is <code>8192</code> and maximum is <code>32768</code>.",
              "maximum": 32768,
              "minimum": 1024,
              "title": "Maximum Number Of Tokens",
              "type": "integer"
            },
            "maximum_number_of_tokens_per_url": {
              "description": "Maximum number of tokens to include per URL. The default is <code>4096</code> and maximum is <code>8192</code>.",
              "maximum": 8192,
              "minimum": 512,
              "title": "Maximum Number Of Tokens Per Url",
              "type": "integer"
            },
            "maximum_number_of_urls": {
              "description": "Maximum number of different URLs to include in LLM context.",
              "maximum": 50,
              "minimum": 1,
              "title": "Maximum Number Of Urls",
              "type": "integer"
            },
            "operators": {
              "default": true,
              "description": "Whether to apply search operators.",
              "title": "Operators",
              "type": "boolean"
            },
            "operators_fallback": {
              "default": true,
              "description": "Whether to fall back to the original results when search operators return no results.",
              "title": "Operators Fallback",
              "type": "boolean"
            },
            "q": {
              "description": "The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query.",
              "maxLength": 600,
              "minLength": 1,
              "title": "Q",
              "type": "string"
            },
            "safesearch": {
              "anyOf": [
                {
                  "enum": [
                    "off",
                    "moderate",
                    "strict"
                  ],
                  "title": "SafeSearch",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "<p>Filters results for adult content. The following values are supported:</p>\n<ul>\n<li><strong>off</strong> - No filtering is done.</li>\n<li><strong>moderate</strong> - Drops adult content from the results used for context.</li>\n<li><strong>strict</strong> - Drops all adult content from the results used for context.</li>\n</ul>\n<p>When not set, no filtering is applied — except for local recall, which stays <code>strict</code>.</p>",
              "title": "Safe search"
            },
            "search_lang": {
              "allOf": [
                {
                  "enum": [
                    "ar",
                    "eu",
                    "bn",
                    "bg",
                    "ca",
                    "zh-hans",
                    "zh-hant",
                    "hr",
                    "cs",
                    "da",
                    "nl",
                    "en",
                    "en-gb",
                    "et",
                    "fi",
                    "fr",
                    "gl",
                    "de",
                    "el",
                    "gu",
                    "he",
                    "hi",
                    "hu",
                    "is",
                    "it",
                    "ja",
                    "jp",
                    "kn",
                    "ko",
                    "lv",
                    "lt",
                    "ms",
                    "ml",
                    "mr",
                    "nb",
                    "pl",
                    "pt-br",
                    "pt-pt",
                    "pa",
                    "ro",
                    "ru",
                    "sr",
                    "sk",
                    "sl",
                    "es",
                    "sv",
                    "ta",
                    "te",
                    "th",
                    "tr",
                    "uk",
                    "vi"
                  ],
                  "title": "Language",
                  "type": "string"
                },
                {
                  "default": "en"
                }
              ],
              "description": "The search language preference. The 2 or more character language code for which the search results are provided."
            },
            "spellcheck": {
              "default": true,
              "description": "Whether to enable spellcheck on the query.",
              "title": "Spellcheck",
              "type": "boolean"
            }
          },
          "required": [
            "q"
          ],
          "title": "LLMContextParameters",
          "type": "object"
        }
      }
    },
    "description": "",
    "required": true
  },
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## Cost and request rules

Request pricing. Default request estimate: \$0.005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.


## OpenAPI

````yaml openapi/brave-search.json POST /apis/v1/brave/llm/context
openapi: 3.1.0
info:
  description: ''
  title: Brave Search
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    brave-search:
      description: ''
      title: Brave Search
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 1a33626eaeae62e76e9c639775194a0fb4a6aa9a06aa3c4da50f9205e06ac5e3
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/brave/images/search
    - /apis/v1/brave/llm/context
    - /apis/v1/brave/local/descriptions
    - /apis/v1/brave/local/place_search
    - /apis/v1/brave/local/pois
    - /apis/v1/brave/news/search
    - /apis/v1/brave/spellcheck/search
    - /apis/v1/brave/suggest/search
    - /apis/v1/brave/videos/search
    - /apis/v1/brave/web/rich
    - /apis/v1/brave/web/search
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:6bdf9a79120cfa3c1510309a034288fe7081adac85a7e7aba9c8759638fc9a24
    facts_hash: 1a33626eaeae62e76e9c639775194a0fb4a6aa9a06aa3c4da50f9205e06ac5e3
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: brave-search
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/brave/llm/context:
    post:
      tags:
        - default
      summary: LLM Context
      operationId: post_any_brave_search_apis_v1_brave_llm_context
      parameters:
        - deprecated: false
          description: The default supported media type is application/json.
          examples:
            '0':
              value: application/json
          in: header
          name: accept
          required: false
          schema:
            allOf:
              - enum:
                  - application/json
                  - '*/*'
                title: Accept
                type: string
              - default: application/json
            description: The default supported media type is application/json.
            examples:
              - application/json
            title: Media type
        - deprecated: false
          description: >-
            The API version to use.                 This is denoted by the
            format <code>YYYY-MM-DD</code>.                 Default is the
            latest that is available. Read                 more about <a
            href="/documentation/guides/versioning">API versioning</a>.
          in: header
          name: api-version
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The API version to use.                 This is denoted by the
              format <code>YYYY-MM-DD</code>.                 Default is the
              latest that is available. Read                 more about <a
              href="/documentation/guides/versioning">API versioning</a>.
            title: API version
        - deprecated: false
          description: >-
            Brave Search will return cached content by default.                
            To prevent caching set the Cache-Control header to
            <code>no-cache</code>.                 This is currently done as
            best effort.
          in: header
          name: cache-control
          required: false
          schema:
            anyOf:
              - const: no-cache
                enum:
                  - no-cache
                title: CacheControl
                type: string
              - type: 'null'
            description: >-
              Brave Search will return cached content by
              default.                 To prevent caching set the Cache-Control
              header to <code>no-cache</code>.                 This is currently
              done as best effort.
            title: Cache control
        - deprecated: false
          description: >-
            The user agent originating the request.                 Brave search
            can utilize the user agent to provide a different                
            experience depending on the device as described by the
            string.                 The user agent should follow the commonly
            used browser agent                 strings on each platform. For
            more information on curating user agents,                 see <a
            href="https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent">RFC
            9110</a>.
          examples:
            Android:
              description: Android
              value: >-
                Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like
                Gecko) Chrome/103.0.5060.71 Mobile Safari/537.36
            Windows:
              description: Windows
              value: >-
                Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
                (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
            iOS:
              description: iOS
              value: >-
                Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X)
                AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63
                Mobile/15E148 Safari/604.1
            macOS:
              description: macOS
              value: >-
                Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/537.36
                (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
          in: header
          name: user-agent
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The user agent originating the request.                 Brave
              search can utilize the user agent to provide a
              different                 experience depending on the device as
              described by the string.                 The user agent should
              follow the commonly used browser agent                 strings on
              each platform. For more information on curating user
              agents,                 see <a
              href="https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent">RFC
              9110</a>.
            title: User agent
        - deprecated: false
          description: The generic name of the client city
          examples:
            City in USA:
              value: Ann Arbor
          in: header
          name: x-loc-city
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The generic name of the client city
            title: X-Loc-City
        - deprecated: false
          description: >-
            The two letter country code for the client’s
            country.                 For a list of country
            codes,                 see <a
            href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1
            alpha-2</a>
          examples:
            Country alpha-2 code:
              value: US
          in: header
          name: x-loc-country
          required: false
          schema:
            anyOf:
              - enum:
                  - AD
                  - AE
                  - AF
                  - AG
                  - AI
                  - AL
                  - AM
                  - AO
                  - AQ
                  - AR
                  - AS
                  - AT
                  - AU
                  - AW
                  - AX
                  - AZ
                  - BA
                  - BB
                  - BD
                  - BE
                  - BF
                  - BG
                  - BH
                  - BI
                  - BJ
                  - BL
                  - BM
                  - BN
                  - BO
                  - BQ
                  - BR
                  - BS
                  - BT
                  - BV
                  - BW
                  - BY
                  - BZ
                  - CA
                  - CC
                  - CD
                  - CF
                  - CG
                  - CH
                  - CI
                  - CK
                  - CL
                  - CM
                  - CN
                  - CO
                  - CR
                  - CU
                  - CV
                  - CW
                  - CX
                  - CY
                  - CZ
                  - DE
                  - DJ
                  - DK
                  - DM
                  - DO
                  - DZ
                  - EC
                  - EE
                  - EG
                  - EH
                  - ER
                  - ES
                  - ET
                  - FI
                  - FJ
                  - FK
                  - FM
                  - FO
                  - FR
                  - GA
                  - GB
                  - GD
                  - GE
                  - GF
                  - GG
                  - GH
                  - GI
                  - GL
                  - GM
                  - GN
                  - GP
                  - GQ
                  - GR
                  - GS
                  - GT
                  - GU
                  - GW
                  - GY
                  - HK
                  - HM
                  - HN
                  - HR
                  - HT
                  - HU
                  - ID
                  - IE
                  - IL
                  - IM
                  - IN
                  - IO
                  - IQ
                  - IR
                  - IS
                  - IT
                  - JE
                  - JM
                  - JO
                  - JP
                  - KE
                  - KG
                  - KH
                  - KI
                  - KM
                  - KN
                  - KP
                  - KR
                  - KW
                  - KY
                  - KZ
                  - LA
                  - LB
                  - LC
                  - LI
                  - LK
                  - LR
                  - LS
                  - LT
                  - LU
                  - LV
                  - LY
                  - MA
                  - MC
                  - MD
                  - ME
                  - MF
                  - MG
                  - MH
                  - MK
                  - ML
                  - MM
                  - MN
                  - MO
                  - MP
                  - MQ
                  - MR
                  - MS
                  - MT
                  - MU
                  - MV
                  - MW
                  - MX
                  - MY
                  - MZ
                  - NA
                  - NC
                  - NE
                  - NF
                  - NG
                  - NI
                  - NL
                  - 'NO'
                  - NP
                  - NR
                  - NU
                  - NZ
                  - OM
                  - PA
                  - PE
                  - PF
                  - PG
                  - PH
                  - PK
                  - PL
                  - PM
                  - PN
                  - PR
                  - PS
                  - PT
                  - PW
                  - PY
                  - QA
                  - RE
                  - RO
                  - RS
                  - RU
                  - RW
                  - SA
                  - SB
                  - SC
                  - SD
                  - SE
                  - SG
                  - SH
                  - SI
                  - SJ
                  - SK
                  - SL
                  - SM
                  - SN
                  - SO
                  - SR
                  - SS
                  - ST
                  - SV
                  - SX
                  - SY
                  - SZ
                  - TC
                  - TD
                  - TF
                  - TG
                  - TH
                  - TJ
                  - TK
                  - TL
                  - TM
                  - TN
                  - TO
                  - TR
                  - TT
                  - TV
                  - TW
                  - TZ
                  - UA
                  - UG
                  - UM
                  - US
                  - UY
                  - UZ
                  - VA
                  - VC
                  - VE
                  - VG
                  - VI
                  - VN
                  - VU
                  - WF
                  - WS
                  - YE
                  - YT
                  - ZA
                  - ZM
                  - ZW
                title: Country
                type: string
              - type: 'null'
            description: >-
              The two letter country code for the client’s
              country.                 For a list of country
              codes,                 see <a
              href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1
              alpha-2</a>
            title: X-Loc-Country
        - deprecated: false
          description: >-
            The latitude of the client’s geographical location in
            degrees,                 to provide relevant local results. The
            latitude must be greater                 than or equal to -90.0
            degrees and less than or equal to +90.0 degrees.
          examples:
            None: {}
          in: header
          name: x-loc-lat
          required: false
          schema:
            anyOf:
              - maximum: 90
                minimum: -90
                type: number
              - type: 'null'
            description: >-
              The latitude of the client’s geographical location in
              degrees,                 to provide relevant local results. The
              latitude must be greater                 than or equal to -90.0
              degrees and less than or equal to +90.0 degrees.
            title: X-Loc-Lat
        - deprecated: false
          description: >-
            The longitude of the client’s geographical location in
            degrees,                 to provide relevant local results. The
            longitude must be greater                 than or equal to -180.0
            and less than or equal to +180.0 degrees.
          examples:
            None: {}
          in: header
          name: x-loc-long
          required: false
          schema:
            anyOf:
              - maximum: 180
                minimum: -180
                type: number
              - type: 'null'
            description: >-
              The longitude of the client’s geographical location in
              degrees,                 to provide relevant local results. The
              longitude must be greater                 than or equal to -180.0
              and less than or equal to +180.0 degrees.
            title: X-Loc-Long
        - deprecated: false
          description: The client’s postal code
          examples:
            Postal code in Ann Harbor, Michigan, US:
              value: '48105'
          in: header
          name: x-loc-postal-code
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The client’s postal code
            title: X-Loc-Postal-Code
        - deprecated: false
          description: >-
            A code which could be up to three characters, that represent the
            client’s state/region.                 The region is the first-level
            subdivision (the broadest or least specific) of the                
            <a href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a>
            code.
          examples:
            Michigan State/Region code in USA:
              value: MI
          in: header
          name: x-loc-state
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              A code which could be up to three characters, that represent the
              client’s state/region.                 The region is the
              first-level subdivision (the broadest or least specific) of
              the                 <a
              href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a>
              code.
            title: X-Loc-State
        - deprecated: false
          description: >-
            The name of the client’s state/region.                 The region is
            the first-level subdivision (the broadest or least specific) of
            the                 <a
            href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a> code.
          examples:
            Michigan generic state name in USA:
              value: Michigan
          in: header
          name: x-loc-state-name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The name of the client’s state/region.                 The region
              is the first-level subdivision (the broadest or least specific) of
              the                 <a
              href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a>
              code.
            title: X-Loc-State-Name
      requestBody:
        content:
          application/json:
            schema:
              properties:
                context_threshold_mode:
                  anyOf:
                    - enum:
                        - disabled
                        - strict
                        - lenient
                        - balanced
                      title: SummarizerContextThresholdMode
                      type: string
                    - type: 'null'
                  description: >-
                    The mode to use to determine the threshold for including
                    content in context.
                count:
                  description: >-
                    The maximum number of search results considered to select
                    the LLM context data. The default is 20 and the maximum is
                    50.
                  maximum: 50
                  minimum: 1
                  title: Count
                  type: integer
                country:
                  allOf:
                    - enum:
                        - AR
                        - AU
                        - AT
                        - BE
                        - BR
                        - CA
                        - CL
                        - DK
                        - FI
                        - FR
                        - DE
                        - GR
                        - HK
                        - IN
                        - ID
                        - IT
                        - JP
                        - KR
                        - MY
                        - MX
                        - NL
                        - NZ
                        - 'NO'
                        - CN
                        - PL
                        - PT
                        - PH
                        - RU
                        - SA
                        - ZA
                        - ES
                        - SE
                        - CH
                        - TW
                        - TR
                        - GB
                        - US
                        - ALL
                      title: SearchCountry
                      type: string
                    - default: US
                  description: >-
                    The search query country, where the results come from. The
                    country string is limited to 2 character country codes of
                    supported countries.
                enable_local:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  description: >-
                    Whether to enable local recall. Not setting this value means
                    auto-detect: local recall is used if a location is provided
                    (<code>X-Loc-Lat</code> with <code>X-Loc-Long</code>, or
                    <code>X-Loc-City</code>).
                  title: Enable Local
                enable_source_metadata:
                  default: false
                  description: >-
                    Enable source metadata enrichment (site_name, favicon,
                    thumbnail, description, fetched_content_timestamp) in the
                    sources attribute of the response.
                  title: Enable Source Metadata
                  type: boolean
                freshness:
                  default: ''
                  description: >-
                    <p>Filters search results by page age. The age of a page is
                    determined by the most relevant date reported by the
                    content, such as its published or last modified date. The
                    following values are supported:</p>

                    <ul>

                    <li><strong>pd</strong> - Pages aged 24 hours or less.</li>

                    <li><strong>pw</strong> - Pages aged 7 days or less.</li>

                    <li><strong>pm</strong> - Pages aged 31 days or less.</li>

                    <li><strong>py</strong> - Pages aged 365 days or less.</li>

                    <li><strong>YYYY-MM-DDtoYYYY-MM-DD</strong> - A custom date
                    range is also supported by specifying start and end dates
                    e.g. <code>2022-04-01to2022-07-30</code>.</li>

                    </ul>
                  examples:
                    - ''
                    - pm
                    - 2022-04-01to2022-07-30
                  title: Freshness
                  type: string
                goggles:
                  anyOf:
                    - type: string
                    - items:
                        type: string
                      type: array
                    - type: 'null'
                  description: >-
                    Goggles act as a custom re-ranking on top of Brave’s search
                    index. The parameter supports both a url where the Goggle is
                    hosted or the definition of the Goggle. For more details,
                    see the <a href="/documentation/resources/goggles">Goggles
                    documentation</a>. The parameter can be a single Goggle or a
                    list of up to 3 Goggles.
                  title: Goggles
                maximum_number_of_tokens:
                  default: 8192
                  description: >-
                    Approximate maximum number of tokens to include in context.
                    The default is <code>8192</code> and maximum is
                    <code>32768</code>.
                  maximum: 32768
                  minimum: 1024
                  title: Maximum Number Of Tokens
                  type: integer
                maximum_number_of_tokens_per_url:
                  description: >-
                    Maximum number of tokens to include per URL. The default is
                    <code>4096</code> and maximum is <code>8192</code>.
                  maximum: 8192
                  minimum: 512
                  title: Maximum Number Of Tokens Per Url
                  type: integer
                maximum_number_of_urls:
                  description: Maximum number of different URLs to include in LLM context.
                  maximum: 50
                  minimum: 1
                  title: Maximum Number Of Urls
                  type: integer
                operators:
                  default: true
                  description: Whether to apply search operators.
                  title: Operators
                  type: boolean
                operators_fallback:
                  default: true
                  description: >-
                    Whether to fall back to the original results when search
                    operators return no results.
                  title: Operators Fallback
                  type: boolean
                q:
                  description: >-
                    The user’s search query term. Query can not be empty.
                    Maximum of 600 characters and 75 words in the query.
                  maxLength: 600
                  minLength: 1
                  title: Q
                  type: string
                safesearch:
                  anyOf:
                    - enum:
                        - 'off'
                        - moderate
                        - strict
                      title: SafeSearch
                      type: string
                    - type: 'null'
                  description: >-
                    <p>Filters results for adult content. The following values
                    are supported:</p>

                    <ul>

                    <li><strong>off</strong> - No filtering is done.</li>

                    <li><strong>moderate</strong> - Drops adult content from the
                    results used for context.</li>

                    <li><strong>strict</strong> - Drops all adult content from
                    the results used for context.</li>

                    </ul>

                    <p>When not set, no filtering is applied — except for local
                    recall, which stays <code>strict</code>.</p>
                  title: Safe search
                search_lang:
                  allOf:
                    - enum:
                        - ar
                        - eu
                        - bn
                        - bg
                        - ca
                        - zh-hans
                        - zh-hant
                        - hr
                        - cs
                        - da
                        - nl
                        - en
                        - en-gb
                        - et
                        - fi
                        - fr
                        - gl
                        - de
                        - el
                        - gu
                        - he
                        - hi
                        - hu
                        - is
                        - it
                        - ja
                        - jp
                        - kn
                        - ko
                        - lv
                        - lt
                        - ms
                        - ml
                        - mr
                        - nb
                        - pl
                        - pt-br
                        - pt-pt
                        - pa
                        - ro
                        - ru
                        - sr
                        - sk
                        - sl
                        - es
                        - sv
                        - ta
                        - te
                        - th
                        - tr
                        - uk
                        - vi
                      title: Language
                      type: string
                    - default: en
                  description: >-
                    The search language preference. The 2 or more character
                    language code for which the search results are provided.
                spellcheck:
                  default: true
                  description: Whether to enable spellcheck on the query.
                  title: Spellcheck
                  type: boolean
              required:
                - q
              title: LLMContextParameters
              type: object
        description: ''
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ResponseFea24D07380F_LLMContextAPIResponse
          description: Successful Response
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  schemas:
    ResponseFea24D07380F_LLMContextAPIResponse:
      description: Response model for the LLM Context API (/v1/llm/context).
      properties:
        grounding:
          $ref: '#/components/schemas/ResponseFea24D07380F_LLMContext'
          default:
            generic: []
            map: []
        sources:
          additionalProperties:
            $ref: '#/components/schemas/ResponseFea24D07380F_Source'
          default: {}
          description: Metadata for all referenced URLs, keyed by URL.
          title: Sources
          type: object
      title: LLMContextAPIResponse
      type: object
    ResponseFea24D07380F_LLMContext:
      description: Container for all LLM context content by type.
      properties:
        generic:
          default: []
          description: Array of LLM context items with extracted web content.
          items:
            $ref: '#/components/schemas/ResponseFea24D07380F_LLMContextItem'
          title: Generic
          type: array
        map:
          default: []
          description: >-
            Map/place results. When <code>enable_local</code> is enabled, the
            response may include map data.
          items:
            $ref: '#/components/schemas/ResponseFea24D07380F_LLMContextMapItem'
          title: Map
          type: array
        poi:
          anyOf:
            - $ref: '#/components/schemas/ResponseFea24D07380F_LLMContextPOIItem'
            - type: 'null'
          description: >-
            Point of interest data. When <code>enable_local</code> is enabled,
            the response may include POI data.
      title: LLMContext
      type: object
    ResponseFea24D07380F_Source:
      description: Minimal metadata for a referenced source URL.
      properties:
        age:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            The page’s date rendered four ways, in fixed positions: full date,
            <code>YYYY-MM-DD</code>, relative age, and an ISO 8601 timestamp.
            Empty when the page has no known date.
          title: Age
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The page’s own description, independent of the query (unlike
            <code>snippet</code>). Requires <code>enable_source_metadata</code>.
          title: Description
        favicon:
          anyOf:
            - type: string
            - type: 'null'
          description: URL to the site’s favicon image.
          title: Favicon
        fetched_content_timestamp:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Unix seconds of the index’s last fetch of this page. Requires
            <code>enable_source_metadata</code>.
          title: Fetched Content Timestamp
        hostname:
          default: ''
          description: The source hostname.
          title: Hostname
          type: string
        robotstxt_status:
          anyOf:
            - enum:
                - allow
                - disallow
                - unknown
              type: string
            - type: 'null'
          description: >-
            Robots.txt status for the requested user-agent: allow, disallow, or
            unknown.
          title: Robotstxt Status
        site_name:
          anyOf:
            - type: string
            - type: 'null'
          description: The site name (e.g. ‘Wikipedia’).
          title: Site Name
        snippet:
          anyOf:
            - type: string
            - type: 'null'
          description: The most query-relevant passage of the source page.
          title: Snippet
        thumbnail:
          anyOf:
            - $ref: >-
                #/components/schemas/ResponseFea24D07380F_snakepit__models__search_api__specs__atomic__Thumbnail
            - type: 'null'
          description: >-
            Page thumbnail: <code>src</code> is the proxied URL (ready to
            serve); <code>original</code> is the raw upstream URL.
        title:
          default: ''
          description: The page title.
          title: Title
          type: string
      title: Source
      type: object
    ResponseFea24D07380F_LLMContextItem:
      description: >-
        A single LLM context item with URL, title, snippets, and optional last
        modified dates.
      properties:
        snippets:
          default: []
          description: >-
            Extracted text chunks from the page that are picked for their
            relevance to the query.
          items:
            type: string
          title: Snippets
          type: array
        title:
          default: ''
          description: The page title.
          title: Title
          type: string
        url:
          default: ''
          description: The source URL.
          title: Url
          type: string
      title: LLMContextItem
      type: object
    ResponseFea24D07380F_LLMContextMapItem:
      description: >-
        A map/place item returned in the <code>map</code> array for local recall
        queries.
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The name of the place.
          title: Name
        snippets:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: The snippets about the place.
          title: Snippets
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: The title of the place.
          title: Title
        url:
          anyOf:
            - type: string
            - type: 'null'
          description: The URL of the place.
          title: Url
      title: LLMContextMapItem
      type: object
    ResponseFea24D07380F_LLMContextPOIItem:
      description: >-
        A point of interest item returned in the <code>poi</code> array for
        local recall queries.
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The name of the point of interest.
          title: Name
        snippets:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: The snippets about the point of interest.
          title: Snippets
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: The title of the point of interest.
          title: Title
        url:
          anyOf:
            - type: string
            - type: 'null'
          description: The URL of the point of interest.
          title: Url
      title: LLMContextPOIItem
      type: object
    ResponseFea24D07380F_snakepit__models__search_api__specs__atomic__Thumbnail:
      description: Aggregated details representing a picture thumbnail.
      properties:
        alt:
          anyOf:
            - type: string
            - type: 'null'
          description: The alt text for the thumbnail image.
          title: Alt
        bg_color:
          anyOf:
            - type: string
            - type: 'null'
          description: The background color of the thumbnail.
          title: Bg Color
        duplicated:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether the thumbnail is a duplicate.
          title: Duplicated
        height:
          anyOf:
            - type: integer
            - type: 'null'
          description: The height of the thumbnail.
          title: Height
        logo:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether the thumbnail is a logo.
          title: Logo
        original:
          anyOf:
            - type: string
            - type: 'null'
          description: The original URL of the image.
          title: Original
        src:
          description: The served URL of the picture thumbnail.
          title: Src
          type: string
        theme:
          anyOf:
            - type: string
            - type: 'null'
          description: The theme of the thumbnail (e.g., light or dark).
          title: Theme
        width:
          anyOf:
            - type: integer
            - type: 'null'
          description: The width of the thumbnail.
          title: Width
      required:
        - src
      title: Thumbnail
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.