Create, execute, manage files, and tear down a sandbox.
curl -X POST https://api.sandbox.stateset.app/api/v1/register \
-H "Content-Type: application/json" \
-d '{"first_name": "Your", "last_name": "Name", "organization_name": "Company", "email": "[email protected]"}'
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/create \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"timeout_seconds": 300}'
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/execute \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "python3 -c \"print(Hello World!)\""}'
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/files/write \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "/workspace/hello.txt", "content": "SGVsbG8h", "encoding": "base64"}'
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/files/read \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "/workspace/hello.txt"}'
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/stop \
-H "Authorization: ApiKey YOUR_API_KEY"