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.aiAPI Version
The current API version is v1. All endpoints are prefixed with /v1/.
https://api.akiralabs.ai/v1/sandboxes/listAuthentication
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
| Code | Description |
|---|---|
200 | Success |
201 | Resource created |
400 | Bad request - invalid parameters |
401 | Unauthorized - invalid or missing API key |
403 | Forbidden - insufficient permissions |
404 | Resource not found |
429 | Rate limit exceeded |
500 | Internal server error |
Rate Limits
API requests are rate limited per API key:
| Tier | Requests/minute | Concurrent sandboxes |
|---|---|---|
| Beta | 60 | 10 |
| Pro | 300 | 50 |
| Enterprise | Custom | Custom |
When rate limited, you'll receive a 429 response with a Retry-After header.
Endpoint Overview
Sandboxes
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/sandboxes/create | Create a new sandbox |
GET | /v1/sandboxes/list | List running sandboxes |
DELETE | /v1/sandboxes/{id}/delete | Delete a sandbox |
DELETE | /v1/sandboxes/delete-all | Delete all sandboxes |
POST | /v1/sandboxes/{id}/execute | Execute a command |
POST | /v1/sandboxes/{id}/execute_async | Stream command execution |
POST | /v1/sandboxes/{id}/upload | Upload a file |
GET | /v1/sandboxes/{id}/download | Download a file |
GET | /v1/sandboxes/{id}/status | Get resource usage |
Snapshots
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/sandboxes/{id}/snapshot | Create a snapshot |
POST | /v1/sandboxes/{id}/clone | Clone a sandbox |
GET | /v1/snapshots/list | List snapshots |
POST | /v1/snapshots/{id}/restore | Restore from snapshot |
DELETE | /v1/snapshots/{id} | Delete a snapshot |
SDKs
Official SDKs provide a more convenient interface:
TypeScript/JavaScript
npm install @akiralabs/sandbox-sdkimport 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
- Authentication - Get your API key
- API Reference - Interactive documentation
- Quickstart - Create your first sandbox