Rigbox provides the infrastructure primitives - isolated VMs, app routing, AI proxy, and credit management - so you can build a hosting platform on top without managing servers. This guide walks through building a service like Clawd (an AI bot hosting platform) using the Rigbox API. By the end, you will have a working architecture for provisioning user workspaces, exposing apps, and managing AI credits.Documentation Index
Fetch the complete documentation index at: https://docs.rigbox.dev/llms.txt
Use this file to discover all available pages before exploring further.
Architecture Overview
Your platform sits between your users and the Rigbox API: Each user gets their own isolated micro-VM. Your backend orchestrates lifecycle, configuration, and monitoring through the Rigbox API. You handle user auth and billing; Rigbox handles VM isolation, networking, and AI proxy.You handle user authentication and billing. Rigbox handles VM isolation, networking, and the AI proxy. This separation lets you focus on your product while Rigbox manages the infrastructure.
Step 1: Provision a Workspace
When a user signs up on your platform, provision a workspace for them using the quick-deploy endpoint. This creates a workspace from a template with sensible defaults.workspace_id in your database, linked to the user. This is how you will manage their workspace going forward.
Available templates include:
| Template | Use case |
|---|---|
ai-agent-starter | AI agent with tool use and memory |
openclaw | Telegram bot with AI backend |
web-fullstack | React + Node.js starter |
base | Minimal workspace, no extras |
dev | Full development environment |
Step 2: Configure AI
Set up the AI configuration for the workspace. You can use Rigbox’s managed credits or let users bring their own keys (BYOK).Managed mode (recommended for getting started)
Rigbox injects API keys and tracks usage against the user’s credit balance:BYOK mode
Let users provide their own API keys:Step 3: Expose the App
Once the workspace is running, you need to create app routes so your users’ services are accessible from the internet.Reconcile template apps
If the workspace was created from a template, reconcile to create the default app routes:Create a custom app route
For custom services, create an app route manually:{subdomain}.rigbox.dev with automatic HTTPS.
Step 4: Control Access
Set the visibility of each app based on your platform’s requirements.Make an app public
For user-facing apps that should be accessible by anyone:Restrict to specific users
For team or internal apps, use privileged mode with an allowlist:| Visibility | Access |
|---|---|
private | Only the workspace owner |
privileged | Owner + allowed emails |
public | Anyone with the URL |
Step 5: Monitor Health
Check app health before showing a “live” status indicator in your UI.status field (healthy, degraded, or down) that you can map to a status badge in your UI. The metrics endpoint returns CPU, memory, and disk usage for resource dashboards.
Step 6: Show Credits and Usage
Display credit balance and AI usage in your dashboard. Three endpoints give you everything you need for a usage dashboard:Step 7: Lifecycle Management
Let users control their workspace instances through your UI.Start a workspace
Stop a workspace
Delete a workspace
Real-World Examples
How Clawd does it
Clawd is an AI bot hosting platform built on Rigbox. Here is what makes it unique:- Template: Uses
openclawfor Telegram bot deployment - Billing: Integrates Stripe for credit pack sales (billing is handled outside the Rigbox API)
- Dashboard: Shows real-time metrics and AI credit balance
- AI config: Lets users pick their provider and model through a settings UI
How Sandbox does it
Sandbox is a general-purpose coding environment built on Rigbox:- Template: Uses
baseanddevtemplates for coding workspaces - Terminal: Integrates terminal access via xterm.js WebSocket connections
- Logs: Streams app logs in real time via SSE (Server-Sent Events)
- Apps: Lets users create and manage multiple app routes per workspace
Next Steps
- SSH Access - Connect to workspaces over SSH
- The Rigbox CLI - Manage workspaces from the terminal
- Workspaces API - Full workspace API reference
- Apps API - Full apps API reference
- AI & Credits API - Credits, usage, and limits