Phase 2 shipping 12 languages MCP-native

The code execution backend for AI agents

12 languages. Stateful sessions. gVisor isolation. MCP-native. Build agents that iteratively debug code, online judges that grade in milliseconds, or coding platforms that scale.

12
Languages
4
Integration modes
gVisor
Kernel isolation
agent code interpreter
# 1. Open a stateful session $ curl -X POST .../v1/sessions \ -d '{"language":"python3"}' → {"id":"sess_abc"}   # 2. Install a package $ curl -X POST .../sessions/sess_abc/install \ -d '{"manager":"pip","packages":["pandas"]}'   # 3. Execute — variables persist $ curl -X POST .../sessions/sess_abc/execute \ -d '{"code":"import pandas; print(pandas.__version__)"}' → "2.2.3\n"

Six things that make SandboxAPI different

Every other code-execution API stops at "send code, get output." We ship the full toolkit AI agents and modern developer tooling actually need.

Stateful Sessions

Persistent sandboxes that retain variables, files, and installed packages across calls. Build code interpreters that actually feel like REPLs.

# Variables persist
 POST "x = 42"
 POST "print(x*2)"
 stdout: "84"

Package Install

pip, npm, gem, cargo — all inside the session, all sandboxed. Top-1k packages cached for sub-3-second installs.

# pandas in < 3s
manager: "pip"
packages: ["pandas",
            "numpy"]

Streaming Output

Server-Sent Events deliver live stdout/stderr as code runs. No polling, no buffering. Render to a terminal in real time.

# SSE events
 stdout: "Step 1"
 stdout: "Step 2"
 result: exit 0

Async + Webhooks

Submit a long-running job, walk away. We deliver a signed callback to your URL when it finishes. HMAC-SHA256 verification built in.

# Fire-and-forget
async: true
callback_url: "…/hook"
# HMAC-SHA256 signed

12 Modern Languages

Python 3.12, Node 22, TypeScript 5.4, Go 1.22, Java 21, GCC 14, Bash 5.2, Rust 1.85, Ruby 3.3, PHP 8.4, .NET 9. Latest stable, not stale 2018 runtimes.

# All current
"rust"   // 1.85
"ruby"   // 3.3
"php"    // 8.4
"csharp" // .NET 9

gVisor Security

User-space kernel intercepts every syscall before it reaches the host. Strictly stronger than container-only sandboxes. Built for hostile input from day one.

# Isolation stack
code
   Docker
   gVisor (runsc)
   host kernel

12 modern runtimes

Latest stable versions. Pre-warmed pools. Strict resource limits. Each running in its own isolated gVisor sandbox.

Four ways to integrate

Same API, four execution patterns. Pick the one that matches your workflow.

Sync

Best for one-shot execution and AI tool calls
curl -X POST .../v1/execute \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"language":"python3","code":"print(2+2)"}'

Streaming

Best for live output and long-running code
curl -N -X POST .../v1/execute/stream \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"language":"python3","code":"..."}'

Async

Best for long jobs and webhook-driven workflows
curl -X POST ".../v1/execute?async=true" \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"code":"...","callback_url":"https://your.app/hook"}'

Sessions

Best for REPL-style iteration and code interpreters
curl -X POST .../v1/sessions/$SID/execute \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"code":"x += 1; print(x)"}'

Drop into Claude Desktop, Cursor, or VS Code in 30 seconds

SandboxAPI is available as an MCP server with 11 tools — execute_code, sessions, batch, async, package install, and more.

One config, every MCP client

Paste this into your MCP-compatible AI assistant. Done. Your AI can now run code in 12 languages, install packages, and keep state across calls.

  • execute_code, execute_batch, list_languages
  • create_session, session_execute, session_close
  • session_install_packages
  • execute_async, get_execution
  • execute_with_expected, get_capabilities
MCP integration guide →
{
  "mcpServers": {
    "sandboxapi": {
      "url": "https://mcp.sandboxapi.dev/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Migrating from Judge0?

Field-level mapping, honest comparison, and recommendations by persona.

SandboxAPI vs Judge0 →

See it in action

Real-world examples you can run right now. Click any example to try it in the playground.

Python

Validate LLM-Generated Code

Run AI-generated functions against a test harness, get structured pass/fail results

Try it →
Rust

Code interpreter loop

Stateful sessions and package install for a debugging agent that retries on errors and learns from compile failures

See pattern →
JavaScript

Execute Validation Logic

Run generated business rules to validate records with detailed error reporting

Try it →
C++

Multi-file submission grader

Submit a ZIP with custom compile and run scripts. Set expected_output, get an automatic wrong_answer status

See it →
Java

Performance Benchmark

Benchmark solutions at scale and verify time complexity meets O(n) requirement

Try it →
Bash

Multi-Language Runner

Run the same challenge across 12 languages and verify output consistency

Try it →
Python

Auto-Grade Assignment

Score student code against a weighted rubric with 14 test cases across 3 categories

Try it →
Ruby

Code Challenge Runner

Validate student functions against hidden test suites with detailed feedback

Try it →
JavaScript

Interactive Challenge

Test student expressions with stdin input and automated evaluation

Try it →
Python

Validate Deploy Config

Check production configs against security rules, flag errors and warnings

Try it →
Go

Generate Sales Report

Transform raw sales data into formatted reports with leaderboards and breakdowns

Try it →
Bash

Test Data Pipeline

Run ETL pipeline steps and validate each transformation produces correct output

Try it →

Predictable pricing, four tiers

All plans include 12 languages, gVisor isolation, multi-file programs, output verification, and streaming. Sessions, package install, and async unlock at Pro and above.

Basic
$0/mo
500 executions / month
  • 12 languages
  • 30s max timeout
  • Batch up to 10
  • Streaming included
  • gVisor isolation
Start free
Ultra
$49/mo
50,000 executions / month
  • Everything in Pro
  • 300s max timeout
  • Batch up to 100
  • 20 concurrent sessions
  • Full package allowlist
Subscribe
Mega
$149/mo
200,000 executions / month
  • Everything in Ultra
  • 600s max timeout
  • Batch up to 200
  • 50 concurrent sessions
  • Custom package allowlist
Subscribe

Stop building sandbox infrastructure

Get your API key and start executing code in minutes. 500 free executions, no credit card required.

Get API key on RapidAPI Open the Playground