Use Gemini code execution with Gemini 2.5 Pro

by GoogleCode execution

Gemini 2.5 Pro uses Gemini code execution through Opper on the generateContent endpoint, passed through as Google defines it.

UseGemini code executionwithin

Add Gemini code execution to Gemini 2.5 Pro

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/vertexai/gemini-2.5-pro:generateContent" \
-H "Authorization: Bearer $OPPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents": [{"role": "user", "parts": [{"text": "Sum the first 50 primes and show your working."}]}],
"tools": [{"codeExecution": {}}]}'

Where you can run it

Gemini 2.5 Pro runs Gemini code execution on the routes below.

ProviderRegionZero data retentionTrainingInputOutputCache read
EUNo$1.25$10.00$0.13$1.63 write
EUNo$1.25$10.00$0.13$1.63 write

The model

by Google

Gemini 2.5 Pro by Google, an advanced reasoning LLM with 1M context and thinking mode, strong at complex coding, math, STEM, and deep document analysis.

Available on

Pricing from$1.25/ 1M input$10.00/ 1M output$0.13/ 1M cache read1Mcontext

Privacy

ZDR
Training
No
Region
EU

Use Gemini code execution with other models

Step-by-step setup for Gemini code execution on each of these models through Opper.

More tools on Opper

Use Gemini code execution with Gemini 2.5 Pro

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