Drive it from your agent

The same actions the app takes are an HTTP API, so an agent can create a machine, pause it, and read its balance on its own.


The idea

An agent that can call the API can manage its own workspace, spin up a machine for a job, pause it when the job is done, and watch the balance so it does not strand work. Every call is one your own session is allowed to make; there is no separate automation tier.

Set the origin

Point the calls at your deployment and carry the session cookie. Set it once in the shell the agent runs in.

ORIGIN=https://your-domain.example

Create and pause

# create a 4 vCPU machine (starts paused, so it is free until resumed)
curl -b jar.txt -X POST $ORIGIN/api/machines \
  -H 'Content-Type: application/json' \
  -d '{"name":"cubs-quiet-harbor","vcpus":4}'

# pause it when the job is done
curl -b jar.txt -X POST $ORIGIN/api/machines/{id}/pause

The API reference lists every endpoint with real request and response bodies, and Recipes walks the full flow from sign-in to top-up.