Skip to main content
The Computers API lets you create cloud computers and browsers from code, on demand, for your own users and agents. Two resources, one sentence: computers run your code; browsers browse; a browser can optionally run on one of your computers. All endpoints live on https://api.kazzle.app and accept a kzl_ API key in the Authorization header. See API keys for how to create one. The examples below read the key from the KAZZLE_API_KEY environment variable:
Running computers and browsers bill per minute against your space credits. Creates and wakes fail when the space is out of credits. See Billing.

Create a computer

The state is the connection state: offline right after create, online once the computer is up. The computer boots with a persistent disk. Files, installed packages, and tools survive stop and wake. GET /computers lists the computers in your space; all list endpoints return { "items": [...], "total": n }.

Wake it

An idle computer suspends. Wake it before use; wakes resume from a snapshot and take seconds.

Run a command

POST /exec runs one command and streams the result as server-sent events: stdout with the output, then exit with the exit code. Output from stderr arrives merged into the stdout events. Use curl -N to keep the stream open.
Optional body fields tune the run: cwd, shell, env, and timeout_ms (the command is killed when it elapses). All request and response fields across the API are snake_case. For long-running processes (dev servers, watchers) use /terminals instead: POST /computers/{id}/terminals opens a PTY session and returns its session_id for the write, read, ctrl, wait, and kill endpoints. See the API Reference for terminal and desktop endpoints.

Read and write files

Reads are capped at 2 MB. Binary files come back base64 with an "encoding": "base64" field. /fs also supports delete, move and copy (body {"from": "...", "to": "..."}), grep (returns {"matches": [...]}), and glob (returns {"files": [...]}).

Open a browser

Browsers are their own resource, not tied to a computer count. One computer can use many browsers; a hundred computers can share none.
Create returns the browser, its first tab, and a live_view_url you can open to watch it:
GET /browsers/{id} returns the same state and live_view_url again later. Get the profile with POST /browsers/profiles: it ensures the profile rather than creating a new one each time. It creates the profile only if missing, returns "created": false when it already exists, and today keeps one durable profile per browser backend. Profiles outlive browser sessions and are shared across them.

Drive a tab

Actions are tab-scoped. Navigate, then screenshot:
Tabs support around 40 actions: click, type, eval, and more. POST /browsers/{id}/tabs opens another tab and returns its id as the top-level tab_id. The full list is in the API Reference.

Destroy

Close the browser when you are done browsing. Destroy the computer to stop billing and delete its disk; this is permanent.
Prefer POST /computers/{id}/stop if you want the files back later; stopped computers keep their disk and wake in seconds.

A computer per user, driven by an agent

Everything above is one curl per call. In code, the typed kazzle client wraps the same endpoints: npm install kazzle, then new Kazzle() reads KAZZLE_API_KEY from the environment. Inside a deployed Kazzle app, import it as @kazzle/app/sdk instead; the key is injected there and scopes every call to the app’s space. Give each of your users their own cloud computer, keep its id on their record, and let an agent drive it with tools that call the client. The loop below hands the model two tools, run_command and browse, and runs until the model stops asking for tool calls.
kazzle.browsers.create() with no computerId opens a stealth cloud browser for the real web instead of the browser on that computer. Reuse a saved profile with create({ profileId }) so logins persist between runs.

Endpoints

See also