Shells
Coming Soon
Shells are currently in preview. The API is available but may change.
Create AI sandboxes on the fly. Shells give you container-based execution environments with filesystem access, streaming output, and artifact capture -- perfect for running code, processing data, and building AI agent workflows.
Create a shell session
curl -X POST https://api.browsr.dev/shell/sessions \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"memory_mb": 512,
"cpu_cores": 1,
"timeout_secs": 300
}'
| Parameter | Type | Description |
|---|---|---|
image | string | Container image |
memory_mb | number | Memory limit |
disk_mb | number | Disk limit |
cpu_cores | number | CPU cores |
timeout_secs | number | Session timeout |
input_mounts | object[] | Read-only input data |
output_mounts | object[] | Output directories to capture |
Execute a command
curl -X POST https://api.browsr.dev/shell/exec \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "shell-abc123",
"command": "ls -la /workspace",
"timeout_secs": 30
}'
{
"stdout": "total 8\ndrwxr-xr-x 2 root root 4096 ...",
"stderr": "",
"exit_code": 0,
"duration_ms": 45,
"timed_out": false
}
Streaming execution
Stream stdout/stderr in real-time:
curl -X POST https://api.browsr.dev/shell/exec/stream \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session_id": "shell-abc123", "command": "pip install pandas && python script.py"}'
Filesystem operations
| Method | Endpoint | Description |
|---|---|---|
POST | /shell/fs/read | Read a file |
POST | /shell/fs/write | Write a file |
POST | /shell/fs/list | List directory |
POST | /shell/fs/tree | Directory tree |
POST | /shell/fs/search | Search files |
POST | /shell/fs/info | File info |
POST | /shell/fs/delete | Delete file/dir |
POST | /shell/fs/copy | Copy file/dir |
POST | /shell/fs/move | Move file/dir |
POST | /shell/fs/mkdir | Create directory |
Artifacts
Output mounts are automatically captured as artifacts after execution.
# List artifacts for a session
curl https://api.browsr.dev/shell/artifacts/by-session/shell-abc123 \
-H "Authorization: Bearer $BROWSR_API_KEY"
# Download an artifact file
curl https://api.browsr.dev/shell/artifacts/ARTIFACT_ID/files/output.csv \
-H "Authorization: Bearer $BROWSR_API_KEY"
List / delete sessions
# List
curl https://api.browsr.dev/shell/sessions \
-H "Authorization: Bearer $BROWSR_API_KEY"
# Delete
curl -X DELETE https://api.browsr.dev/shell/sessions/shell-abc123 \
-H "Authorization: Bearer $BROWSR_API_KEY"