Code execution

from OpenAI, Google and AnthropicCodedocs.opper.ai

Give the model a sandbox and it writes and runs code to answer: maths, data analysis, charts and file transforms, with the output folded into its reply. OpenAI's code interpreter, Gemini's code execution and Claude's code execution all run through Opper on the same key, passed through as each provider defines them. Claude's runs on Anthropic's own route, not on Bedrock or Vertex.

Add 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.

Get your API key

In your code

curl https://api.opper.ai/v3/compat/responses \
-H "Authorization: Bearer $OPPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-6-sol",
"input": "Sum the first 50 primes and show your working.",
"tools": [{"type": "code_interpreter", "container": {"type": "auto"}}]}'

Code execution tools on Opper

Each one has its own page with setup, code and the models it works with.

  • OpenAI: code_interpreter on /v3/compat/responses
  • Google: codeExecution on /v3/compat/v1beta/models/{model}:generateContent
  • Anthropic: code_execution (Anthropic's own route only) on /v3/compat/v1/messages

More tools on Opper

Use code execution through one API key

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