Gemini code execution
Code execution is Google's Gemini tool for writing and running Python while it answers. Gemini runs the code, reads the result and, when it errors, can rewrite it up to five times, with libraries such as NumPy, pandas and Matplotlib already installed. Each run is capped at 30 seconds, and it combines with Google Search grounding. On Opper it works on the Gemini generateContent endpoint, passed through as Google defines it.
Add Gemini code execution on Opper
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.
Key info
codeExecutionIn your code
curl "https://api.opper.ai/v3/compat/v1beta/models/gemini/gemini-4-argon: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": {}}]}'
Use Gemini code execution with these models
Step-by-step setup for Gemini code execution on each of these models through Opper.
More tools on Opper
OpenAI code interpreter
GPT models write and run Python in a sandbox, on the Responses endpoint.
code_interpreterClaude code execution
Claude runs code in Anthropic's sandbox, on Anthropic's own route.
code_executionClaude computer use
Claude drives a desktop through screenshots, clicks and typing in your agent loop.
computer_toolset