$npx -y skills add brave/brave-search-skills --skill answersUSE FOR AI-grounded answers via OpenAI-compatible /chat/completions. Two modes: single-search (fast) or deep research (enable_research=true, thorough multi-search). Streaming/blocking. Citations.
| 1 | # Answers — AI Grounding |
| 2 | |
| 3 | > **Requires API Key**: Get one at https://api.search.brave.com |
| 4 | > |
| 5 | > **Plan**: Included in the **Answers** plan. See https://api-dashboard.search.brave.com/app/subscriptions/subscribe |
| 6 | |
| 7 | ## When to Use |
| 8 | |
| 9 | | Use Case | Skill | Why | |
| 10 | |--|--|--| |
| 11 | | Quick factual answer (raw context) | `llm-context` | Single search, returns raw context for YOUR LLM | |
| 12 | | Fast AI answer with citations | **`answers`** (single-search) | streaming, citations | |
| 13 | | Thorough multi-search deep research | **`answers`** (research mode) | Iterative deep research, synthesized cited answer | |
| 14 | |
| 15 | **This endpoint** (`/res/v1/chat/completions`) supports two modes: |
| 16 | - **Single-search** (default): Fast AI-grounded answer from a single search. Supports `enable_citations`. |
| 17 | - **Research** (`enable_research=true`): Multi-iteration deep research with progress events and synthesized cited answer. |
| 18 | |
| 19 | ## Quick Start (cURL) |
| 20 | |
| 21 | ### Blocking (Single-Search) |
| 22 | ```bash |
| 23 | curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \ |
| 24 | -H "Content-Type: application/json" \ |
| 25 | -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ |
| 26 | -d '{ |
| 27 | "messages": [{"role": "user", "content": "How does the James Webb Space Telescope work?"}], |
| 28 | "model": "brave", |
| 29 | "stream": false |
| 30 | }' |
| 31 | ``` |
| 32 | |
| 33 | ### Streaming with Citations (Single-Search) |
| 34 | ```bash |
| 35 | curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \ |
| 36 | -H "Content-Type: application/json" \ |
| 37 | -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ |
| 38 | -d '{ |
| 39 | "messages": [{"role": "user", "content": "What are recent breakthroughs in fusion energy?"}], |
| 40 | "model": "brave", |
| 41 | "stream": true, |
| 42 | "enable_citations": true |
| 43 | }' |
| 44 | ``` |
| 45 | |
| 46 | ### Research Mode |
| 47 | ```bash |
| 48 | curl -X POST "https://api.search.brave.com/res/v1/chat/completions" \ |
| 49 | -H "Content-Type: application/json" \ |
| 50 | -H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \ |
| 51 | -d '{ |
| 52 | "messages": [{"role": "user", "content": "Compare quantum computing approaches"}], |
| 53 | "model": "brave", |
| 54 | "stream": true, |
| 55 | "enable_research": true, |
| 56 | "research_maximum_number_of_iterations": 3, |
| 57 | "research_maximum_number_of_seconds": 120 |
| 58 | }' |
| 59 | ``` |
| 60 | |
| 61 | ## Endpoint |
| 62 | |
| 63 | ```http |
| 64 | POST https://api.search.brave.com/res/v1/chat/completions |
| 65 | ``` |
| 66 | |
| 67 | **Authentication**: `X-Subscription-Token: <API_KEY>` header (or `Authorization: Bearer <API_KEY>`) |
| 68 | |
| 69 | **SDK Compatible**: Works with OpenAI SDK via `base_url="https://api.search.brave.com/res/v1"` |
| 70 | |
| 71 | ## Two Modes |
| 72 | |
| 73 | | Feature | Single-Search (default) | Research (`enable_research=true`) | |
| 74 | |--|--|--| |
| 75 | | Speed | Fast | Slow | |
| 76 | | Searches | 1 | Multiple (iterative) | |
| 77 | | Streaming | Optional (`stream=true/false`) | **Required** (`stream=true`) | |
| 78 | | Citations | `enable_citations=true` (streaming only) | Built-in (in `<answer>` tag) | |
| 79 | | Progress events | No | Yes (`<progress>` tags) | |
| 80 | | Blocking response | Yes (`stream=false`) | No | |
| 81 | |
| 82 | ## Parameters |
| 83 | |
| 84 | ### Standard Parameters |
| 85 | |
| 86 | | Parameter | Type | Required | Default | Description | |
| 87 | |--|--|--|--|--| |
| 88 | | `messages` | array | **Yes** | - | Single user message (exactly 1 message) | |
| 89 | | `model` | string | **Yes** | - | Use `"brave"` | |
| 90 | | `stream` | bool | No | true | Enable SSE streaming | |
| 91 | | `country` | string | No | "US" | Search country (2-letter country code or `ALL`) | |
| 92 | | `language` | string | No | "en" | Response language | |
| 93 | | `safesearch` | string | No | "moderate" | Search safety level (`off`, `moderate`, `strict`) | |
| 94 | | `max_completion_tokens` | int | No | null | Upper bound on completion tokens | |
| 95 | | `enable_citations` | bool | No | false | Include inline citation tags (single-search streaming only) | |
| 96 | | `web_search_options` | object | No | null | OpenAI-compatible; `search_context_size`: `low`, `medium`, `high` | |
| 97 | |
| 98 | ### Research Parameters |
| 99 | |
| 100 | | Parameter | Type | Required | Default | Description | |
| 101 | |--|--|--|--|--| |
| 102 | | `enable_research` | bool | No | `false` | **Enable research mode** | |
| 103 | | `research_allow_thinking` | bool | No | `true` | Enable extended thinking | |
| 104 | | `research_maximum_number_of_tokens_per_query` | int | No | `8192` | Max tokens per query (1024-16384) | |
| 105 | | `research_maximum_number_of_queries` | int | No | `20` | Max total search queries (1-50) | |
| 106 | | `research_maximum_number_of_iterations` | int | No | `4` | Max research iterations (1-5) | |
| 107 | | `research_maximum_number_of_seconds` | int | No | `180` | Time budget in seconds (1-300) | |
| 108 | | `research_maximum_number_of_results_per_query` | int | No | `60` | Results per search query (1-60) | |
| 109 | |
| 110 | ### Constraints (IMPORTANT) |
| 111 | |
| 112 | | Constraint | Error | |
| 113 | |--|--| |
| 114 | | `enable_research=true` requires `stream=true` | "Blocking response doesn't support 'enable_research' option" | |
| 115 | | `enable_research=true` incompatible with `enable_citations=true` | "Research mode doesn't support 'enable_citations' option" | |
| 116 | | `enable_citations=true` requires `stream=true` | "Bl |