Brave Search LLM Context

6 credits/call
ae_bravesearch_llm_context

根据问题检索网页并返回相关正文片段及来源元信息,而不是生成最终答案。必填 q 用于提供问题或关键词;可选参数可调整参与筛选的结果数、纳入的网页数,以及每页和总 token 预算。结果包含 grounding.generic 中的网页 URL、标题和 snippets;sources 提供来源元信息(如请求启用且有返回)。总 token 限制为近似上限。

Search
6 credits/call

Pricing

6 credits/call
ConditionCharge
Each call6 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
qstringYes要检索的问题或关键词,非空,最多600字符和75个词。—
countintegerNo参与筛选上下文的搜索结果数。20
countrystringNo搜索市场的两字母国家代码,例如US。—
gogglesstringNo自定义重排规则,填写托管规则URL或内联Goggle文本。—
freshnessstringNo网页时间范围:pd、pw、pm、py或YYYY-MM-DDtoYYYY-MM-DD。—
operatorsbooleanNo是否应用搜索运算符。true
safesearchenum (off | moderate | strict)No成人内容过滤级别。—
spellcheckbooleanNo是否对查询做拼写纠正。true
search_langstringNo搜索语言代码,例如en、zh-hans或zh-hant;不是zh-CN。—
enable_localbooleanNo是否包含地点相关上下文。—
operators_fallbackbooleanNo是否允许搜索运算符匹配回退。true
context_threshold_modeenum (disabled | strict | lenient | balanced)No内容相关性阈值模式。—
enable_source_metadatabooleanNo是否包含站点名称、图标、缩略图和抓取时间等来源元信息。false
maximum_number_of_urlsintegerNo上下文最多纳入的不同网页数量。—
maximum_number_of_tokensintegerNo上下文总token数的近似上限,并非严格截断。8192
maximum_number_of_tokens_per_urlintegerNo每个网页纳入的token数上限。4096

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_bravesearch_llm_context' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "enable_source_metadata": true,
    "maximum_number_of_tokens": 1024,
    "maximum_number_of_urls": 3,
    "q": "Python asyncio TaskGroup exception handling"
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "grounding": {
    "generic": [
      {
        "snippets": [
          "# asyncio.gather Raised an Exception but the Other Tasks Kept Running: TaskGroup vs return\\_exceptions\nIf one coroutine in asyncio.gather() raises, the exception propagates to your await, but the sibling tasks are **not cancelled**. They keep running in th"
        ],
        "title": "asyncio.gather Raised an Exception but the Other Tasks Kept Running: TaskGroup vs return_exceptions - DEV Community",
        "url": "https://dev.to/libme/asynciogather-raised-an-exception-but-the-other-tasks-kept-running-taskgroup-vs-returnexceptions-4kg1"
      }
    ],
    "map": []
  },
  "sources": {
    "https://codemia.io/knowledge-hub/path/asynciogather_vs_asynciowait_vs_asynciotaskgroup": {
      "age": [
        "Tuesday, September 23, 2025"
      ],
      "description": "Python's asyncio module provides three primary tools for running multiple coroutines concurrently: asyncio.gather, asyncio.wait, and asyncio.TaskGroup. Each...",
      "favicon": "https://imgs.search.brave.com/pqkOCZGITTHgqk-p6nQyVxvKKtYA9KMqjCa_JW-lK_0/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvMzQ0ZTE1YWVj/YWI5YTNlZjRmODBm/NWMxNGVlY2VlMjNh/NzcxYmM1NjgxMWRk/YTliNWU3ZGYzYTcz/NWVhNWNlZC9jb2Rl/bWlhLml",
      "fetched_content_timestamp": 1794249418,
      "hostname": "codemia.io",
      "title": "asyncio.gather vs asyncio.wait vs asyncio.TaskGroup"
    },
    "https://dev.to/libme/asynciogather-raised-an-exception-but-the-other-tasks-kept-running-taskgroup-vs-returnexceptions-4kg1": {
      "age": [
        "Saturday, November 14, 2026"
      ],
      "description": "asyncio.gather leaves sibling tasks running after one fails. Here is how TaskGroup, return_exceptions and create_task differ, with runnable code. Tagged with python, programming, tutorial, backend.",
      "favicon": "https://imgs.search.brave.com/UUpF8I85K--vkQzrhameM7iRPRU5VCTXyWbS4sk6G2g/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvNTg5MTcxNDBh/N2U4ODc4MDg0NWQ4/MzU0YWJkNDY3ZWRm/MjUxY2U1YjY5MzJm/YWRlOTI4YjAyZDI1/ZjU0MmJjNi9kZXYu/dG8v",
      "fetched_content_timestamp": 1794697425,
      "hostname": "dev.to",
      "title": "asyncio.gather Raised an Exception but the Other Tasks Kept Running: TaskGroup vs return_exceptions - DEV Community"
    },
    "https://runebook.dev/en/docs/python/library/asyncio-task/asyncio.Task": {
      "age": [],
      "description": "Here's a friendly breakdown of common issues, their fixes, and some alternative approaches with sample code.This is perhaps the most frequent pitfall",
      "favicon": "https://imgs.search.brave.com/Z_N2GGmoYepmBi95IVB6-5t63qpwEuD7K8cQfA4Lr84/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvMmJmZDQwYmIw/Zjg0MGYzNzY3NWY0/YjMxMDI2NzQ3MGU5/OGU3ZTdkMDJjNjJi/NDlmMWU5OTA2MjQ4/N2NiODU0Mi9ydW5l/Ym9vay5",
      "fetched_content_timestamp": 1778803589,
      "hostname": "runebook.dev",
      "title": "python - Mastering asyncio.Task: Fixes for Early Exits and Unhandled Exceptions"
    }
  }
}

This example shows part of the response. Copied content is valid JSON.