Claude code execution

by AnthropicCode execution

Code execution is Anthropic's server tool that gives Claude a sandboxed container to run Bash commands and Python and to create and edit files while it answers. The container has 5 GiB of memory and no internet access, so only its preinstalled libraries are there, and you can reuse it across requests for up to 30 days to keep the files Claude made. On Opper, Claude gets it on the Messages endpoint, passed through as Anthropic defines it. It runs on Anthropic's own route; Claude served from Bedrock or Vertex doesn't have it.

UseClaude code executionwithin

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

Key info

Tool
code_execution
Endpoint
Messages
Routes
Anthropic

In your code

curl https://api.opper.ai/v3/compat/v1/messages \
-H "Authorization: Bearer $OPPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "anthropic/claude-haiku-5-5", "max_tokens": 1024,
"messages": [{"role": "user", "content": "Sum the first 50 primes and show your working."}],
"tools": [{"type": "code_execution_20260521", "name": "code_execution"}]}'

Use Claude code execution with these models

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

More tools on Opper

Use Claude code execution 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