# Gemini Google Search: google_search, groundingMetadata and web_search_options Source: https://ofox.io/docs/develop/models/gemini/grounding This page explains how to enable Google Search for Gemini and read the sources. For model IDs and endpoints, see the [Gemini family overview](https://ofox.io/docs/develop/models/gemini). With Google Search enabled, the model searches the web and answers based on the results, which suits questions about time-sensitive information. **Python (google-genai)** ```python filename="gemini_grounding.py" import os from google import genai from google.genai import types client = genai.Client( api_key=os.environ["OFOX_API_KEY"], http_options={"api_version": "v1beta", "base_url": "https://api.ofox.io/gemini"}, ) resp = client.models.generate_content( model="google/gemini-3.5-flash", contents="What is the latest stable version of Python?", config=types.GenerateContentConfig(tools=[types.Tool(google_search=types.GoogleSearch())]), ) print(resp.text) meta = resp.candidates[0].grounding_metadata print("Search queries:", meta.web_search_queries) for chunk in meta.grounding_chunks or []: print("Source:", chunk.web.title, chunk.web.uri) ``` **cURL** ```bash filename="Terminal" curl "https://api.ofox.io/gemini/v1beta/models/google/gemini-3.5-flash:generateContent" \ -H "x-goog-api-key: $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [{"parts": [{"text": "What is the latest stable version of Python?"}]}], "tools": [{"google_search": {}}] }' ``` **Python (OpenAI SDK)** ```python filename="gemini_grounding_openai.py" import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"]) resp = client.chat.completions.create( model="google/gemini-3.5-flash", web_search_options={}, messages=[{"role": "user", "content": "What is the latest stable version of Python?"}], ) print(resp.choices[0].message.content) ``` - In native API responses, `groundingMetadata` contains the search queries (`webSearchQueries`) and source pages (`groundingChunks`). - The OpenAI-compatible API returns the answer only, without sources. - Searches are billed per use; see the [model page](https://ofox.io/models/google/gemini-3.5-flash) for the rate. For other errors, see [Common errors](https://ofox.io/docs/develop/models/gemini#errors).