Skip to content

REST API ​

Base URL: https://api.ai2in.dev. Authenticate with a bearer API key:

Authorization: Bearer ai2in_live_…

The SDKs and CLI wrap this API — reach for it directly for languages without an SDK, or for server-to-server calls.

Sandboxes ​

MethodPathDescription
POST/v1/sandboxesCreate a sandbox. Body: { image?, desktop?, env? }.
GET/v1/sandboxesList sandboxes on this node.
POST/v1/sandboxes/:id/runRun code. Body: { code }. Returns an Execution.
POST/v1/sandboxes/:id/run/streamSame, as an SSE stream of events.
GET/v1/sandboxes/:idSandbox info: status, end_at, node_id.
POST/v1/sandboxes/:id/timeoutSet hard lifetime. Body: { timeout_ms } (max 24h).
POST/v1/sandboxes/:id/pausePause.
POST/v1/sandboxes/:id/resumeResume.
GET/v1/sandboxes/:id/metricsLive resource metrics.
POST/v1/sandboxes/:id/exposePublic URL for a port. Body: { port }.
DELETE/v1/sandboxes/:idDestroy the sandbox.

Shell & filesystem ​

MethodPathBody
POST/v1/sandboxes/:id/shell{ cmd }
POST/v1/sandboxes/:id/fs/list{ path }
POST/v1/sandboxes/:id/fs/read{ path }
POST/v1/sandboxes/:id/fs/write{ path, content }
POST/v1/sandboxes/:id/fs/read_bytes{ path } → { content_b64, size } (≤32MB)
POST/v1/sandboxes/:id/fs/write_bytes{ path, content_b64 } (≤32MB)
POST/v1/sandboxes/:id/fs/watch{ path, recursive } → { watch_id }
POST/v1/sandboxes/:id/fs/watch/:wid/poll→ { events }
POST/v1/sandboxes/:id/fs/watch/:wid/stop—

Commands (background) ​

MethodPathBody
POST/v1/sandboxes/:id/commands{ cmd } → { command_id, pid }
GET/v1/sandboxes/:id/commands→ { commands: [...] }
POST/v1/sandboxes/:id/commands/:cid/logs→ { stdout, stderr, status, exit_code }
POST/v1/sandboxes/:id/commands/:cid/kill—

PTY (interactive terminal) ​

MethodPathBody
POST/v1/sandboxes/:id/pty{ cmd?, cols?, rows?, cwd?, env? } → { pty_id, pid }
POST/v1/sandboxes/:id/pty/:pid/input{ data_b64 }
POST/v1/sandboxes/:id/pty/:pid/output→ { data_b64, alive, exit_code } (drains buffer)
POST/v1/sandboxes/:id/pty/:pid/resize{ cols, rows }
POST/v1/sandboxes/:id/pty/:pid/kill—

Databases ​

MethodPathBody
POST/v1/databases{ engine, version?, name? } → { …, url }
DELETE/v1/databases/:id—

Hosting ​

MethodPathBody
POST/v1/hosting/services{ name, image, internal_port?, env?, start_cmd? }
POST/v1/hosting/services/:id/logs—
POST/v1/hosting/services/:id/redeploy—
POST/v1/hosting/services/:id/stop—
DELETE/v1/hosting/services/:id—

Errors ​

Standard HTTP status codes. 401 unauthenticated, 403 missing scope, 404 not found, 409 sandbox paused, 429 quota exceeded, 503 node at capacity. Bodies are { "error": "…" }.

Sovereign compute for Indian AI — hosted in Mumbai (ap-south-1).