Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions advanced/nested-containers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ voidrun exec <sandbox-id> --command "docker info --format '{{.ServerVersion}}'"

```bash cURL
# Create sandbox
curl -X POST "https://platform.void-run.com/api/sandboxes" \
curl -X POST "https://api.void-run.com/api/sandboxes" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "docker-sandbox", "image": "docker-lite", "cpu": 4, "mem": 4096}'

# Verify Docker is running
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "docker --version"}'
Expand Down Expand Up @@ -160,7 +160,7 @@ voidrun exec <sandbox-id> --command "curl -s http://localhost:80"
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "docker run -d --name nginx -p 80:80 nginx:latest"}'
Expand Down Expand Up @@ -240,7 +240,7 @@ voidrun exec <sandbox-id> --command "docker ps"
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "docker network create app-network && docker run -d --name postgres --network app-network -e POSTGRES_PASSWORD=secret postgres:15"}'
Expand Down Expand Up @@ -335,7 +335,7 @@ voidrun exec <sandbox-id> --command "kubectl get nodes"

```bash cURL
# Install K3s
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "curl -sfL https://get.k3s.io | sh -", "timeout": 120}'
Expand Down Expand Up @@ -412,7 +412,7 @@ voidrun exec <sandbox-id> --command "kubectl get pods -o wide"
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "kubectl create deployment nginx --image=nginx:latest"}'
Expand Down Expand Up @@ -492,7 +492,7 @@ voidrun exec <sandbox-id> --command "df -h"
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "free -h && df -h"}'
Expand Down Expand Up @@ -552,7 +552,7 @@ voidrun exec <sandbox-id> --command "docker image prune -af && docker volume pru
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "docker stop $(docker ps -aq) 2>/dev/null; docker rm $(docker ps -aq) 2>/dev/null; docker image prune -af"}'
Expand Down
2 changes: 1 addition & 1 deletion advanced/self-hosted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: How private or self-managed API endpoints relate to the public docs

# Self-hosted deployments

This documentation site targets the **hosted VoidRun platform** base URL exemplified in guides (**`https://platform.void-run.com/api`**) and the **OpenAPI** description bundled at **`docs/openapi/voidrun.yml`**.
This documentation site targets the **hosted VoidRun platform** base URL exemplified in guides (**`https://api.void-run.com/api`**) and the **OpenAPI** description bundled at **`docs/openapi/voidrun.yml`**.

## What may differ on your deployment

Expand Down
18 changes: 9 additions & 9 deletions advanced/ssh-vnc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ voidrun get <sandbox-id>

```bash cURL
# Create a sandbox
curl -X POST "https://platform.void-run.com/api/sandboxes" \
curl -X POST "https://api.void-run.com/api/sandboxes" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "ssh-demo", "cpu": 2, "mem": 2048}'

# TODO: Verify exact endpoint for SSH credentials
# Example expected endpoint:
# curl -X GET "https://platform.void-run.com/api/sandboxes/<sandbox-id>/ssh" \
# curl -X GET "https://api.void-run.com/api/sandboxes/<sandbox-id>/ssh" \
# -H "X-API-Key: $VR_API_KEY"
```
</CodeGroup>
Expand Down Expand Up @@ -328,7 +328,7 @@ voidrun exec <sandbox-id> --command "vncserver -list"
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "sudo apt-get update && sudo apt-get install -y xfce4 xfce4-goodies tightvncserver"}'
Expand Down Expand Up @@ -400,7 +400,7 @@ voidrun get <sandbox-id>
```bash cURL
# TODO: Verify exact endpoint for VNC configuration
# Example expected endpoint:
# curl -X GET "https://platform.void-run.com/api/sandboxes/<sandbox-id>/vnc" \
# curl -X GET "https://api.void-run.com/api/sandboxes/<sandbox-id>/vnc" \
# -H "X-API-Key: $VR_API_KEY"
```
</CodeGroup>
Expand Down Expand Up @@ -487,7 +487,7 @@ voidrun exec <sandbox-id> --command "websockify --web=/usr/share/novnc/ 6080 loc
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "sudo apt-get install -y novnc websockify && websockify --web=/usr/share/novnc/ 6080 localhost:5901 &"}'
Expand Down Expand Up @@ -589,7 +589,7 @@ voidrun download <sandbox-id> /tmp/screenshot.png ./screenshot.png
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "sudo apt-get install -y chromium-browser && pip install selenium"}'
Expand Down Expand Up @@ -664,7 +664,7 @@ voidrun exec <sandbox-id> --command "while true; do sleep 60; done &"

```bash cURL
# Wake sandbox
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/wake" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/wake" \
-H "X-API-Key: $VR_API_KEY"
```
</CodeGroup>
Expand Down Expand Up @@ -713,11 +713,11 @@ voidrun wake <sandbox-id>

```bash cURL
# Check sandbox status
curl -X GET "https://platform.void-run.com/api/sandboxes/<sandbox-id>" \
curl -X GET "https://api.void-run.com/api/sandboxes/<sandbox-id>" \
-H "X-API-Key: $VR_API_KEY"

# Wake if snapshotted
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/wake" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/wake" \
-H "X-API-Key: $VR_API_KEY"
```
</CodeGroup>
Expand Down
18 changes: 9 additions & 9 deletions core-concepts/background-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For a full comparison with sync **`exec`**, streaming, PTY, and **`runCode`**, s

## REST endpoints

All routes are under **`/sandboxes/{id}/commands/`** (prefix with your API base, e.g. **`https://platform.void-run.com/api`**). Authenticate with **`X-API-Key`**.
All routes are under **`/sandboxes/{id}/commands/`** (prefix with your API base, e.g. **`https://api.void-run.com/api`**). Authenticate with **`X-API-Key`**.

| Method | Path | Role |
|--------|------|------|
Expand Down Expand Up @@ -113,7 +113,7 @@ voidrun bg run <sandbox-id> --command 'npm run dev' --cwd /app
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/run" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/run" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
Expand Down Expand Up @@ -154,7 +154,7 @@ voidrun bg list <sandbox-id>
```

```bash cURL
curl -X GET "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/list" \
curl -X GET "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/list" \
-H "X-API-Key: $VR_API_KEY"
```
</CodeGroup>
Expand Down Expand Up @@ -199,7 +199,7 @@ voidrun bg wait <sandbox-id> --pid <pid>

```bash cURL
# Replace 12345 with the PID from commands/run
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/wait" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/wait" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pid": 12345}'
Expand Down Expand Up @@ -261,7 +261,7 @@ voidrun bg run <sandbox-id> --command 'echo use SDK or cURL for attach'

```bash cURL
# Replace 12345 with the PID from commands/run
curl -N -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/attach" \
curl -N -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/attach" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
Expand Down Expand Up @@ -299,7 +299,7 @@ voidrun bg kill <sandbox-id> --pid <pid>

```bash cURL
# Replace 12345 with the PID from commands/run
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/kill" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/kill" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pid": 12345}'
Expand Down Expand Up @@ -358,15 +358,15 @@ voidrun bg wait <sandbox-id> --pid <pid>
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/run" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/run" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "npm run dev", "cwd": "/app", "timeout": 0}'

curl -X GET "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/list" \
curl -X GET "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/list" \
-H "X-API-Key: $VR_API_KEY"

curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/wait" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/wait" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pid": 12345}'
Expand Down
28 changes: 14 additions & 14 deletions core-concepts/code-execution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ voidrun exec <sandbox-id> --command 'echo "Hello, VoidRun!" && pwd'

```bash cURL
# Create sandbox
curl -X POST "https://platform.void-run.com/api/sandboxes" \
curl -X POST "https://api.void-run.com/api/sandboxes" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cpu": 2, "mem": 2048}'

# Execute command (replace <sandbox-id>)
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "echo \"Hello, VoidRun!\" && pwd"}'
Expand Down Expand Up @@ -168,7 +168,7 @@ voidrun exec <sandbox-id> --command 'python3 /app/script.py'
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "python3 -c \"print(2 + 2)\""}'
Expand Down Expand Up @@ -233,7 +233,7 @@ voidrun exec <sandbox-id> --command 'node /app/script.js'
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "node -e \"console.log(2 + 2)\""}'
Expand Down Expand Up @@ -295,7 +295,7 @@ voidrun exec <sandbox-id> --command 'echo "Hostname: $(hostname)" && date && upt
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "echo \"Hostname: $(hostname)\" && date"}'
Expand Down Expand Up @@ -360,7 +360,7 @@ voidrun exec <sandbox-id> --command 'ls -la /nonexistent'

```bash cURL
# Response includes stdout, stderr, and exitCode
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "ls -la /nonexistent"}'
Expand Down Expand Up @@ -430,7 +430,7 @@ voidrun exec <sandbox-id> --command 'python3 -c "import json; print(json.dumps({
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "python3 -c \"import json; print(json.dumps({\\\"name\\\": \\\"VoidRun\\\"}))\""}'
Expand Down Expand Up @@ -491,7 +491,7 @@ voidrun exec <sandbox-id> --command 'for i in {1..10}; do echo "Count: $i"; slee

```bash cURL
# Use the exec-stream endpoint for SSE streaming
curl -N "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec-stream" \
curl -N "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec-stream" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "for i in {1..10}; do echo \"Count: $i\"; sleep 1; done"}'
Expand Down Expand Up @@ -555,7 +555,7 @@ voidrun exec <sandbox-id> --command 'sleep 30 && echo "Done"' --timeout 60
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "sleep 30 && echo \"Done\"", "timeout": 60}'
Expand Down Expand Up @@ -603,7 +603,7 @@ voidrun exec <sandbox-id> --command 'pwd && ls -la' --cwd /app/src
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "pwd && ls -la", "cwd": "/app/src"}'
Expand Down Expand Up @@ -657,7 +657,7 @@ voidrun exec <sandbox-id> --command 'API_KEY=secret DEBUG=true && echo "API Key:
```

```bash cURL
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
Expand Down Expand Up @@ -734,13 +734,13 @@ voidrun bg kill <sandbox-id> --pid <pid>

```bash cURL
# Start background process
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/run" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/run" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "npm run dev", "cwd": "/app", "timeout": 0}'

# List processes
curl -X GET "https://platform.void-run.com/api/sandboxes/<sandbox-id>/commands/list" \
curl -X GET "https://api.void-run.com/api/sandboxes/<sandbox-id>/commands/list" \
-H "X-API-Key: $VR_API_KEY"
```
</CodeGroup>
Expand Down Expand Up @@ -806,7 +806,7 @@ voidrun exec <sandbox-id> --command 'some-command'

```bash cURL
# Check response for exitCode field
curl -X POST "https://platform.void-run.com/api/sandboxes/<sandbox-id>/exec" \
curl -X POST "https://api.void-run.com/api/sandboxes/<sandbox-id>/exec" \
-H "X-API-Key: $VR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command": "some-command"}'
Expand Down
Loading