Docs / Home

Runra Sandbox Documentation

Build with Runra Sandbox, an E2B-compatible sandbox API for AI agents.

Developer docs

Build AI agents that safely run code

Runra Sandbox gives production AI agents isolated cloud workspaces for code execution, files, packages, ports, and long-running tasks. It is E2B-compatible, with Runra-native API keys, endpoints, templates, and billing.

quickstart.ts
import { Sandbox } from "runra";

const sandbox = await Sandbox.create();
const result = await sandbox.runCode(
  'print("hello from Runra")'
);

console.log(result.text);
await sandbox.kill();

Runra is a sandbox infrastructure layer for agent platforms. Create a VM-backed workspace on demand, run generated code or shell commands, move files in and out, pause state when work is idle, and terminate the environment when the task is complete.

Run code in minutes

Use the Runra SDK to create a sandbox and execute code from your application.

JavaScript and TypeScript

npm install runra
# or
bun add runra
export RUNRA_API_KEY=runra_your_api_key
# Optional. Defaults to https://box.runra.dev
export RUNRA_API_URL=https://box.runra.dev
import { Sandbox } from "runra";

const sandbox = await Sandbox.create({ timeout: 300 });

try {
  const execution = await sandbox.runCode(`
name = "Runra"
print(f"hello from {name}")
2 + 2
`);

  console.log(execution.logs.stdout.join("\n"));
  console.log("Result:", execution.text);
} finally {
  await sandbox.kill();
}

Python

pip install runra e2b-code-interpreter
from runra import Sandbox

sandbox = Sandbox.create(timeout=300)
try:
    execution = sandbox.run_code('print("hello from Runra")')
    print("\n".join(execution.logs.stdout))
finally:
    sandbox.kill()

Start building

Pick the path closest to your workload. The cards below keep the existing docs flow, but present it like a product API surface instead of a plain table of contents.

Core API surface

The most common production flow is create, execute, optionally pause, and delete. Use the full API reference for request and response schemas.

How to use the docs

Environment variables

VariableRequiredDescription
RUNRA_API_KEYYesYour Runra API key, for example runra_....
RUNRA_API_URLNoDefaults to https://box.runra.dev.
RUNRA_TEMPLATE_IDNoDefault sandbox template ID.