# 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.dev`[OpenAPI 3.1](https://api.homemade.dev/openapi.json)

## Your first computer

Four requests, from a key to a command’s output.

1. ### 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"
   ```

2. ### Create a computer

   It starts from the project’s latest build of `main`. Pass `branch`, `size` or `name` to 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"
     }
   }
   ```

3. ### Wait until it runs

   Poll every few seconds until `vm.state` is `running`. Stop if it ends in `failed` or `stopped`.

   ```
   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; done
   ```

4. ### Run a command

   Runs in the project folder as the computer’s user and answers when it ends. Add `?stream=1` for 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/vms`Create a computer

GET`/api/vms`List computers

GET`/api/vms/{vmId}`Get one, with its services

POST`/api/vms/{vmId}/exec`Run a command

POST`/api/vms/{vmId}/sleep`Put it to sleep

POST`/api/vms/{vmId}/wake`Wake it

PATCH`/api/vms/{vmId}`Rename, auto-sleep, access

DELETE`/api/vms/{vmId}`Delete it

GET`/api/projects`List projects

GET`/api/me`Who the key belongs to

Make yourself at home.

## Product

- [Pricing](/pricing)
- [Integrations](/integrations)
- [CLI](/cli)
- [MCP](/mcp)
- [API](/api)

## Use cases

- [Claude Code in the cloud](/claude-code-in-the-cloud)
- [Codex in the cloud](/codex-in-the-cloud)
- [AI agent sandbox](/ai-agent-sandbox)
- [Cloud dev environment](/cloud-dev-environment)
- [Preview environments](/preview-environments)

## Compare

- [All comparisons](/compare)

## Resources

- [Docs](https://docs.homemade.dev)
- [Blog](/blog)
- [llms.txt](https://docs.homemade.dev/llms.txt)

## Company

- [Contact](mailto:hello@homemade.dev)
- [GitHub](https://github.com/usehomemade/homemade)

## Legal

- [Impressum](/impressum)
- [Terms](/terms)
- [Privacy](/privacy)

© 2026 homemade.dev

---

Canonical: https://www.homemade.dev/api
More pages: https://www.homemade.dev/llms.txt
