Use Google Search grounding with Gemini 3.1 Pro Preview

by GoogleWeb search

Gemini 3.1 Pro Preview has its own web search on 2 of its 3 routes, and auto uses it when you call it on the generateContent endpoint. On every other route and endpoint Opper's engine runs the search.

UseGoogle Search groundingwithin

Add Google Search grounding to Gemini 3.1 Pro Preview

Set up with agents

Paste this into your coding agent (Claude Code, Cursor, Codex, and more) and it will set up and build with Opper for you.

Get your API key

In your code

curl "https://api.opper.ai/v3/compat/v1beta/models/gemini/gemini-3.1-pro-preview:generateContent" \
-H "Authorization: Bearer $OPPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents": [{"role": "user", "parts": [{"text": "What changed in the news today?"}]}],
"tools": [{"type": "opper:web_search", "engine": "native"}]}'

Where you can run it

Gemini 3.1 Pro Preview runs Google Search grounding on the routes below. Some routes also sell flex and priority processing: the same model at another price, picked per request with service_tier. How service tiers work.

ProviderRegionZero data retentionTrainingInputOutputCache read
USNo$2.00$12.00$0.20$2.38 write
MultiNo$2.00$12.00$0.20$2.38 write

The model

by Google

Gemini 3.1 Pro Preview by Google, a frontier reasoning LLM with 1M context and strong agentic coding, scoring 77% on ARC-AGI-2 and 81% on SWE-Bench Verified.

Available on

Pricing from$2.00/ 1M input$12.00/ 1M output$0.20/ 1M cache read1Mcontext

Privacy

ZDR
Training
No
Region
US, Multi

Use Google Search grounding with other models

Step-by-step setup for Google Search grounding on each of these models through Opper.

More tools on Opper

Use Google Search grounding with Gemini 3.1 Pro Preview

One key, 700+ models, a choice of region, and zero data retention. Tools run in the same request, with every call in your traces.

Get startedView Documentation