OpenAI code interpreter

by OpenAICode execution

Code interpreter is OpenAI's tool that lets its models write and run Python in a sandboxed container while they answer. The model analyses data, works through maths, draws charts and transforms files, and rewrites and reruns code that fails until it works. Files it makes come back as citations you can download, and a container expires after 20 minutes unused. On Opper it runs on the Responses endpoint, passed through as OpenAI defines it, on the same key as every other model.

UseOpenAI code interpreterwithin

Add OpenAI code interpreter 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

Key info

Tool
code_interpreter
Endpoint
Responses

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.1-sol",
"input": "Sum the first 50 primes and show your working.",
"tools": [{"type": "code_interpreter", "container": {"type": "auto"}}]}'

Use OpenAI code interpreter with these models

Step-by-step setup for OpenAI code interpreter on each of these models through Opper.

More tools on Opper

Use OpenAI code interpreter through Opper

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