# Agent as a Service — AI Agents in Sandy Sandboxes Run hardened AI agents from hardened Linux sandboxes via a REST API. ## Base URL https://agent-as-a-service.online/api ## Authentication Authorization: Bearer YOUR_AGENT_API_KEY Get API keys from `/account` and copy once at creation. ## Quick Start 1. Create a sandbox: ```bash curl -X POST https://agent-as-a-service.online/api/sandboxes \ -H "Authorization: Bearer YOUR_AGENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"persistent": false}' ``` Response returns `{ "id": "...", "status": "running" }`. 2. Launch an agent: ```bash curl -X POST https://agent-as-a-service.online/api/sandboxes//agent/run \ -H "Authorization: Bearer YOUR_AGENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"agent": "claude-code", "prompt": "Build a simple REST endpoint", "model": "auto"}' ``` The endpoint streams SSE events with `event: status`, `event: output`, and `event: complete`. 3. Read a file: ```bash curl -X GET "https://agent-as-a-service.online/api/sandboxes//files/read?path=/workspace/out.txt" \ -H "Authorization: Bearer YOUR_AGENT_API_KEY" ``` 4. Write a file: ```bash curl -X POST https://agent-as-a-service.online/api/sandboxes//files/write \ -H "Authorization: Bearer YOUR_AGENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"path":"/workspace/out.txt","content":"hello"}' ``` 5. Terminate when finished: ```bash curl -X POST https://agent-as-a-service.online/api/sandboxes//terminate \ -H "Authorization: Bearer YOUR_AGENT_API_KEY" ``` ## Supported Endpoints - GET `/health` - POST `/sandboxes` / GET `/sandboxes` / GET `/sandboxes/{id}` - POST `/sandboxes/{id}/exec` - POST `/sandboxes/{id}/agent/run` - POST `/sandboxes/{id}/agent/cancel` - GET `/sandboxes/{id}/files` / read / write - GET `/sandboxes/{id}/vnc` - GET `/openapi.json` and `/openapi.yaml` ## Supported Agents claude-code, codex, aider, openhands, factory-droid ## Notes - Keep secrets in session-scoped server settings only; never expose raw model keys in public logs. - Use concise prompts and cancel long-running tasks with `/agent/cancel`.