This document describes the local API served by the de taartenfabriek web app.
http://127.0.0.1:8000
All HTTP API routes under /api/* require an API token via header:
X-Local-Token: <token>
The token is generated on first run and stored at:
~/.tartvm-manager/token
The WebSocket endpoint requires the token as a query parameter:
ws://127.0.0.1:8000/ws/tasks/<task_id>?token=<token>
- All responses are JSON unless otherwise noted.
- Errors are returned as JSON with a
detailfield (FastAPI default).
Returned by /api/vms and related endpoints.
Fields (current):
name: stringstatus:running | stopped | unknownip_address: string or nullsource: string or nullos: string or nullcpu: number or nullmemory: string or nulldisk_size: number or string or nulldisplay: string or null
Returned by /api/vms/{vm_name}/config.
Fields:
name: stringcpu: number or nullmemory: string or null (normalized; e.g.8G)disk_size: string or null (normalized; e.g.50G)raw: object (raw JSON fromtart get --format json)
Returned by start/stop/delete/pull/clone/create endpoints and /api/tasks/{task_id}.
Fields:
id: stringaction: stringstatus:pending | running | completed | failedcommand: array of strings or nullexit_code: number or nullresult: object or nullerror: string or nullstderr: string or nullcreated_at: unix timestamp (float)updated_at: unix timestamp (float)logs: array of strings
Returned by /api/vms/available-images.
Fields:
name: string (e.g.,macos-ventura-base)url: string (OCI URL, e.g.,ghcr.io/cirruslabs/macos-ventura-base:latest)description: string or nulltags: array of strings (available tags for the image)updated_at: string or null (ISO 8601 timestamp)
Returned by /api/vms/categorized.
Fields:
base_images: array of VM objects (OCI-pulled images)working_vms: array of VM objects (locally created/cloned VMs)
Returns server status and version.
Get GitHub token configuration status (without revealing the actual token).
Response:
{
"configured": true,
"masked_token": "ghp_...xyz"
}Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/settings/github-tokenSet or clear the GitHub API token.
Request body:
{
"token": "ghp_your_github_token_here"
}To clear the token, send an empty string:
{
"token": ""
}Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{"token":"ghp_your_token_here"}' \
http://127.0.0.1:8000/api/settings/github-tokenReturns the installed Tart version.
Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/tart/versionGet list of available Cirrus Labs macOS images from GitHub API.
Requires a GitHub personal access token to be configured (see Settings endpoints).
Returns an array of VMImageModel objects with available macOS images that can be pulled.
Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/vms/available-imagesGet VMs categorized as base images (OCI-pulled) vs working VMs (locally created/cloned).
Returns a VMImagesSummary object.
Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/vms/categorizedReturns the current cached inventory of VMs.
Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/vmsTriggers a full refresh from Tart (calls tart list and tart ip) and returns the refreshed VM list.
Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{}' \
http://127.0.0.1:8000/api/vms/refreshReturns a single VM (from cached inventory) by name.
Returns VM configuration details using tart get <name> --format json.
- Cached server-side in memory.
- Use
?force_refresh=trueto bypass cache.
Example:
curl -H "X-Local-Token: $TOKEN" \
"http://127.0.0.1:8000/api/vms/my-vm/config?force_refresh=true"These endpoints return a Task immediately. You can:
- Poll via
GET /api/tasks/{task_id} - Subscribe via WebSocket
GET /ws/tasks/{task_id}?token=...
Starts a VM.
Current behavior:
- Runs
tart run --vnc --no-graphics <vm_name>detached - Polls
tart ip <vm_name>and storesip_addressin the task result when available
Task result includes:
messageip_address(nullable)vnc_url(nullable;vnc://<ip>)
Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{}' \
http://127.0.0.1:8000/api/vms/my-vm/startStops a VM.
Current behavior:
- Runs
tart stop --timeout 30 <vm_name>with a fallback totart stop <vm_name>
Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{}' \
http://127.0.0.1:8000/api/vms/my-vm/stopDeletes a VM.
Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{}' \
http://127.0.0.1:8000/api/vms/my-vm/deletePulls a VM from an OCI registry.
Request body:
{ "oci_url": "ghcr.io/cirruslabs/macos-ventura-base:latest" }Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{"oci_url":"ghcr.io/cirruslabs/macos-ventura-base:latest"}' \
http://127.0.0.1:8000/api/vms/pullClone a VM and optionally start it with VNC.
Request body:
{
"new_name": "my-cloned-vm",
"start_after_clone": false
}Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{"new_name":"my-clone","start_after_clone":true}' \
http://127.0.0.1:8000/api/vms/base-image/cloneCreate a new VM by cloning a base image and configuring CPU/memory/disk.
Request body:
{
"name": "my-new-vm",
"source_vm": "ghcr.io/cirruslabs/macos-ventura-base:latest",
"cpu": 4,
"memory": 8,
"disk_size": 50
}Example:
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Local-Token: $TOKEN" \
-d '{"name":"dev-vm","source_vm":"ghcr.io/cirruslabs/macos-ventura-base:latest","cpu":4,"memory":8,"disk_size":50}' \
http://127.0.0.1:8000/api/vms/createReturns a list of all active (non-completed, non-failed) tasks.
Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/tasks/activeReturns the latest state of a task.
Example:
curl -H "X-Local-Token: $TOKEN" http://127.0.0.1:8000/api/tasks/<task_id>Streams task updates (JSON-serialized Task model). The server sends updates whenever task state/logs change.
Example:
- URL:
ws://127.0.0.1:8000/ws/tasks/<task_id>?token=<token>
- This application is designed to run locally on
127.0.0.1. - The UI is the primary consumer of the API.