Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
brave avatar

Answers

  • 699 installs
  • 164 repo stars
  • Updated August 3, 2026
  • brave/brave-search-skills

answers is a Claude Code skill that calls Brave Search's OpenAI-compatible /chat/completions endpoint to return fast cited answers or multi-iteration deep research for developers evaluating technical topics.

About

answers is a Claude Code skill from brave/brave-search-skills that wraps Brave Search's OpenAI-compatible POST /res/v1/chat/completions endpoint. Single-search mode returns a fast AI-grounded answer with optional streaming citations via enable_citations, while research mode (enable_research=true) runs up to 5 iterative search passes with a default 180-second budget and built-in synthesized citations. The skill works as a drop-in OpenAI SDK client by setting base_url to https://api.search.brave.com/res/v1 and passing X-Subscription-Token. Developers reach for answers when agents need current, cited facts about frameworks, APIs, or comparative technical decisions instead of stale training data. Research mode supports up to 50 queries per request and requires streaming.

  • Two modes: single-search (fast) and deep research (enable_research=true)
  • Returns streaming or blocking AI answers with citations
  • Multi-iteration research with progress events and synthesized output
  • OpenAI /chat/completions compatible endpoint
  • Requires only a Brave Search API key

Answers by the numbers

  • 699 all-time installs (skills.sh)
  • Ranked #1,429 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/brave/brave-search-skills --skill answers

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs699
repo stars164
Last updatedAugust 3, 2026
Repositorybrave/brave-search-skills

How do you get cited AI answers from Brave Search API?

Get fast, cited, AI-grounded answers or run deep multi-step research directly from an OpenAI-compatible endpoint.

Who is it for?

Developers building AI agents who need OpenAI-compatible cited web answers or multi-iteration deep research without building a custom search pipeline.

Skip if: Developers who only need raw search snippets for their own LLM (use llm-context) or teams without a Brave Search API key on the Answers plan.

When should I use this skill?

User needs fast cited factual answers, deep multi-source research synthesis, or an OpenAI SDK drop-in for web-grounded chat completions

What you get

Cited streaming chat completions, synthesized research answers, and usage cost tags from Brave Search API responses

  • cited chat completions
  • deep research synthesis
  • streaming usage cost tags

By the numbers

  • Research mode supports up to 5 iterations and 50 search queries per request
  • Default research time budget is 180 seconds
  • OpenAI-compatible endpoint at POST /res/v1/chat/completions

Files

SKILL.mdMarkdownGitHub ↗

Answers — AI Grounding

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

>

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

When to Use

Use CaseSkillWhy
Quick factual answer (raw context)llm-contextSingle search, returns raw context for YOUR LLM
Fast AI answer with citations`answers` (single-search)streaming, citations
Thorough multi-search deep research`answers` (research mode)Iterative deep research, synthesized cited answer

This endpoint (/res/v1/chat/completions) supports two modes:

  • Single-search (default): Fast AI-grounded answer from a single search. Supports enable_citations.
  • Research (enable_research=true): Multi-iteration deep research with progress events and synthesized cited answer.

Quick Start (cURL)

Blocking (Single-Search)

curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -d '{
    "messages": [{"role": "user", "content": "How does the James Webb Space Telescope work?"}],
    "model": "brave",
    "stream": false
  }'

Streaming with Citations (Single-Search)

curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -d '{
    "messages": [{"role": "user", "content": "What are recent breakthroughs in fusion energy?"}],
    "model": "brave",
    "stream": true,
    "enable_citations": true
  }'

Research Mode

curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
  -d '{
    "messages": [{"role": "user", "content": "Compare quantum computing approaches"}],
    "model": "brave",
    "stream": true,
    "enable_research": true,
    "research_maximum_number_of_iterations": 3,
    "research_maximum_number_of_seconds": 120
  }'

Endpoint

POST https://api.search.brave.com/res/v1/chat/completions

Authentication: X-Subscription-Token: <API_KEY> header (or Authorization: Bearer <API_KEY>)

SDK Compatible: Works with OpenAI SDK via base_url="https://api.search.brave.com/res/v1"

Two Modes

FeatureSingle-Search (default)Research (enable_research=true)
SpeedFastSlow
Searches1Multiple (iterative)
StreamingOptional (stream=true/false)Required (stream=true)
Citationsenable_citations=true (streaming only)Built-in (in <answer> tag)
Progress eventsNoYes (<progress> tags)
Blocking responseYes (stream=false)No

Parameters

Standard Parameters

ParameterTypeRequiredDefaultDescription
messagesarrayYes-Single user message (exactly 1 message)
modelstringYes-Use "brave"
streamboolNotrueEnable SSE streaming
countrystringNo"US"Search country (2-letter country code or ALL)
languagestringNo"en"Response language
safesearchstringNo"moderate"Search safety level (off, moderate, strict)
max_completion_tokensintNonullUpper bound on completion tokens
enable_citationsboolNofalseInclude inline citation tags (single-search streaming only)
web_search_optionsobjectNonullOpenAI-compatible; search_context_size: low, medium, high

Research Parameters

ParameterTypeRequiredDefaultDescription
enable_researchboolNofalseEnable research mode
research_allow_thinkingboolNotrueEnable extended thinking
research_maximum_number_of_tokens_per_queryintNo8192Max tokens per query (1024-16384)
research_maximum_number_of_queriesintNo20Max total search queries (1-50)
research_maximum_number_of_iterationsintNo4Max research iterations (1-5)
research_maximum_number_of_secondsintNo180Time budget in seconds (1-300)
research_maximum_number_of_results_per_queryintNo60Results per search query (1-60)

Constraints (IMPORTANT)

ConstraintError
enable_research=true requires stream=true"Blocking response doesn't support 'enable_research' option"
enable_research=true incompatible with enable_citations=true"Research mode doesn't support 'enable_citations' option"
enable_citations=true requires stream=true"Blocking response doesn't support 'enable_citations' option"

OpenAI SDK Usage

Blocking (Single-Search)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.search.brave.com/res/v1",
    api_key="your-brave-api-key",
)

response = client.chat.completions.create(
    model="brave",
    messages=[{"role": "user", "content": "How does the James Webb Space Telescope work?"}],
    stream=False,
)
print(response.choices[0].message.content)

Streaming with Citations (Single-Search)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.search.brave.com/res/v1",
    api_key="your-brave-api-key",
)

stream = client.chat.completions.create(
    model="brave",
    messages=[{"role": "user", "content": "What are the current trends in renewable energy?"}],
    stream=True,
    extra_body={"enable_citations": True}
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Research Mode

from openai import AsyncOpenAI

client = AsyncOpenAI(
    base_url="https://api.search.brave.com/res/v1",
    api_key="your-brave-api-key",
)

stream = await client.chat.completions.create(
    model="brave",
    messages=[{"role": "user", "content": "Compare quantum computing approaches"}],
    stream=True,
    extra_body={
        "enable_research": True,
        "research_maximum_number_of_iterations": 3,
        "research_maximum_number_of_seconds": 120
    }
)

async for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Response Format

Blocking Response (stream=false, single-search only)

Standard OpenAI-compatible JSON:

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "choices": [{"message": {"role": "assistant", "content": "The James Webb Space Telescope works by..."}, "index": 0, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 10, "completion_tokens": 50, "total_tokens": 60}
}

Streaming Response

SSE response with OpenAI-compatible chunks:

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"delta":{"content":"Based on"},"index":0}]}

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"delta":{"content":" recent research"},"index":0}]}

data: [DONE]

Streaming Tags by Mode

Single-Search (with enable_citations=true)
TagPurpose
<citation>Inline citation references
<usage>JSON cost/billing data
Research Mode
TagPurposeKeep?
<queries>Generated search queriesDebug
<analyzing>URL counts (verbose)Debug
<thinking>URL selection reasoningDebug
<progress>Stats: time, iterations, queries, URLs analyzed, tokensMonitor
<blindspots>Knowledge gaps identifiedYes
<answer>Final synthesized answer (only the final answer is emitted; intermediate drafts are dropped)Yes
<usage>JSON cost/billing data (included at end of streaming response)Yes

Usage Tag Format

The <usage> tag contains JSON-stringified cost and token data:

<usage>{"X-Request-Requests":1,"X-Request-Queries":8,"X-Request-Tokens-In":15000,"X-Request-Tokens-Out":2000,"X-Request-Requests-Cost":0.005,"X-Request-Queries-Cost":0.032,"X-Request-Tokens-In-Cost":0.075,"X-Request-Tokens-Out-Cost":0.01,"X-Request-Total-Cost":0.122}</usage>

Use Cases

  • Chat interface integration: Drop-in OpenAI SDK replacement with web-grounded answers. Set base_url="https://api.search.brave.com/res/v1".
  • Deep research / comprehensive topic research: Use research mode (enable_research=true) for complex questions needing multi-source synthesis (e.g., "Compare approaches to nuclear fusion").
  • OpenAI SDK drop-in: Same SDK, same streaming format — just change base_url and api_key. Works with both sync and async clients.
  • Cited answers: Enable enable_citations=true in single-search mode for inline citation tags, or use research mode which automatically includes citations in its answer.

Notes

  • Timeout: Set client timeout to at least 30s for single-search, 300s (5 min) for research
  • Single message: The messages array must contain exactly 1 user message
  • Cost monitoring: Parse the <usage> tag from streaming responses to track costs

Related skills

How it compares

Use answers for ready-made cited AI responses; use the sibling llm-context skill when you only need raw search context to feed your own LLM.

FAQ

What is the difference between single-search and research mode in answers?

The answers skill's single-search mode returns one fast AI-grounded answer with optional enable_citations on streaming responses. Research mode sets enable_research=true, requires stream=true, and runs multiple iterative searches up to 5 iterations with synthesized built-in citat

Does the answers skill work with the OpenAI SDK?

The answers skill targets Brave Search's OpenAI-compatible endpoint at https://api.search.brave.com/res/v1. Developers pass model "brave", authenticate with X-Subscription-Token, and use the standard chat.completions.create call with optional extra_body research parameters.

AI & Agent Buildingagentsllmresearch

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.