Skip to main content

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
}'
ParameterTypeDescription
imagestringContainer image
memory_mbnumberMemory limit
disk_mbnumberDisk limit
cpu_coresnumberCPU cores
timeout_secsnumberSession timeout
input_mountsobject[]Read-only input data
output_mountsobject[]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

MethodEndpointDescription
POST/shell/fs/readRead a file
POST/shell/fs/writeWrite a file
POST/shell/fs/listList directory
POST/shell/fs/treeDirectory tree
POST/shell/fs/searchSearch files
POST/shell/fs/infoFile info
POST/shell/fs/deleteDelete file/dir
POST/shell/fs/copyCopy file/dir
POST/shell/fs/moveMove file/dir
POST/shell/fs/mkdirCreate 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"