| name | opencomputer-sandbox |
| description | Guide for creating and managing OpenComputer sandboxes using ComputeSDK. Use when building applications that need OpenComputer provider for ComputeSDK - persistent cloud VMs with checkpoints, preview URLs, command execution, and filesystem access. |
OpenComputer Sandboxes with ComputeSDK
OpenComputer provider for ComputeSDK - persistent cloud VMs with checkpoints, preview URLs, command execution, and filesystem access.
Setup
npm install computesdk @computesdk/opencomputer
Set your credentials:
OPENCOMPUTER_API_KEY=your_opencomputer_api_key
OPENCOMPUTER_API_URL=your_opencomputer_api_url
Quick Start
import { compute } from 'computesdk';
import { opencomputer } from '@computesdk/opencomputer';
compute.setConfig({
provider: opencomputer({
apiKey: process.env.OPENCOMPUTER_API_KEY,
apiUrl: process.env.OPENCOMPUTER_API_URL,
}),
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('echo "Hello from OpenComputer!"');
console.log(result.stdout);
await sandbox.destroy();
You can also call the provider factory directly:
import { opencomputer } from '@computesdk/opencomputer';
const sdk = opencomputer({
apiKey: process.env.OPENCOMPUTER_API_KEY,
apiUrl: process.env.OPENCOMPUTER_API_URL,
});
const sandbox = await sdk.sandbox.create();
OpenComputer Configuration
interface OpenComputerConfig {
apiKey?: string;
apiUrl?: string;
template?: string;
timeout?: number;
envs?: Record<string, string>;
metadata?: Record<string, string>;
cpuCount?: number;
memoryMB?: number;
diskMB?: number;
secretStore?: string;
burst?: boolean;
previewAuth?: { scheme?: 'bearer'; token?: | };
}
Full API
ComputeSDK exposes the same universal sandbox API across providers: sandbox.create(), sandbox.getById(), sandbox.destroy(), sandbox.runCommand(), sandbox.getInfo(), sandbox.getUrl(), and sandbox.filesystem.*.
Install the main skill for the complete reference:
npx skills add https://github.com/computesdk/sandbox-skills --skill computesdk
Or see https://www.computesdk.com/docs/reference/sandbox/.