Applies to:
- Plan - Any
- Deployment - Braintrust-hosted
- Use case - How to enable and route Gemini Google Search grounding (provider-managed googleSearch tool) through the Braintrust Gateway and which endpoints support it
Summary
You cannot pass Gemini’s nativegoogleSearch tool via the /chat/completions endpoint because its OpenAI-style function schemas cannot carry provider-managed Gemini tools. Use the Gateway native generateContent route and include tools: [{googleSearch: {}}] to enable Google Search grounding.
What is happening
Gemini provider-managed tools such asgoogleSearch run inside the model request. The Gateway routes native generateContent requests to your configured Vertex provider.
Fix or suggestion
Use the Gateway native generateContent route
-
Send a POST request to
https://gateway.braintrust.dev/v1beta/models/gemini-2.5-flash:generateContent. -
Include the
toolsarray with thegoogleSearchtool in the native request body: - Route the Gateway to your Vertex provider in your Gateway configuration.
-
Enable Gateway logging by setting the
x-bt-parentheader toproject_name:YOUR_PROJECT_NAME, replacingYOUR_PROJECT_NAMEwith your Braintrust project name.
BRAINTRUST_API_KEY set to your Braintrust API key, send the complete request:
How to confirm it worked
- Inspect the model response in the Braintrust request trace for
groundingMetadatawith source references. EnablinggoogleSearchdoes not guarantee that every response is grounded.