{"uid":"cap_HiYZOtEk0AJlw9zLArfyf","slug":"brave-search-llm-context-1e975743","name":"Brave Search LLM Context","description":"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.","url":"https://search.agent.s.brave.app/res/v1/llm/context?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}}}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ZGtjiuwd6qaZFfG27lM21","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns LLM-ready grounded context by extracting and ranking the most relevant passages from top web search results, grouped by source URL.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Real-time fact grounding for chatbot","prompt":"Search Brave for 'current mortgage interest rates US June 2025' and pull back grounding passages from up to 15 URLs, keeping the response under 6000 tokens, so I can cite accurate figures in my answer."},{"title":"Breaking news research for AI summary","prompt":"Look up 'OpenAI GPT-5 release announcement' on Brave and get me the most relevant snippets from recent pages — limit to 20 sources and 8192 tokens — so I can summarize what's actually been announced."},{"title":"Competitive intelligence for product team","prompt":"Search Brave for 'Notion AI vs Obsidian AI features comparison 2025' restricted to English results from the US, and return grounding passages from the top 10 URLs under 5000 tokens so I can brief the product team."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:31:27.450Z","isFirstParty":false,"canonicalSlug":"brave-search-llm-context-1e975743"}