Grounding with Exa Web Search

Exa provides a search API that gives access to publicly available web data optimized for grounding large language model responses. This page explains how to ground Gemini responses by using Exa.

Grounding with Exa Web Search on Vertex AI is a Separate Offering (as defined in your Google Cloud Agreement) that connects Gemini models to public web data provided by Exa's search API .

Grounding with Exa Web Search is available as a Restricted Preview . To access this feature for your project, contact your Google Cloud account team to request addition to the allowlist.

Use cases

Grounding with Exa improves accuracy and reduces hallucinations by giving models access to fresh, relevant web data. Common use cases include:

  • General agents and chatbots: Retrieve up-to-date information to produce more reliable answers.
  • Research agents: Conduct deep web research across multiple sources.
  • Coding agents: Pull the latest code snippets, documents, and technical references.
  • Voice agents: Web retrieval to support real-time, low-latency voice interactions.
  • Vertical-specific agents: Fetch up-to-date, domain-specific information tailored to a particular industry or knowledge vertical.
  • Data enrichment: Augment internal datasets with current web context and metadata.
  • Automated workflows: Periodically gather news, people, company, or other frequently updated data for internal or production workflows.

Example

Who won Superbowl 2026?

Without Grounding With Grounding
I cannot tell you who won Super Bowl 2026 as that event has not happened yet. The Seattle Seahawks won Super Bowl LX on February 8, 2026, defeating the New England Patriots with a final score of 29-13. Sources: domain1.com, domain2.com, ...

Supported models

This section lists the models that support Grounding with Exa Web Search.

Before you begin

To use Grounding with Exa, you need to get an API key from Exa's web site . This API key is used in your request to Gemini.

Ground Gemini responses with Exa

Request grounded responses from Gemini by using the REST API as follows. For best performance, we recommend using default settings for optional parameters unless you strictly require non-default values.

REST

Before using any of the request data, make the following replacements:

  • LOCATION : The region to process the request. To use the global endpoint, exclude the location from the endpoint name and configure the location of the resource to `global`.
  • PROJECT_ID : Your Google Cloud project ID.
  • MODEL_ID : The ID of the model to use.
  • TEXT : The text prompt to send to the model.
  • API_KEY : Your API key for Exa Web Search.
  • EXCLUDE_DOMAINS : Optional: List of domains to exclude from search results. If specified, no results will be returned from these domains. You can specify up to 1200 domains.
  • INCLUDE_DOMAINS : Optional: List of domains to include in the search. If specified, results will only come from these domains. You can specify up to 1200 domains.
  • MAX_CHARACTERS : Optional: Maximum number of characters to return for highlights. Controls the total length of highlight text returned per URL.
  • NUM_RESULTS : Optional: The maximum number of search results to use for grounding. If not specified, defaults to 10 .

HTTP method and URL:

POST https:// LOCATION 
-aiplatform.googleapis.com/v1/projects/ PROJECT_ID 
/locations/ LOCATION 
/publishers/google/models/ MODEL_ID 
:generateContent

Request JSON body:

{
  "contents": [{
    "role": "user",
    "parts": [{
      "text": " TEXT 
"
    }]
  }],
  "tools": [{
    "exaAiSearch": {
        "api_key": " API_KEY 
",
        "customConfigs": {
            "excludeDomains": [" EXCLUDE_DOMAINS 
"],
            "includeDomains": [" INCLUDE_DOMAINS 
"],
            "contents": {
                "highlights": {
                    "maxCharacters": MAX_CHARACTERS 
}
            },
            "numResults": NUM_RESULTS 
}
    }
}],
  "model": "projects/ PROJECT_ID 
/locations/ LOCATION 
/publishers/google/models/ MODEL_ID 
"
}

To send your request, expand one of these options:

You should receive a JSON response similar to the following.

Quota

The default quota is 200 prompts per minute. If you need to increase your rate limits, contact support@exa.ai and your Google account team with your use case and requirements.

Billing

The use of Grounding with Exa incurs the following charges:

  • Gemini token consumption: Prompt tokens, thinking tokens, output tokens. For more information, see Pricing .
  • Gemini's Grounding with your data: For more information, see Pricing .
  • Pricing for the use of Exa's search API: For more information, see Exa's pricing page .
Create a Mobile Website
View Site in Mobile | Classic
Share by: