Skip to main content
OpenSandbox provides SDKs for multiple programming languages, enabling you to create, manage, and interact with secure sandbox environments from your preferred language.

Available SDKs

Sandbox SDKs

Low-level SDKs for direct sandbox interaction:

Python

Full async/sync support with comprehensive file and command APIs

JavaScript/TypeScript

Modern TypeScript SDK with Node.js and browser support

Kotlin/Java

Type-safe JVM SDK with builder pattern and try-with-resources

C#/.NET

IAsyncDisposable SDK supporting .NET Standard 2.0+

Code Interpreter SDK

Code Interpreter

High-level SDK for executing Python, Java, Go, TypeScript code with state persistence

Choosing the Right SDK

Use Sandbox SDKs when you need:

  • Direct control over sandbox lifecycle (create, pause, resume, kill)
  • File system operations (read, write, search, delete)
  • Command execution with streaming output
  • Network endpoint management
  • Custom health checks and resource monitoring
  • Administrative tasks (listing/managing multiple sandboxes)

Use Code Interpreter SDK when you need:

  • Code execution in multiple languages (Python, Java, Go, TypeScript)
  • State persistence across executions (variables/imports retained)
  • Multi-language contexts in a single sandbox
  • Simplified API for running code snippets
  • Pre-configured runtime environments

SDK Comparison

FeaturePythonJavaScriptKotlinC#Code Interpreter
Async/Await
Sync API
Streaming
File OpsVia Sandbox
Browser Support✅*
Multi-language Execution
State PersistenceManualManualManualManual
*Browser support with limitations (no streaming file uploads)

Common Capabilities

All Sandbox SDKs share these core capabilities:

Lifecycle Management

# Create with timeout
sandbox = await Sandbox.create(
    "ubuntu",
    connection_config=config,
    timeout=timedelta(minutes=30)
)

# Renew expiration
await sandbox.renew(timedelta(minutes=30))

# Pause/Resume
await sandbox.pause()
resumed = await Sandbox.resume(
    sandbox_id=sandbox.id,
    connection_config=config
)

Command Execution

execution = await sandbox.commands.run("echo 'Hello!'")
print(execution.logs.stdout[0].text)

File Operations

# Write
await sandbox.files.write_files([
    WriteEntry(path="/tmp/file.txt", data="content", mode=644)
])

# Read
content = await sandbox.files.read_file("/tmp/file.txt")

# Search
files = await sandbox.files.search(
    SearchEntry(path="/tmp", pattern="*.txt")
)

Installation

Choose your language to get started:
# Sandbox SDK
pip install opensandbox

# Code Interpreter SDK
pip install opensandbox-code-interpreter

Next Steps

Quick Start

Get started with your first sandbox in 5 minutes

API Reference

Explore detailed API documentation

Examples

Browse code examples and use cases

Configuration

Learn about connection and sandbox configuration

Build docs developers (and LLMs) love