Skip to main content

Brave

NanoGPT supports Brave in two different integration modes:
  1. Web Search provider: provider: "brave" on /api/web or webSearch.provider = "brave" / :online/brave in chat completions. This returns raw search results that are injected into another model.
  2. Brave Answers models: model: "brave", model: "brave-pro", or model: "brave-research". This runs Brave’s own search + answer pipeline.
Brave also offers an LLM Context API (relevance-ranked chunks for downstream LLM workflows). NanoGPT does not currently expose that API surface.

Brave model IDs

Model IDDescription
braveBrave (Answers). Single web search + LLM answer. Fast (~4.5s), low cost.
brave-proBrave (Pro). Premium tier with higher quality answers, more search depth, and priority processing.
brave-researchBrave (Research). Multi-search deep research with reasoning. Slower (can take minutes), higher cost.

Brave model request fields (/api/v1/chat/completions)

When using model: "brave", model: "brave-pro", or model: "brave-research", pass these optional top-level fields in the request body.

Core parameters

ParameterTypeDefault (brave/brave-pro)Default (brave-research)Description
enable_researchbooleanfalsetrueEnables multi-search deep research mode with reasoning. Requires streaming.
enable_citationsbooleanfalsefalseIncludes <citation> markup in response text linking to sources. Requires streaming.
enable_entitiesbooleanfalsefalseIncludes entity metadata in the response. Requires streaming.
countrystring--Country code for search localization (for example "US").
languagestring--Language code for response language (for example "en").
max_completion_tokensinteger--Maximum completion tokens.
seedinteger--Optional deterministic seed where supported.
streambooleanfalseauto-streamingStreams SSE responses. brave-research uses streaming when omitted.
safesearchstringmoderatemoderateSafe search level: off, moderate, or strict.
metadataobject--Optional metadata to attach to the request.

Research tuning parameters

These control enable_research mode (brave-research by default, or any Brave model when enable_research: true).
ParameterTypeRangeDescription
research_allow_thinkingboolean-Allow visible reasoning output. Default: true.
research_maximum_number_of_iterationsinteger1-5Maximum research iterations.
research_maximum_number_of_queriesinteger1-50Maximum search queries.
research_maximum_number_of_results_per_queryinteger1-60Maximum results analyzed per query.
research_maximum_number_of_secondsinteger1-300Maximum research duration.
research_maximum_number_of_tokens_per_queryinteger1024-16384Maximum tokens processed per query.

web_search_options (Brave models)

For Brave models, pass a top-level web_search_options object in the same chat completions request.
ParameterTypeDescription
web_search_optionsobjectNested object to configure search behavior.
web_search_options.search_context_sizestringSearch context size: "low", "medium", or "high" (Brave default when omitted: "low").
web_search_options.user_locationobjectUser location for localized results.
web_search_options.user_location.typeenumMust be "approximate".
web_search_options.user_location.approximateobjectcity, country, region, timezone (nullable strings).

Brave model examples

{
  "model": "brave",
  "messages": [{ "role": "user", "content": "What's new in battery tech?" }],
  "stream": true,
  "web_search_options": {
    "search_context_size": "high"
  }
}
{
  "model": "brave-research",
  "messages": [{ "role": "user", "content": "What are the latest developments in fusion energy?" }],
  "stream": true,
  "research_maximum_number_of_iterations": 3,
  "research_maximum_number_of_queries": 20
}
enable_research, enable_citations, and enable_entities require stream: true. For consistency, set stream: true explicitly on Brave model requests.

Brave provider fields (/api/web and webSearch.provider = "brave")

{
  "count": 0-20,
  "maxResults": 0-20,
  "offset": 0-9,
  "safesearch": "off" | "moderate" | "strict",
  "freshness": "2024-01-01to2024-02-01",
  "searchLang": "string",
  "uiLang": "string",
  "eSnippets": boolean,
  "spellcheck": boolean,
  "goggles": "string" | ["string"],
  "country": "string"
}
Use either count or maxResults (0-20). searchLang and uiLang are mapped to Brave’s search_lang and ui_lang. If freshness is omitted and both fromDate and toDate are set, NanoGPT builds freshness as fromDate + "to" + toDate. For deep searches, Brave defaults extraSnippets to true unless eSnippets is set explicitly.

Brave provider example (/api/web)

POST /api/web
{
  "query": "latest EU AI Act amendments",
  "provider": "brave",
  "depth": "standard",
  "outputType": "searchResults",
  "count": 10,
  "offset": 0,
  "safesearch": "moderate",
  "searchLang": "en",
  "uiLang": "en",
  "freshness": "2024-01-01to2024-02-01"
}

Pricing

Brave as Web Search provider

  • Standard: $0.005 per request
  • Deep: $0.005 per request

Brave Answers models

Brave model costs are usage-based (searches + tokens):
cost = (searches * $4 / 1,000) + (tokens * $5 / 1,000,000)
  • brave: typically about $0.007-$0.01 per request (one search)
  • brave-pro: similar baseline profile to brave, with premium-tier behavior
  • brave-research: higher cost due to multiple searches per request

BYOK and credentials

For standard NanoGPT usage, Brave credentials are handled automatically. BYOK availability is provider-dependent and can change over time. See Bring Your Own Key (BYOK).

Brave terms highlights (updated February 11, 2026)

  • No caching beyond transient storage.
  • No AI training on Brave search results.
  • No redistribution or reselling of Brave results.
  • Termination: Brave may terminate with 10 days’ notice; customer may terminate with 30 days’ notice.
  • Liability cap: limited to fees paid in the prior 12 months.