# Brave Search LLM Context

> Brave Search LLM Context is a paid API for AI agents from search.agent.s.brave.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-12).

Returns LLM-ready grounded context by extracting and ranking the most relevant passages from top web search results, grouped by source URL.

## Facts

- Endpoint: GET https://search.agent.s.brave.app/res/v1/llm/context?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brave-search-llm-context-1e975743
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HiYZOtEk0AJlw9zLArfyf

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brave-search-llm-context-1e975743
```

Example prompt: Search Brave for 'best practices for reducing LLM hallucinations in 2024' and give me the most relevant passages from up to 10 sources, keeping the total context under 4096 tokens.

## When to prefer this

Choose this endpoint when you need web search results already chunked and ranked into LLM-ready passages — it saves the round trip of fetching raw pages and parsing them yourself. Prefer it over raw web search endpoints when your goal is to inject grounded context directly into an LLM prompt with a controllable token budget. It is ideal when freshness of web content matters and you want multi-source grounding without managing HTML parsing or snippet extraction yourself.

## Known failure modes

- Missing required 'q' parameter returns a 400 error
- Query exceeding 600 characters is rejected
- maximum_number_of_tokens below 1024 or above 32768 is rejected
- No relevant passages found for obscure or very niche queries returns empty grounding array
- Payment failure or missing x402 payment header results in 402 Payment Required
- Rate limiting may occur under high request volume
- Invalid country or language codes may yield no results or default behavior

## How this service works

Web search that returns page text ready for an LLM prompt. Picks the passages most relevant to q from the top results and groups them by source URL. Use it to ground an answer in current web content without fetching pages. Size the context with maximum_number_of_tokens and maximum_number_of_urls.

## Output

A structured object containing a 'grounding' field with an array of source entries, each including the page URL, title, and an array of relevant text snippets extracted from that page. A 'sources' map provides hostname and title metadata per URL. Results are pre-ranked by relevance to the query and sized to fit within the requested token and URL limits.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "maxLength": 600,
       "description": "Search query"
      },
      "count": {
       "type": "integer",
       "default": 20,
       "maximum": 50,
       "minimum": 1
      },
      "country": {
       "type": "string",
       "description": "Country code such as US, or ALL"
      },
      "freshness": {
       "type": "string",
       "description": "pd, pw, pm, py, or a range like 2026-01-01to2026-06-30"
      },
      "search_lang": {
       "type": "string",
       "description": "Language code such as en"
      },
      "maximum_number_of_urls": {
       "type": "integer",
       "default": 20,
       "maximum": 50,
       "minimum": 1
      },
      "maximum_number_of_tokens": {
       "type": "integer",
       "default": 8192,
       "maximum": 32768,
       "minimum": 1024
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "sources": {
       "type": "object",
       "properties": {
        "https://brave.com/": {
         "type": "object",
         "properties": {
          "title": {
           "type": "string"
          },
          "hostname": {
           "type": "string"
          }
         }
        }
       }
      },
      "grounding": {
       "type": "object",
       "properties": {
        "generic": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "url": {
            "type": "string"
           },
           "title": {
            "type": "string"
           },
           "snippets": {
            "type": "array",
            "items": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brave-search-llm-context-1e975743/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from search.agent.s.brave.app](https://www.zero.xyz/host/search.agent.s.brave.app/llms.txt)
