Introduction
Sandbox Platform provides isolated Linux environments for AI agents to execute code, run commands, and interact with systems autonomously.
Start with our Quickstart Guide to create your first sandbox in minutes.
Quickstart
Get up and running with Sandbox Platform in just a few steps.
1. Get your API Key
Navigate to the Dashboard and copy your API key from the settings page.
2. Create a Sandbox
Use the API to create a new sandbox environment:
curl -X POST https://api.sandbox.dev/api/sandboxes \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "my-first-sandbox", "instance_type": "t3.medium", "docker_image": "ubuntu:latest" }'
3. Execute Commands
Once your sandbox is running, execute commands via the API:
curl -X POST https://api.sandbox.dev/api/sandboxes/{sandbox_id}/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "echo Hello, World!"}'
Your sandbox is now running. Explore the API reference below for more operations.
Authentication
All API requests require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Never expose your API key in client-side code or public repositories.
API Reference
The Sandbox Platform API is organized around REST. Our API accepts JSON-encoded request bodies and returns JSON-encoded responses.
Base URL
https://api.sandbox.dev
Sandbox Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/sandboxes | Create a new sandbox |
| GET | /api/sandboxes | List all sandboxes |
| GET | /api/sandboxes/{id} | Get sandbox details |
| POST | /api/sandboxes/{id}/start | Start a stopped sandbox |
| POST | /api/sandboxes/{id}/stop | Stop a running sandbox |
| DELETE | /api/sandboxes/{id} | Delete a sandbox |
Command Execution
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/sandboxes/{id}/execute | Execute a command in sandbox |
| GET | /api/sandboxes/{id}/metrics | Get sandbox metrics (CPU, memory) |
File Operations
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/sandboxes/{id}/files | Save a file to sandbox |
| POST | /api/sandboxes/{id}/upload | Upload file to sandbox |
| GET | /api/sandboxes/{id}/download | Download workspace archive |
Cost Management
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/costs/user/{id} | Get user cost report |
| GET | /api/costs/organization | Get organization cost report |
| POST | /api/costs/limits/user/{id} | Set user cost limit |