API
Create computers, run commands in them, put them to sleep and delete them, from any language that can send an HTTP request. JSON in, JSON out.
https://api.homemade.devOpenAPI 3.1Your first computer
Four requests, from a key to a command’s output.
Authenticate
Create a key under Account → API keys, or with
homemade api-key create. It is shown once. Send it as a bearer token.export HOMEMADE_API_KEY=hmk_…curl https://api.homemade.dev/api/me \ -H "Authorization: Bearer $HOMEMADE_API_KEY"Create a computer
It starts from the project’s latest build of
main. Passbranch,sizeornameto choose. The answer comes at once, while it starts.curl -X POST https://api.homemade.dev/api/vms \ -H "Authorization: Bearer $HOMEMADE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"projectId": "k3v9q2m7x1d8r4tp"}'Response{ "vm": { "name": "misty-fern-142", "branch": "main", "state": "queued" }}Wait until it runs
Poll every few seconds until
vm.stateisrunning. Stop if it ends infailedorstopped.until [ "$(curl -s https://api.homemade.dev/api/vms/$VM_ID \ -H "Authorization: Bearer $HOMEMADE_API_KEY" \ | jq -r '.vm.state')" = running ]; do sleep 2; doneRun a command
Runs in the project folder as the computer’s user and answers when it ends. Add
?stream=1for anything that runs longer than a minute.curl -X POST https://api.homemade.dev/api/vms/$VM_ID/exec \ -H "Authorization: Bearer $HOMEMADE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command": "node --version && git log -1 --oneline"}'Response{ "exitCode": 0, "stdout": "v26.13.1\n3f9c2e1 Add checkout page\n", "stderr": "", "durationMs": 41, "timedOut": false}
Endpoints
The most used ones. Errors come back as a status and a JSON error a person can read.
POST
/api/vmsCreate a computerGET
/api/vmsList computersGET
/api/vms/{vmId}Get one, with its servicesPOST
/api/vms/{vmId}/execRun a commandPOST
/api/vms/{vmId}/sleepPut it to sleepPOST
/api/vms/{vmId}/wakeWake itPATCH
/api/vms/{vmId}Rename, auto-sleep, accessDELETE
/api/vms/{vmId}Delete itGET
/api/projectsList projectsGET
/api/meWho the key belongs to