API Reference
Create OpenClaw sandboxes programmatically. Full TypeScript and Python SDKs for automated deployments, CI pipelines, and custom integrations.
Authentication
Every SDK call is authenticated with your API key. You can generate one from the OmniRun dashboard under Settings > API Keys.
Set it as an environment variable and the SDK picks it up automatically. No configuration code needed.
export OMNIRUN_API_KEY="your-api-key"Quick start
npm install @omnirun/sdkimport { Sandbox } from "@omnirun/sdk";
const sandbox = await Sandbox.create("openclaw", {
timeout: 3600,
internet: true,
});
// Run commands inside the sandbox
await sandbox.commands.run("cat /.openclaw/openclaw.json");
// When you're done
await sandbox.kill();from omnirun import Sandbox
sandbox = Sandbox.create(
"openclaw",
timeout=3600,
internet=True,
)
# Run commands inside the sandbox
sandbox.commands.run("cat /.openclaw/openclaw.json")
# When you're done
sandbox.kill()SDK Methods
| Method | Description | SDK |
|---|---|---|
Sandbox.create() | Create a new OpenClaw sandbox from the openclaw template. Returns a Sandbox instance. | Sandbox.create("openclaw", opts) |
Sandbox.connect() | Connect to an existing running sandbox by ID. Resume control of a previously created instance. | Sandbox.connect(sandboxId, opts) |
sandbox.commands.run() | Execute a shell command inside the sandbox. Returns stdout, stderr, and exit code. | sandbox.commands.run("cmd") |
sandbox.kill() | Terminate the sandbox immediately. All state is destroyed. | sandbox.kill() |
Create Options
timeoutnumberMaximum sandbox lifetime in seconds. The sandbox is automatically destroyed after this period. Default: 300.
internetbooleanEnable outbound internet access. Required for OpenClaw to reach LLM providers and messaging APIs. Default: false.
metadataRecord<string, string>Arbitrary key-value pairs attached to the sandbox. Useful for tracking which user or pipeline created it.
vaultInjectbooleanInject stored vault credentials into the sandbox at boot. Keys are written to /tmp/.omnirun-env and exist only in memory.
OpenClaw Configuration
After creating a sandbox, write your OpenClaw configuration and start the gateway. The config lives at /.openclaw/openclaw.json and controls which channels, LLM providers, and skills your agent uses.
{
"gateway": {
"port": 3000,
"controlUi": { "enabled": true }
},
"agents": {
"main": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "You are a helpful assistant.",
"channels": ["whatsapp"],
"skills": ["web-search", "code-interpreter"]
}
}
}import { Sandbox } from "@omnirun/sdk";
const sandbox = await Sandbox.create("openclaw", {
timeout: 3600,
internet: true,
});
// Write your config
const config = JSON.stringify({
gateway: { port: 3000 },
agents: {
main: {
provider: "openai",
model: "gpt-4o",
systemPrompt: "You are a helpful assistant.",
channels: ["whatsapp"],
},
},
});
await sandbox.commands.run(
`mkdir -p /.openclaw/agents/main/agent && echo '${config}' > /.openclaw/openclaw.json`
);
// Start the OpenClaw gateway
await sandbox.commands.run("openclaw start &");Rate Limits & Pricing
Free Tier
$0/mo
Pro
$19/mo
See full pricing details on the pricing page.
Full OmniRun SDK documentation covers all templates, not just OpenClaw. TypeScript and Python examples for every method.