Agent skill

Brave LLM Context API

by brave in brave/brave-search-skills

Documents Brave's LLM Context API, which returns pre-extracted, ranked web page content for grounding agent and RAG answers, with GET and POST calls and Goggles filters.

MITAuto-check passedAI & LLM Engineering

Install Brave LLM Context API

skills CLI
$ npx skills add brave/brave-search-skills --skill llm-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install brave/brave-search-skills llm-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/brave/brave-search-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/llm-context .claude/skills/llm-context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
llm-context
GitHub stars
183
Token cost
~3.3k tokens
SKILL.md length
1,070 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Documents Brave's LLM Context API, which returns pre-extracted, ranked web page content for grounding agent and RAG answers, with GET and POST calls and Goggles filters.

  • Grounding an agent's answers in fresh web content
  • SKILL.md covers LLM Context vs AI Grounding, Endpoint, Quick Start and Parameters, plus 8 more sections
  • Calls curl; reaches api.search.brave.com and business.com; needs BRAVE_SEARCH_API_KEY and API_KEY
  • Building a RAG pipeline that needs page text, tables and code rather than links

What it does

This skill describes the Brave Search endpoint that returns relevance-ranked content pulled from pages, such as text chunks, tables, code blocks and structured data, instead of a list of links and snippets, so your own model can reason over it directly. Each request runs a single search, and access is part of the Brave Search plan.

Requests go to /res/v1/llm/context with GET or POST and an X-Subscription-Token header carrying the API key, for example from a BRAVE_SEARCH_API_KEY variable. Parameters include the query, country, search language and a result count, and the description advises tuning max_tokens and count to the complexity of the question. Inline Goggles and local or point-of-interest search are supported. For finished answers with citations, the skill points to the separate answers endpoint, which is OpenAI-compatible and runs several searches.

When your agent uses it

  • Grounding an agent's answers in fresh web content
  • Building a RAG pipeline that needs page text, tables and code rather than links
  • Fetching web context for a tool call with a size limit set by token budget
  • Choosing between raw extracted content and ready-made answers with citations

Example prompts

  • “Write a curl call to the Brave LLM Context API for the tallest mountains in the world.”
  • “Add a web grounding step to my RAG service using Brave LLM Context and a token limit.”
  • “Show how to restrict LLM Context results with an inline Goggle.”

Requirements

  • A Brave Search API key on the Search plan
  • Network access to api.search.brave.com

What it can do on your machine

Read from SKILL.md and the folder at commit 62793e0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.search.brave.com
    • business.com
    • raw.githubusercontent.com
    • place.com

    Also links to:

    • search.brave.com
    • api-dashboard.search.brave.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • BRAVE_SEARCH_API_KEY
    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Brave LLM Context API loads about 3.3k tokens when it runs. Until then it costs about 71 tokens; SKILL.md has 1,070 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from brave/brave-search-skills at commit 62793e0, republished under its MIT licence (© brave). 1,070 words, ~3,263 tokens.

Download SKILL.mdSave it as .claude/skills/llm-context/SKILL.md (or your agent's skills folder).
name
llm-context
description
USE FOR RAG/LLM grounding. Returns pre-extracted web content (text, tables, code) optimized for LLMs. GET + POST. Adjust max_tokens/count based on complexity. Supports Goggles, local/POI. For AI answers use answers. Recommended for anyone building AI/agentic applications.

LLM Context

Requires API Key: Get one at https://api.search.brave.com

Plan: Included in the Search plan. See https://api-dashboard.search.brave.com/app/subscriptions/subscribe

Brave LLM Context API delivers pre-extracted, relevance-ranked web content optimized for grounding LLM responses in real-time search results. Unlike traditional web search APIs that return links and snippets, LLM Context extracts the actual page content—text chunks, tables, code blocks, and structured data—so your LLM or AI agent can reason over it directly.

LLM Context vs AI Grounding

FeatureLLM Context (this)AI Grounding (answers)
OutputRaw extracted content for YOUR LLMEnd-to-end AI answers with citations
InterfaceREST API (GET/POST)OpenAI-compatible /chat/completions
SearchesSingle search per requestMulti-search (iterative research)
SpeedFast (<1s)Slower
PlanSearchAnswers
Endpoint/res/v1/llm/context/res/v1/chat/completions
Best forAI agents, RAG pipelines, tool callsChat interfaces, research mode

Endpoint

http
GET  https://api.search.brave.com/res/v1/llm/context
POST https://api.search.brave.com/res/v1/llm/context

Authentication: X-Subscription-Token: <API_KEY> header

Optional Headers:

  • Accept-Encoding: gzip — Enable gzip compression

Quick Start

GET Request
bash
curl -s "https://api.search.brave.com/res/v1/llm/context?q=tallest+mountains+in+the+world" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
POST Request (JSON body)
bash
curl -s --compressed -X POST "https://api.search.brave.com/res/v1/llm/context" \
  -H "Accept: application/json" \
  -H "Accept-Encoding: gzip" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"q": "tallest mountains in the world"}'
With Goggles (Inline)
bash
curl -s "https://api.search.brave.com/res/v1/llm/context" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -G \
  --data-urlencode "q=rust programming" \
  --data-urlencode 'goggles=$discard
$site=docs.rs
$site=rust-lang.org'

Parameters

Query Parameters
ParameterTypeRequiredDefaultDescription
qstringYes-Search query (1-400 chars, max 50 words)
countrystringNoUSSearch country (2-letter country code or ALL)
search_langstringNoenLanguage preference (2+ char language code)
countintNo20Max search results to consider (1-50)
spellcheckboolNotrueWhether to spellcheck the query before searching
freshnessstringNo""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. Supported values: pd (24h or less), pw (7 days or less), pm (31 days or less), py (365 days or less), or a custom date range YYYY-MM-DDtoYYYY-MM-DD (e.g. 2022-04-01to2022-07-30).
Context Size Parameters
ParameterTypeRequiredDefaultDescription
maximum_number_of_urlsintNo20Max URLs in response (1-50)
maximum_number_of_tokensintNo8192Approximate max tokens in context (1024-32768)
maximum_number_of_snippetsintNo50Max snippets across all URLs (1-256)
maximum_number_of_tokens_per_urlintNo4096Max tokens per individual URL (512-8192)
maximum_number_of_snippets_per_urlintNo50Max snippets per individual URL (1-100)
Filtering & Local Parameters
ParameterTypeRequiredDefaultDescription
context_threshold_modestringNonullRelevance threshold for including content (strict/balanced/lenient/disabled)
safesearchstringNonullAdult content filter (off/moderate/strict); not set means no filtering, except local recall which stays strict
enable_localboolNonullLocal recall control (true/false/null, see below)
gogglesstring/listNonullGoggle URL or inline definition for custom re-ranking
enable_source_metadataboolNofalseAdds site_name, favicon, thumbnail and description to each sources[url] entry

Context Size Guidelines

Task Typecountmax_tokensExample
Simple factual52048"What year was Python created?"
Standard queries208192"Best practices for React hooks"
Complex research5016384"Compare AI frameworks for production"

Larger context windows provide more information but increase latency and cost (of your inference). Start with defaults and adjust.

Threshold Modes

ModeBehavior
null (not set)Default — resolves to lenient on the current API version
strictHigher threshold — fewer but more relevant results
balancedGood balance between coverage and relevance
lenientLower threshold — more results, may include less relevant content
disabledNo threshold filtering — return all extracted content

Local Recall

The enable_local parameter controls location-aware recall:

ValueBehavior
null (not set)Auto-detect — local recall enabled when any location header is provided
trueForce local — always use local recall, even without location headers
falseForce standard — always use standard web ranking, even with location headers

For most use cases, omit enable_local and let the API auto-detect from location headers.

Location Headers

HeaderTypeDescription
X-Loc-LatfloatLatitude (-90.0 to 90.0)
X-Loc-LongfloatLongitude (-180.0 to 180.0)
X-Loc-CitystringCity name
X-Loc-StatestringState/region code (ISO 3166-2)
X-Loc-State-NamestringState/region name
X-Loc-Countrystring2-letter country code
X-Loc-Postal-CodestringPostal code

Priority: X-Loc-Lat + X-Loc-Long take precedence. When provided, text-based headers (City, State, Country, Postal-Code) are not used for location resolution. Provide text-based headers only when you don't have coordinates.

Example: With Coordinates
bash
curl -s "https://api.search.brave.com/res/v1/llm/context" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -H "X-Loc-Lat: 37.7749" \
  -H "X-Loc-Long: -122.4194" \
  -G \
  --data-urlencode "q=best coffee shops near me"
Example: With Place Name
bash
curl -s "https://api.search.brave.com/res/v1/llm/context" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -H "X-Loc-City: San Francisco" \
  -H "X-Loc-State: CA" \
  -H "X-Loc-Country: US" \
  -G \
  --data-urlencode "q=best coffee shops near me"
Show full SKILL.md (428 more words)Show less

Goggles (Custom Ranking) — Unique to Brave

Goggles let you control which sources ground your LLM — essential for RAG quality.

Use CaseGoggle Rules
Official docs only$discard\n$site=docs.python.org
Exclude user content$discard,site=reddit.com\n$discard,site=stackoverflow.com
Academic sources$discard\n$site=arxiv.org\n$site=scholar.google.com
No paywalls$discard,site=medium.com
MethodExample
Hosted--data-urlencode "goggles=https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/1k_short.goggle"
Inline--data-urlencode 'goggles=$discard\n$site=example.com'

Hosted goggles must be on GitHub/GitLab, include ! name:, ! description:, ! author: headers, and be registered at https://search.brave.com/goggles/create. Inline rules need no registration.

Syntax: Rules start with $ + comma-separated options. Actions (pick one): discard, boost[=N], downrank[=N] — N is an integer 1–10. Site filter: site=DOMAIN. Example: $site=example.com,boost=3. Separate rules with \n (%0A).

Allow list: $discard\n$site=docs.python.org\n$site=developer.mozilla.org — Block list: $discard,site=pinterest.com\n$discard,site=quora.com

Resources: Discover · Syntax · Quickstart

Response Format

Standard Response
json
{
  "grounding": {
    "generic": [
      {
        "url": "https://example.com/page",
        "title": "Page Title",
        "snippets": [
          "Relevant text chunk extracted from the page...",
          "Another relevant passage from the same page..."
        ]
      }
    ],
    "map": []
  },
  "sources": {
    "https://example.com/page": {
      "title": "Page Title",
      "hostname": "example.com",
      "age": ["Wednesday, January 15, 2025", "2025-01-15", "392 days ago", "2025-01-15T13:45:02Z"]
    }
  }
}
Local Response (with enable_local)
json
{
  "grounding": {
    "generic": [...],
    "poi": {
      "name": "Business Name",
      "url": "https://business.com",
      "title": "Title of business.com website",
      "snippets": ["Business details and information..."]
    },
    "map": [
      {
        "name": "Place Name",
        "url": "https://place.com",
        "title": "Title of place.com website",
        "snippets": ["Place information and details..."]
      }
    ]
  },
  "sources": {
    "https://business.com": {
      "title": "Business Name",
      "hostname": "business.com",
      "age": []
    }
  }
}
Response Fields
FieldTypeDescription
groundingobjectContainer for all grounding content by type
grounding.genericarrayArray of URL objects with extracted content (main grounding data)
grounding.generic[].urlstringSource URL
grounding.generic[].titlestringPage title
grounding.generic[].snippetsarrayExtracted smart chunks relevant to the query
grounding.poiobject/nullPoint of interest data (only with local recall)
grounding.poi.namestring/nullPoint of interest name
grounding.poi.urlstring/nullPOI source URL
grounding.poi.titlestring/nullPOI page title
grounding.poi.snippetsarray/nullPOI text snippets
grounding.maparrayMap/place results (only with local recall)
grounding.map[].namestring/nullPlace name
grounding.map[].urlstring/nullPlace source URL
grounding.map[].titlestring/nullPlace page title
grounding.map[].snippetsarray/nullPlace text snippets
sourcesobjectMetadata for all referenced URLs, keyed by URL
sources[url].titlestringPage title
sources[url].hostnamestringSource hostname
sources[url].agearrayThe page's date in four fixed positions: full date, YYYY-MM-DD, relative age, ISO 8601 timestamp. Empty when the page has no known date
sources[url].descriptionstringThe page's own description, independent of the query. Requires enable_source_metadata
sources[url].site_namestringSite name. Requires enable_source_metadata
sources[url].faviconstringFavicon URL. Requires enable_source_metadata
sources[url].thumbnailobject/nullPage thumbnail (src, original). Requires enable_source_metadata
sources[url].snippetstring?Best snippet for the page

Note: Snippets may contain plain text OR JSON-serialized structured data (tables, schemas, code blocks). LLMs handle this mixed format well.

Use Cases

  • AI Agents: Give your agent a web search tool that returns ready-to-use content in a single call
  • RAG Pipelines: Ground LLM responses in fresh, relevant web content
  • AI Assistants & Chatbots: Provide factual answers backed by real sources
  • Question Answering: Retrieve focused context for specific queries
  • Fact Checking: Verify claims against current web content
  • Content Research: Gather source material on any topic with one API call

Best Practices

  • Token budget: Start with defaults (maximum_number_of_tokens=8192, count=20). Reduce for simple lookups, increase for complex research.
  • Source quality: Use Goggles to restrict to trusted sources. Set context_threshold_mode=strict when precision > recall.
  • Performance: Use smallest count and maximum_number_of_tokens that meet your needs. For local queries, provide location headers.

© brave, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/llm-context of brave/brave-search-skills.

Open the folder on GitHubat commit 62793e0

Compare with similar skills

Brave LLM Context API next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Brave LLM Context API compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Brave LLM Context API this skillbrave/brave-search-skills183—~3.3kAutomated safety check: PassMIT
Tavily Search API Integrationandrewyng/context-hub14k—~1.1kAutomated safety check: PassMIT
9Router Web Searchdecolua/9router30k—~1kAutomated safety check: PassMIT
Sap AI Coresecondsky/sap-skills462—~3.3kAutomated safety check: PassGPL-3.0
Digoal Read Think Writerdigoal/blog8.6k—~1.3kAutomated safety check: PassGPL-2.0
Discover APIbrightdata/skills264—~2.4kAutomated safety check: PassMIT

Similar skills

  • Tavily Search API Integration

    andrewyng/context-hub

    Guides building Tavily integrations for web search, URL extraction, site crawling and AI-assisted research in Python or JavaScript agent and RAG projects.

    14k GitHub stars~1.1k tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check passed
  • 9Router Web Search

    decolua/9router

    Runs web, news and public X searches through a 9Router gateway's search endpoint, choosing among providers such as Tavily, Exa, Brave and Perplexity.

    30k GitHub stars~1k tokensUpdated 7 days ago
    Productivity & AutomationAuto-check passed
  • Sap AI Core

    secondsky/sap-skills

    Guides development with SAP AI Core and SAP AI Launchpad for enterprise AI/ML workloads on SAP BTP.

    462 GitHub stars~3.3k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • 以 digoal/德哥 的第一人称口吻重写一篇文章。流程是:先吃透原文(必要时用 mcpMiniMaxwebsearch 拓展资料库),再用德哥的语气重新讲一遍,输出 markdown 到当前项目的 markdown/ 目录(SVG 图存到 markdown/svg/,文中以 ![描述](svg/xxx.svg)…

    8.6k GitHub stars~1.3k tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check passed
  • Discover API

    brightdata/skills

    Use Bright Data's Discover API — intent-ranked, AI-relevance-scored web search at scale (not keyword SERP).

    264 GitHub stars~2.4k tokensUpdated yesterday
    Productivity & AutomationAuto-check passed
  • AI RAG Pipeline

    NeverSight/learn-skills.dev

    Build RAG (Retrieval Augmented Generation) pipelines with web search and LLMs.

    216 GitHub starsUsed in 1 repo~2k tokens
    AI & LLM EngineeringAuto-check passed

More from brave/brave-search-skills

All 11 skills in this repo
  • Brave Answers API

    brave/brave-search-skills

    Calls the Brave Search Answers endpoint for AI-grounded, cited answers, either a fast single-search reply or a slower multi-search deep research run.

    183 GitHub stars~2.3k tokensUpdated 15 days ago
    Auto-check passed
  • Brave Image Search

    brave/brave-search-skills

    Searches images through the Brave Search API and returns titles, source pages, thumbnails and original image URLs, with a SafeSearch filter and up to 200 results.

    183 GitHub stars~1.4k tokensUpdated 15 days ago
    Auto-check passed
  • Brave Local Place Descriptions

    brave/brave-search-skills

    Fetches AI-written text descriptions for local places from the Brave Search API, using place IDs returned by an earlier local search.

    183 GitHub stars~1k tokensUpdated 15 days ago
    Auto-check passed
  • Brave Local Place Search

    brave/brave-search-skills

    Looks up businesses, points of interest, addresses and streets through the Brave Search place endpoint, returning contact details, ratings and hours in one call.

    183 GitHub stars~3.4k tokensUpdated 15 days ago
    Auto-check passed
  • Brave Local POI Details

    brave/brave-search-skills

    Looks up full details for local businesses and places, including ratings, hours and contact information, from Brave Search API point-of-interest IDs.

    183 GitHub stars~1.9k tokensUpdated 15 days ago
    Auto-check passed
  • News Search

    brave/brave-search-skills

    A skill your agent uses FOR news search. An agent skill from brave/brave-search-skills.

    183 GitHub stars~2k tokensUpdated 15 days ago
    Auto-check passed

Questions about Brave LLM Context API

What does Brave LLM Context API do?

Documents Brave's LLM Context API, which returns pre-extracted, ranked web page content for grounding agent and RAG answers, with GET and POST calls and Goggles filters. This skill describes the Brave Search endpoint that returns relevance-ranked content pulled from pages, such as text chunks, tables, code blocks and structured data, instead of a list of links and snippets, so your own model can reason over it directly. Each request runs a single search, and access is part of the Brave Search plan.

When should I use Brave LLM Context API?

Brave LLM Context API fits situations like: grounding an agent's answers in fresh web content; building a RAG pipeline that needs page text, tables and code rather than links; fetching web context for a tool call with a size limit set by token budget; choosing between raw extracted content and ready-made answers with citations.

How do I install Brave LLM Context API in Claude Code?

Run `npx skills add brave/brave-search-skills --skill llm-context -a claude-code`. Or copy the skill folder (skills/llm-context in brave/brave-search-skills) into .claude/skills/llm-context in your project. Claude Code loads it when a task matches its description.

How do I install Brave LLM Context API in Codex?

Run `npx skills add brave/brave-search-skills --skill llm-context -a codex`. Or copy the skill folder (skills/llm-context in brave/brave-search-skills) into .agents/skills/llm-context in your project. Codex loads it when a task matches its description.

Can I use Brave LLM Context API in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add brave/brave-search-skills --skill llm-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/llm-context, .gemini/skills/llm-context, .github/skills/llm-context and .opencode/skills/llm-context in your project.

What does Brave LLM Context API need to run?

Going by SKILL.md and its folder, Brave LLM Context API needs the command-line tools its instructions call (curl) and credentials named BRAVE_SEARCH_API_KEY and API_KEY. Our summary lists: A Brave Search API key on the Search plan; Network access to api.search.brave.com.

Does Brave LLM Context API access the network?

SKILL.md names 7 domains. In commands or code: api.search.brave.com, business.com, raw.githubusercontent.com and place.com; the agent is likely to contact these when it follows the instructions. As links in the text: search.brave.com, api-dashboard.search.brave.com and github.com. This is read from the text; nothing was executed.

Is Brave LLM Context API safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Brave LLM Context API use?

Brave LLM Context API is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Brave LLM Context API use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Brave LLM Context API?

Skills that share tags, products or a category with Brave LLM Context API: Tavily Search API Integration (andrewyng/context-hub, 14k stars), 9Router Web Search (decolua/9router, 30k stars), Sap AI Core (secondsky/sap-skills, 462 stars) and Digoal Read Think Writer (digoal/blog, 8.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Brave LLM Context API?

brave (a GitHub organization) maintains it in brave/brave-search-skills, which has 183 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 23, 2026.

Source: brave/brave-search-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.