Introduction
What is ComputeSDK?
Section titled “What is ComputeSDK?”ComputeSDK gives you one consistent API to control sandboxes across multiple providers. Spin up isolated environments, execute shell commands, work with filesystems, and more without worrying about vendor-specific APIs. Perfect for building AI agents that execute code, running untrusted code safely, or orchestrating cloud workloads all while remaining provider-agnostic.
How It Works
Section titled “How It Works”ComputeSDK operates on three core concepts:
Sandboxes - Isolated compute environments where code executes safely
Providers - Cloud platforms hosting the sandboxes (E2B, Modal, Railway, Vercel, Daytona, Render, Blaxel, Namespace)
Gateway - ComputeSDK’s orchestration layer that unifies provider APIs
When you call compute.sandbox.create(), ComputeSDK:
- Detects your configured provider from environment variables
- Provisions a new sandbox on that provider
- Returns a unified interface regardless of underlying provider
- Handles provider-specific authentication, API quirks, and errors
This means you write code once and can switch providers by changing environment variables - no code changes required.
Why ComputeSDK?
Section titled “Why ComputeSDK?”🔄 Provider-agnostic - Switch between E2B, Modal, Railway, Vercel, Daytona, and more without code changes
🛡️ Security-first - Isolated sandboxes protect your infrastructure
⚡ Developer experience - Simple, TypeScript-native API
🌍 Production-ready - Used by teams building the next generation of developer tools
Perfect for building:
Section titled “Perfect for building:”- Code execution platforms - Run user-submitted code safely
- Educational tools - Interactive coding environments
- Data analysis applications - Process code with filesystem access
- AI-powered development tools - Let AI agents write and execute code
- Testing & CI/CD systems - Isolated test environments
Features
Section titled “Features”🚀 Multi-provider support - E2B, Modal, Railway, Vercel, Daytona, Render, Blaxel, Namespace
📁 Filesystem operations - Read, write, create directories
⚡ Command execution - Run shell commands directly
🛡️ Type-safe - Full TypeScript support with comprehensive error handling
📦 Simplicity - Auto detection of providers and simple setup
🔗 Overlays - Bootstrap sandboxes from templates instantly
🖥️ Managed servers - Run dev servers with health checks and auto-restart
🔑 Client-side access - Delegate sandbox access to browser clients securely
Quick Example
Section titled “Quick Example”npm install computesdk
export COMPUTESDK_API_KEY=your_computesdk_api_key
export E2B_API_KEY=your_e2b_api_keyimport { compute } from 'computesdk';
// computeSDK will auto detect the provider
// Create a sandbox
const sandbox = await compute.sandbox.create();
// Execute code
const result = await sandbox.runCode('print("Hello World!")');
console.log(result.output); // "Hello World!"
// Clean up
await sandbox.destroy();Next Steps
Section titled “Next Steps”Ready to get started? Check out our installation guide or dive into the quick start to begin building with ComputeSDK.