Documentation
Runra Sandbox Docs
Runra Sandbox gives your AI agents isolated cloud environments for running code, writing files, installing packages, and connecting to existing agent loops. The SDK is E2B-compatible, with Runra-native API keys and endpoints.
QuickstartCreate a sandbox and run code
Install the SDK, set RUNRA_API_KEY, execute Python, and clean up the sandbox.
Expose a run_python tool so an LLM can safely execute generated code.
Write inputs into the sandbox, run transforms, and read generated outputs.
PackagesInstall custom packagesInstall Python and Node packages at runtime, or prebuild a reusable template.
What to read first
Section titled “What to read first”- Quickstart - create your first sandbox.
- Connect LLMs - use a sandbox as an agent tool.
- Upload and download files - move data in and out.
- Install custom packages - add dependencies.
Runtime model
Section titled “Runtime model”A Runra sandbox is a short-lived cloud workspace. You create it from your application, run code or shell commands inside it, optionally persist work by writing files, and terminate it when the task is complete.
import { Sandbox } from "runra";
const sbx = await Sandbox.create();try { const execution = await sbx.runCode('print("hello from Runra")'); console.log(execution.logs.stdout.join("\n"));} finally { await sbx.kill();}Environment variables
Section titled “Environment variables”| Variable | Required | Description |
|---|---|---|
RUNRA_API_KEY | Yes | Your Runra API key, for example runra_.... |
RUNRA_API_URL | No | Defaults to https://box.runra.dev. |
RUNRA_TEMPLATE_ID | No | Default sandbox template ID. |