Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
This page describes Web Grounding for Enterprise compliance controls and how to use
the Web Grounding for Enterprise API to generate responses that are grounded on the
web. The indexed content is a subset of what's available on
Google Search and suitable for customers in highly-regulated
industries, such as finance, healthcare, and the public sector.
If you don't require the compliance controls, use Ground with
Google Search,
because it offers access to a broader web index.
Overview
Web Grounding for Enterprise uses a web index that is used to generate grounded
responses. The web index supports the following:
Because no customer data is persisted, customer-managed encryption keys (CMEK)
and Access Transparency (AxT) aren't applicable.
Use the API
This section provides sample requests of using the Generative AI API Gemini 2 on
Vertex AI to create grounded responses with Gemini. To use the API, you
must set the following fields:
Contents.parts.text: The text query users want to send to the API.
tools.enterpriseWebSearch: When this tool is provided,
Web Grounding for Enterprise can be used by Gemini.
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values# with appropriate values for your project.exportGOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECTexportGOOGLE_CLOUD_LOCATION=globalexportGOOGLE_GENAI_USE_VERTEXAI=True
fromgoogleimportgenaifromgoogle.genai.typesimport(EnterpriseWebSearch,GenerateContentConfig,HttpOptions,Tool,)client=genai.Client(http_options=HttpOptions(api_version="v1"))response=client.models.generate_content(model="gemini-2.5-flash",contents="When is the next total solar eclipse in the United States?",config=GenerateContentConfig(tools=[# Use Enterprise Web Search ToolTool(enterprise_web_search=EnterpriseWebSearch())],),)print(response.text)# Example response:# 'The next total solar eclipse in the United States will occur on ...'
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Web Grounding for Enterprise\n\nThis page describes Web Grounding for Enterprise compliance controls and how to use\nthe Web Grounding for Enterprise API to generate responses that are grounded on the\nweb. The indexed content is a subset of what's available on\nGoogle Search and suitable for customers in highly-regulated\nindustries, such as finance, healthcare, and the public sector.\n\nIf you don't require the compliance controls, use [Ground with\nGoogle Search](/vertex-ai/generative-ai/docs/grounding/ground-with-google-search),\nbecause it offers access to a broader web index.\n\nOverview\n--------\n\nWeb Grounding for Enterprise uses a web index that is used to generate grounded\nresponses. The web index supports the following:\n\n- ML processing in the US or European multi-regions\n- No logging of customer data\n- [VPC Service Controls](/vertex-ai/generative-ai/docs/security-controls)\n\nBecause no customer data is persisted, customer-managed encryption keys (CMEK)\nand Access Transparency (AxT) aren't applicable.\n\nUse the API\n-----------\n\nThis section provides sample requests of using the Generative AI API [Gemini 2](/vertex-ai/generative-ai/docs/gemini-v2) on\nVertex AI to create grounded responses with Gemini. To use the API, you\nmust set the following fields:\n\n- **`Contents.parts.text`**: The text query users want to send to the API.\n- **`tools.enterpriseWebSearch`**: When this tool is provided, Web Grounding for Enterprise can be used by Gemini.\n\n### Python\n\n#### Install\n\n```\npip install --upgrade google-genai\n```\n\n\nTo learn more, see the\n[SDK reference documentation](https://googleapis.github.io/python-genai/).\n\n\nSet environment variables to use the Gen AI SDK with Vertex AI:\n\n```bash\n# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values\n# with appropriate values for your project.\nexport GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT\nexport GOOGLE_CLOUD_LOCATION=global\nexport GOOGLE_GENAI_USE_VERTEXAI=True\n```\n\n\u003cbr /\u003e\n\n from google import genai\n from google.genai.types import (\n EnterpriseWebSearch,\n GenerateContentConfig,\n HttpOptions,\n Tool,\n )\n\n client = genai.Client(http_options=HttpOptions(api_version=\"v1\"))\n\n response = client.models.generate_content(\n model=\"gemini-2.5-flash\",\n contents=\"When is the next total solar eclipse in the United States?\",\n config=GenerateContentConfig(\n tools=[\n # Use Enterprise Web Search Tool\n Tool(enterprise_web_search=EnterpriseWebSearch())\n ],\n ),\n )\n\n print(response.text)\n # Example response:\n # 'The next total solar eclipse in the United States will occur on ...'\n\n### REST\n\nReplace the following variables with values:\n\n- **\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e**: Your project number.\n- **\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e**: Your region.\n- **\u003cvar translate=\"no\"\u003eTEXT\u003c/var\u003e**: Your prompt.\n\n curl -X POST -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -H \"Content-Type: application/json\" -H \"x-server-timeout: 60\" https://\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e-aiplatform.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/publishers/google/models/gemini-2.0-flash:generateContent -d '\n {\n \"contents\": [{\n \"role\": \"user\",\n \"parts\": [{\n \"text\": \u003cvar translate=\"no\"\u003eTEXT\u003c/var\u003e\n }]\n }],\n \"tools\": [{\n \"enterpriseWebSearch\": {\n }\n }]\n }\n '\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- To learn more about how to ground Gemini models to your data, see [Grounding with Vertex AI Search](/vertex-ai/generative-ai/docs/grounding/grounding-with-vertex-ai-search).\n- To learn more about responsible AI best practices and Vertex AI's safety filters, see [Responsible AI](/vertex-ai/generative-ai/docs/learn/responsible-ai)."]]