Authenticate, create a sandbox, execute a command, and snapshot it with the current REST API. This quickstart follows the current api-server shape instead of the starter-kit examples.

1. Log In

curl -X POST https://api.agentenv.io/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "demo_user",
    "password": "change_me"
  }'
Save the returned accessToken, or use an API key through X-API-Key.

2. Create A Sandbox

POST /sandboxes is workspace-scoped and accepts top-level resource shortcuts such as image, cpuMillis, and memoryMb.
curl -X POST https://api.agentenv.io/v1/sandboxes \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "quickstart-sandbox",
    "workspaceId": "YOUR_WORKSPACE_ID",
    "image": "docker://python:3.11-slim",
    "cpuMillis": 1000,
    "memoryMb": 512
  }'

3. Inspect Or Update The Sandbox

curl -X GET https://api.agentenv.io/v1/sandboxes/SANDBOX_ID \
  -H "Authorization: Bearer $ACCESS_TOKEN"

4. Execute A Command

curl -X POST https://api.agentenv.io/v1/sandboxes/SANDBOX_ID/exec \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "python -c \"print(\\\"hello from AgentEnv\\\")\""
  }'

5. Capture A Snapshot

curl -X POST https://api.agentenv.io/v1/sandboxes/SANDBOX_ID/snapshots \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "quickstart-snapshot"
  }'

6. Continue With Resource Guides