Introduction

Sandbox Platform provides isolated Linux environments for AI agents to execute code, run commands, and interact with systems autonomously.

New to Sandbox Platform?

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:

bash
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:

bash
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!"}'
You're ready!

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:

http
Authorization: Bearer YOUR_API_KEY
Keep your API key secure

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

url
https://api.sandbox.dev

Sandbox Endpoints

Sandbox API
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

Execution API
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

Files API
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

Costs API
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