Skip to content

API Overview

The Runra Sandbox REST API lets you programmatically create, manage, and execute code in secure cloud sandboxes. All API endpoints are served over HTTPS from the base URL.

https://api.box.runra.dev

All requests must use HTTPS. Plain HTTP requests will receive a 301 Moved Permanently redirect to the HTTPS endpoint.

The current API version is v1 and is specified as a path prefix:

https://api.box.runra.dev/v1

The version prefix is required on all requests. We follow semantic versioning for the API contract:

  • Minor additions (new fields, new endpoints) are backward-compatible and do not require a version bump.
  • Breaking changes (field removal, type change, endpoint deprecation) will ship under a new version prefix (/v2).
  • Deprecated endpoints receive a Deprecation: true response header and remain available for at least 90 days.

The current API version is also available via a lightweight status endpoint:

Terminal window
curl https://api.box.runra.dev/v1/health
{
"status": "ok",
"version": "v1",
"timestamp": "2026-06-15T10:30:00Z"
}

All endpoints require authentication via Bearer token:

Terminal window
curl -H "Authorization: Bearer $RUNRA_API_KEY" \
https://api.box.runra.dev/v1/sandboxes

See Authentication for details on obtaining and managing API keys.

All POST and PUT endpoints accept JSON bodies. You must set:

Content-Type: application/json

All responses are JSON with:

Content-Type: application/json; charset=utf-8

Successful responses return HTTP 2xx. The response envelope for collection endpoints includes pagination metadata:

{
"data": [...],
"pagination": {
"total": 42,
"limit": 20,
"offset": 0,
"hasMore": true
}
}

Single-resource endpoints return the resource directly:

{
"id": "sb_x7k2m9p4q1",
"state": "running",
"image": "node:22",
"createdAt": "2026-06-15T10:30:00Z"
}

All error responses use a consistent structure:

{
"error": {
"code": "SANDBOX_NOT_FOUND",
"message": "Sandbox sb_x7k2m9p4q1 not found",
"details": {
"sandboxId": "sb_x7k2m9p4q1"
},
"requestId": "req_a1b2c3d4"
}
}
HTTP StatusCodeDescription
400INVALID_REQUESTMalformed request body or query parameters
400INVALID_CONFIGConfiguration values out of allowed range
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENValid key but insufficient permissions
404SANDBOX_NOT_FOUNDSandbox does not exist or was terminated
409INVALID_STATEOperation not valid for current sandbox state
429RATE_LIMITEDToo many requests; see Retry-After header
500INTERNAL_ERRORUnexpected server error
503RESOURCE_EXHAUSTEDNo capacity available; try again later

Rate limits are applied per API key. The default limits are:

Endpoint GroupLimitWindow
Read endpoints (GET)300per minute
Write endpoints (POST, PUT, DELETE)60per minute
Sandbox creation (POST /v1/sandboxes)10per minute
Code execution (POST /v1/sandboxes/:id/execute)100per minute per sandbox

Rate limit headers are included on every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1718445600

When exceeded, the API returns 429 Too Many Requests with a Retry-After header indicating seconds to wait.

If you need higher limits, contact support@runra.dev.

Collection endpoints support cursor-based pagination:

ParameterTypeDefaultDescription
limitinteger20Number of items per page (max 100)
offsetinteger0Number of items to skip

POST endpoints that create resources support idempotency keys. Pass an Idempotency-Key header to safely retry requests:

Terminal window
curl -X POST https://api.box.runra.dev/v1/sandboxes \
-H "Authorization: Bearer $RUNRA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"image": "node:22"}'

Idempotency keys are valid for 24 hours. Repeated requests with the same key return the original response.

Every response includes an X-Request-Id header with a unique identifier for the request. Include this value when contacting support to help us debug issues.

All timestamps are in ISO 8601 format with UTC timezone:

2026-06-15T10:30:00.123Z