API Reference
Introduction

API Introduction

The Akira API provides programmatic control over isolated execution environments and persistent storage via snapshots.

Base URL

All API requests are made to:

https://api.akiralabs.ai

API Version

The current API version is v1. All endpoints are prefixed with /v1/.

https://api.akiralabs.ai/v1/sandboxes/list

Authentication

All requests require authentication via the x-api-key header:

curl https://api.akiralabs.ai/v1/sandboxes/list \
  -H "x-api-key: YOUR_API_KEY"

See Authentication for details on obtaining and managing API keys.

Request Format

Content-Type

For POST requests with a body, use application/json:

curl -X POST https://api.akiralabs.ai/v1/sandboxes/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image": "akiralabs/akira-default-sandbox"}'

Request Body

JSON request bodies should follow the schema defined for each endpoint.

Response Format

All responses are JSON with the following structure:

Success Response

{
  "id": "sbx_abc123",
  "status": "running",
  "created_at": "2024-01-15T10:30:00Z"
}

Error Response

{
  "error": {
    "code": "invalid_request",
    "message": "Missing required field: image"
  }
}

HTTP Status Codes

CodeDescription
200Success
201Resource created
400Bad request - invalid parameters
401Unauthorized - invalid or missing API key
403Forbidden - insufficient permissions
404Resource not found
429Rate limit exceeded
500Internal server error

Rate Limits

API requests are rate limited per API key:

TierRequests/minuteConcurrent sandboxes
Beta6010
Pro30050
EnterpriseCustomCustom

When rate limited, you'll receive a 429 response with a Retry-After header.

Endpoint Overview

Sandboxes

MethodEndpointDescription
POST/v1/sandboxes/createCreate a new sandbox
GET/v1/sandboxes/listList running sandboxes
DELETE/v1/sandboxes/{id}/deleteDelete a sandbox
DELETE/v1/sandboxes/delete-allDelete all sandboxes
POST/v1/sandboxes/{id}/executeExecute a command
POST/v1/sandboxes/{id}/execute_asyncStream command execution
POST/v1/sandboxes/{id}/uploadUpload a file
GET/v1/sandboxes/{id}/downloadDownload a file
GET/v1/sandboxes/{id}/statusGet resource usage

Snapshots

MethodEndpointDescription
POST/v1/sandboxes/{id}/snapshotCreate a snapshot
POST/v1/sandboxes/{id}/cloneClone a sandbox
GET/v1/snapshots/listList snapshots
POST/v1/snapshots/{id}/restoreRestore from snapshot
DELETE/v1/snapshots/{id}Delete a snapshot

SDKs

Official SDKs provide a more convenient interface:

TypeScript/JavaScript

npm install @akiralabs/sandbox-sdk
import SandboxSDK from '@akiralabs/sandbox-sdk';
 
const client = new SandboxSDK({
  apiKey: process.env['AKIRA_API_KEY'],
});
 
const sandboxes = await client.sandboxes.list();

Interactive Reference

For detailed endpoint documentation with request/response schemas and a "Try It" console, see the API Reference.

Next Steps