OmniClaw

API Reference

Build with
the OmniRun SDK.

Create OpenClaw sandboxes programmatically. Full TypeScript and Python SDKs for automated deployments, CI pipelines, and custom integrations.

Authentication

Get your API key.

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.

Environment variablebash
export OMNIRUN_API_KEY="your-api-key"

Quick start

Three lines to a running agent.

Install the SDKbash
npm install @omnirun/sdk
Create an OpenClaw sandboxtypescript
import { 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();
Pythonpython
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

Everything you need.

MethodDescriptionSDK
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

Sandbox.create() options.

timeoutnumber

Maximum sandbox lifetime in seconds. The sandbox is automatically destroyed after this period. Default: 300.

internetboolean

Enable 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.

vaultInjectboolean

Inject stored vault credentials into the sandbox at boot. Keys are written to /tmp/.omnirun-env and exist only in memory.

OpenClaw Configuration

Configure your agent.

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.

openclaw.jsonjson
{
  "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"]
    }
  }
}
Write config and start the gatewaytypescript
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

Simple, predictable pricing.

Free Tier

$0/mo

  • 1 concurrent sandbox
  • 24-hour max session
  • $5 LLM credit included
  • 10 API calls/minute

Pro

$19/mo

  • Unlimited concurrent sandboxes
  • Always-on agents
  • $20 LLM credit/month
  • 100 API calls/minute

See full pricing details on the pricing page.

Ready to build?

Full OmniRun SDK documentation covers all templates, not just OpenClaw. TypeScript and Python examples for every method.