Skip to main content

Sandbox API Surface

sandbox.rigbox.dev is built on top of the same Rigbox API base (https://api.rigbox.dev/api). It provides a streamlined UI for running AI-generated code in isolated Firecracker micro-VMs with terminal access, app management, and log streaming. Use this guide as an API map when building your own sandbox-like experience.

API Groups

GroupWhat it doesShould you use it in your own app?
Core Workspace APIsCreate, start, stop, delete sandboxesYes, these are the foundation
App Management APIsDeploy, monitor, and expose apps running inside sandboxesYes, for any app hosting
Log Streaming APIsView historical and real-time app logsYes, for observability
API Key ManagementManage programmatic access keysYes, for automation

Core Rigbox APIs Used by Sandbox

EndpointUsed for
GET /workspacesList all sandboxes on the dashboard
GET /workspaces/{id}Fetch sandbox detail view (metadata + status)
POST /workspaces/{id}/startStart a stopped sandbox
POST /workspaces/{id}/stopStop a running sandbox
DELETE /workspaces/{id}Delete a sandbox permanently
POST /quick-deployOne-shot sandbox creation from template
GET /capacityCheck available slots before creating a sandbox

App Management APIs Used by Sandbox

EndpointUsed for
GET /appsList apps in a workspace (filtered by workspace_id)
PATCH /apps/{id}Toggle app visibility (public/private)
GET /apps/{id}/healthCheck if an app is reachable
POST /workspaces/{id}/reconcile-appsEnsure template apps exist after deploy

Log Streaming APIs

EndpointUsed for
GET /apps/{id}/logsFetch historical logs with pagination (?lines=200&direction=oldest)
GET /apps/{id}/logs/streamStream live logs via SSE (?lines=200&interval_ms=3000)
Log streaming uses Server-Sent Events (SSE). Set Accept: text/event-stream header and read the response as an event stream.

API Key Management

EndpointUsed for
GET /api-keysList user’s API keys
POST /api-keysCreate a new API key
DELETE /api-keys/{id}Revoke an API key

Terminal Access

The Sandbox UI provides terminal access to workspaces via WebSocket connections. This uses the shared terminal infrastructure (xterm.js) and connects through the SSH gateway, not through the REST API.

Authentication

The Sandbox UI authenticates via session tokens automatically. For programmatic access, use API keys with the Authorization: Bearer rb_... header.

Minimal Sandbox-Like Integration Flow

  1. Check capacity with GET /capacity — verify available is true.
  2. Call POST /quick-deploy with your desired template.
  3. Poll GET /workspaces/{id} until status is running.
  4. Call POST /workspaces/{id}/reconcile-apps to ensure apps are created.
  5. List apps with GET /apps?workspace_id={id}.
  6. Stream logs with GET /apps/{id}/logs/stream for real-time output.
  7. Toggle visibility with PATCH /apps/{id} to expose apps publicly.

Key Differences from Clawd

FeatureSandboxClawd
Primary use caseRun any code in isolated VMsDeploy OpenClaw AI bots
AI config managementAvailable but optionalCore feature (managed/BYOK)
Terminal accessBuilt-in xterm.js terminalNot included
App log streamingSSE-based live logsSSE-based live logs
Template focusGeneral-purposeOpenClaw-specific
For the Clawd-specific API surface, see /clawd-api-surface.