# Brave LLM Context API

> LLM Context from Brave. Returns the official Brave API response unchanged.

Source: https://www.sandbase.ai/model/brave/llm-context
API reference: https://www.sandbase.ai/model/brave/llm-context/docs

## Facts

- Provider: Brave
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/brave/llm-context`
- Price: $0.0075 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: api, brave, web search
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/brave/llm-context` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `q` | string | yes |  |
| `context_threshold_mode` | string | no | disabled, strict, lenient, balanced |
| `count` | integer | no |  |
| `country` | string | no | AR, AU, AT, BE, BR, CA, CL, DK, FI, FR, DE, GR, HK, IN, ID, IT, JP, KR, MY, MX, NL, NZ, NO, CN, PL, PT, PH, RU, SA, ZA, ES, SE, CH, TW, TR, GB, US, ALL |
| `enable_local` | boolean | no |  |
| `enable_source_metadata` | boolean | no |  |
| `freshness` | string | no |  |
| `goggles` | string | no |  |
| `maximum_number_of_snippets` | integer | no |  |
| `maximum_number_of_snippets_per_url` | integer | no |  |
| `maximum_number_of_tokens` | integer | no |  |
| `maximum_number_of_tokens_per_url` | integer | no |  |
| `maximum_number_of_urls` | integer | no |  |
| `safesearch` | string | no | off, moderate, strict |
| `search_lang` | string | no | ar, eu, bn, bg, ca, zh-hans, zh-hant, hr, cs, da, nl, en, en-gb, et, fi, fr, gl, de, el, gu, he, hi, hu, is, it, ja, jp, kn, ko, lv, lt, ms, ml, mr, nb, pl, pt-br, pt-pt, pa, ro, ru, sr, sk, sl, es, sv, ta, te, th, tr, uk, vi |
| `spellcheck` | boolean | no |  |

## FAQ

### How do I use the Brave LLM Context API?

Send a POST request to https://api.sandbase.ai/v1/api/brave/llm-context with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Brave LLM Context API cost?

$0.0075 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the Brave LLM Context API accept?

Required: q (string). Optional: context_threshold_mode (one of disabled, strict, lenient, balanced), count (integer), country (one of AR, AU, AT, BE, BR, CA, CL, DK, FI, FR, DE, GR, HK, IN, ID, IT, JP, KR, MY, MX, NL, NZ, NO, CN, PL, PT, PH, RU, SA, ZA, ES, SE, CH, TW, TR, GB, US, ALL), enable_local (boolean), enable_source_metadata (boolean) and freshness (string) and 9 more. The Parameters table and the Playground on this page list every field.

### What does the Brave LLM Context API return?

A JSON response returned in the same HTTP request (synchronous).

### Do I need a Brave developer account or API key?

No. Brave LLM Context runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Brave API access separately.

## README

### Brave LLM Context API

LLM Context from Brave. Returns the official Brave API response unchanged.

The response is the official Brave API response, unchanged.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "brave/llm-context", "q": "<q>"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `context_threshold_mode` | string | No | The mode to use to determine the threshold for including content in context. |
| `count` | integer | No | The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50. |
| `country` | string | No | The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries. |
| `enable_local` | boolean | No | Whether to enable local recall. Not setting this value means auto-detect: local recall is used if a location is provided ( X-Loc-Lat with X-Loc-Long , or X-Loc- |
| `enable_source_metadata` | boolean | No | Enable source metadata enrichment (site_name, favicon, thumbnail, description, fetched_content_timestamp) in the sources attribute of the response. |
| `freshness` | string | No | 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 da |
| `goggles` | string | No | Goggles act as a custom re-ranking on top of Brave’s search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. |
| `maximum_number_of_snippets` | integer | No | Maximum number of different snippets (or chunks of text) to include in LLM context. The default is 50 and maximum is 256 . |
| `maximum_number_of_snippets_per_url` | integer | No | Maximum number of snippets to include per URL. The default is 50 and maximum is 100 . |
| `maximum_number_of_tokens` | integer | No | Approximate maximum number of tokens to include in context. The default is 8192 and maximum is 32768 . |
| `maximum_number_of_tokens_per_url` | integer | No | Maximum number of tokens to include per URL. The default is 4096 and maximum is 8192 . |
| `maximum_number_of_urls` | integer | No | Maximum number of different URLs to include in LLM context. |
| `q` | string | Yes | The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query. |
| `safesearch` | string | No | Filters results for adult content. The following values are supported: off - No filtering is done. moderate - Drops adult content from the results used for cont |
| `search_lang` | string | No | The search language preference. The 2 or more character language code for which the search results are provided. |
| `spellcheck` | boolean | No | Whether to enable spellcheck on the query. |

#### Pricing

Flat price per call. Failed calls are not charged.
