Overview
Brave AI Grounding API provides state-of-the-art AI-generated answers backed by verifiable sources from the web. This technology improves the accuracy, relevance, and trustworthiness of AI responses by grounding them in real-time search results. Under the hood, this same service powers Brave’s Answer with AI feature, which serves tens of millions of answers every day. Brave’s grounded answers demonstrate strong performance across a wide range of queries, from simple trivia questions to complex research inquiries. Notably, Brave achieves state-of-the-art (SOTA) performance on the SimpleQA benchmark without being specifically optimized for it—the performance emerges naturally from the system’s design.Access to AI Grounding is available through the AI Grounding plan.
Subscribe to AI
Grounding
to unlock these capabilities.
Key Features
Web-Grounded Answers
AI responses backed by real-time web search with verifiable citations
OpenAI SDK Compatible
Use the familiar OpenAI SDK for seamless integration
SOTA Performance
State-of-the-art results on SimpleQA benchmark
Streaming Support
Stream answers in real-time with progressive citations
Research Mode
Enable multi-search for thorough, research-grade answers
Rich Response Data
Get entities, citations, and structured data with answers
API Reference
AI Grounding API Documentation
View the complete API reference, including parameters and response schemas
Use Cases
AI Grounding is perfect for:- AI Assistants & Chatbots: Build intelligent conversational interfaces with factual, cited responses
- Research Applications: Conduct thorough research with multi-search capabilities
- Question Answering Systems: Provide accurate answers with source attribution
- Knowledge Applications: Create tools that need up-to-date, verifiable information
- Content Generation: Generate well-researched content with citations
Endpoint
AI Grounding uses a single, OpenAI-compatible endpoint:Quick Start
Basic Example with OpenAI SDK
Streaming Example
For real-time responses, enable streaming withAsyncOpenAI:
Using curl
While the OpenAI SDK is recommended, you can also use curl:Single vs Multiple Searches
The decision between single-search and multi-search significantly influences both cost efficiency and response time.Single Search (Default)
- Speed: Answers typically stream in under 4.5 seconds on average
- Cost: Lower cost with minimal computational overhead
- Use Case: Ideal for real-time applications and most queries
- Performance: Median SimpleQA benchmark question answered with single search
Multiple Searches (Research Mode)
- Thoroughness: Model iteratively refines strategy with sequential searches
- Cost: Higher due to multiple API calls and larger context processing
- Time: Response times can extend to minutes
- Use Case: Best for background tasks prioritizing thoroughness over speed
enable_research: true:
Performance note: On the SimpleQA benchmark, p99 questions required 53
queries analyzing 1000 pages over ~300 seconds. However, reasonable limits are
in place based on real-world use cases.
Advanced Parameters
When using the OpenAI SDK, pass additional parameters viaextra_body:
Available Parameters
- country (string): Target country for search results (default:
us) - language (string): Response language (default:
en) - enable_entities (bool): Include entity information in responses (default:
false) - enable_citations (bool): Include inline citations (default:
false) - enable_research (bool): Enable multi-search research mode (default:
false)
Response Format
Because AI Grounding uses custom messages with richer data than standard OpenAI responses, messages are stringified with special tags. When streaming, you’ll receive:Standard Text
Regular answer content streamed as text.Citations
Entity Items
Usage Metadata
Complete Streaming Example
Here’s a full example that handles all message types:Pricing & Spending Limits
AI Grounding uses a usage-based pricing model: Cost Calculation:- 2 searches
- 1,234 input tokens
- 300 output tokens
Usage Metadata
With each answer, you’ll receive metadata on resource usage:Setting Limits
Control your spending by setting monthly credit limits in your account settings.Limit behavior: Limits are checked before answering. If limits aren’t
exceeded when a question starts, it will be answered in full even if it
exceeds limits during processing. You’ll only be charged up to your imposed
limit.
Rate Limits
- Default: 2 requests per second
- Need more? Contact searchapi-support@brave.com
AI Grounding vs Summarizer Search
Brave offers two complementary approaches for AI-powered search:AI Grounding
Direct AI answers using OpenAI-compatible endpoint. Best for building
chat interfaces and applications that need instant, grounded AI responses.
Summarizer Search
Two-step workflow that first retrieves search results, then generates
summaries. Best when you need control over search results or want to use
specialized summarizer endpoints.
- Building conversational AI applications
- Need OpenAI SDK compatibility
- Want simple, single-endpoint integration
- Require research mode for thorough answers
- Need access to underlying search results
- Want to use specialized endpoints (title, enrichments, followups, etc.)
- Building applications with custom search result processing
- Prefer the traditional web search + summarization flow
Best Practices
Message Handling
- Always handle special message tags (
<citation>,<enum_item>,<usage>) - Parse JSON content within tags to extract structured data
- Display citations inline for better user trust
Streaming
- Use
AsyncOpenAIfor streaming responses - Display content progressively for better UX
- Handle usage metadata at the end of the stream
Research Mode
- Enable only when thoroughness is more important than speed
- Best for background processing or complex research queries
- Monitor usage as it can incur higher costs
Error Handling
- Implement retry logic for transient failures
- Check spending limits before critical operations
- Handle rate limit errors gracefully
Performance
- Use single-search mode (default) for most queries
- Cache responses when appropriate to minimize API calls
- Monitor usage metadata to optimize costs
Changelog
This changelog outlines all significant changes to the Brave AI Grounding API in chronological order.2025-08-05
- Launch Brave AI Grounding API resource
- OpenAI SDK compatibility
- Support for single and multi-search modes
- SOTA performance on SimpleQA benchmark