> ## Documentation Index
> Fetch the complete documentation index at: https://docs.styne.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API v1

> The v1 API is served at https://api.styne.ai/v1. This reference is generated from the OpenAPI document the API itself serves at /v1/openapi.json, so it always lists exactly the operations that exist.

Every call takes `Authorization: Bearer <key>`, answers `snake_case` JSON, and fails with one error body: `{"error": {"code", "status", "message", "request_id"}}`. Lists answer `{"data", "next_cursor", "has_more"}` and take `limit` and `cursor`. Every answer carries `x-request-id` and the `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers.

## Account

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/usage` | Usage over a window grouped by product, key, project | |
| `GET` | `/v1/balance` | Dollar balance | |
| `GET` | `/v1/limits` | Plan limits and current use | |
| `GET` | `/v1/budgets` | Budgets | |
| `PUT` | `/v1/budgets` | Set a budget for account, project or key | |
| `DELETE` | `/v1/budgets/{budget}` | Remove a budget | |
| `GET` | `/v1/metrics` | Prometheus text for the account | |
| `GET` | `/v1/plans` | Plans (Trial, Starter, Pro, Scale) with limits and overage | |
| `GET` | `/v1/subscription` | Current plan and period | |
| `GET` | `/v1/invoices` | Invoices | |
| `GET` | `/v1/otel` | OpenTelemetry export | |
| `PUT` | `/v1/otel` | Set the OTLP/HTTP collector | |
| `DELETE` | `/v1/otel` | Remove the export | |
| `GET` | `/v1/data-retention` | Retention switches | |
| `PUT` | `/v1/data-retention` | Change retention switches | |
| `POST` | `/v1/data-retention/deletions` | Delete every VM and snapshot of the account | |
| `GET` | `/v1/data-retention/deletions/{deletion}` | One deletion operation | |
| `POST` | `/v1/data-retention/close-account` | Delete all data then close the account | |
| `POST` | `/v1/tickets` | Mint a single-use WebSocket ticket (pty, live view, CDP) | |
| `GET` | `/v1/events` | Account event stream (SSE): vm.*, browser.*, usage.\* | |
| `GET` | `/v1/health` | Liveness (no auth) | |

## Browsers

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/browsers` | Start a Chromium session; returns cdp\_url and live\_view\_url | |
| `GET` | `/v1/browsers` | List browser sessions | |
| `GET` | `/v1/browsers/concurrency` | Limit (null when the account has no ceiling), running and free slots | |
| `GET` | `/v1/browsers/{br}` | Read a session and its CDP endpoint | |
| `DELETE` | `/v1/browsers/{br}` | Stop a session | |
| `GET` | `/v1/browsers/{br}/control` | Who holds input, with audit | |
| `POST` | `/v1/browsers/{br}/control` | Take control as a person; agent input pauses | |
| `DELETE` | `/v1/browsers/{br}/control` | Return input to the agent | |
| `GET` | `/v1/browsers/{br}/trace` | Timeline: navigations, actions, console | |
| `GET` | `/v1/browsers/{br}/network` | Requests with status, type, size, timing | |
| `GET` | `/v1/browsers/{br}/console` | Console lines and browser log entries | |
| `GET` | `/v1/browsers/{br}/replay` | Replay frames | |
| `GET` | `/v1/browsers/{br}/metrics` | CPU, memory, requests in flight | |
| `GET` | `/v1/browsers/{br}/files` | Read a file of the session's VM, such as a download (`?path=`) | |
| `GET` | `/v1/browsers/{br}/files/list` | List a folder of the session's VM, such as `/home/browser/Downloads` (`?path=`) | |
| `POST` | `/v1/browsers/{br}/checkpoints` | Checkpoint the session | |
| `GET` | `/v1/browsers/{br}/checkpoints` | Browser checkpoint timeline | |
| `POST` | `/v1/browsers/{br}/rewind` | Rewind the session | |
| `POST` | `/v1/browsers/{br}/fork` | Fork the session | |
| `POST` | `/v1/browsers/{br}/pause` | Sleep the session at \$0 | |
| `POST` | `/v1/browsers/{br}/resume` | Resume the session | |
| `GET` | `/v1/browsers/{br}/unblock` | The session's unblock mode and what each step of the block chain did (blocks seen, retried, passed, served by the unblocking service, which step cleared the last block) | |
| `GET` | `/v1/browsers/{br}/captcha` | The session's captcha mode and what its challenge watcher did (widgets clicked and passed, challenges solved, failed solves, the latest error) | |
| `POST` | `/v1/browsers/{br}/steps` | Record a step and check that the page shows what you expect | |
| `GET` | `/v1/browsers/{br}/steps` | List the session's steps and whether the run is verified | |
| `GET` | `/v1/browsers/{br}/steps/{n}` | Read one step with the page's HTML and the resources it loaded | |
| `GET` | `/v1/browsers/{br}/steps/{n}/screenshot` | The step's screenshot as a JPEG | |

## Checkpoints

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/vms/{vm}/checkpoints` | Checkpoint the running VM as the next timeline step | |
| `GET` | `/v1/vms/{vm}/checkpoints` | Timeline, oldest first | |
| `POST` | `/v1/vms/{vm}/rewind` | Rewind to a checkpoint; keeps both histories | |

## Commands

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/vms/{vm}/commands` | Run a command to exit, start it detached, or stream it | |
| `GET` | `/v1/vms/{vm}/commands` | Command history, newest first | |
| `GET` | `/v1/vms/{vm}/commands/{cmd}` | Status and exit code of a command | |
| `DELETE` | `/v1/vms/{vm}/commands/{cmd}` | Send a signal (default TERM) to a running command | |
| `GET` | `/v1/vms/{vm}/commands/{cmd}/stream` | Replay and follow output (SSE, resumable with Last-Event-ID) | |
| `GET` | `/v1/vms/{vm}/commands/{cmd}/logs` | stdout and stderr, also after exit | |
| `POST` | `/v1/vms/{vm}/commands/{cmd}/input` | Write text to a running command's stdin (data), and close it with eof; 409 when the command ended | |
| `POST` | `/v1/vms/{vm}/code` | Run code in a kernel context; answers the output, results and error of the run | |

## Extensions

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/extensions` | Upload a Chrome extension (zip of an unpacked extension, at most 50 MB) | |
| `GET` | `/v1/extensions` | List the account's extensions | |
| `GET` | `/v1/extensions/{ext}` | Read an extension | |
| `DELETE` | `/v1/extensions/{ext}` | Delete an extension; sessions that loaded it keep it until they end | |

## Files

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/vms/{vm}/files` | Read a file: the bytes of the file at the path query | |
| `PUT` | `/v1/vms/{vm}/files` | Write a file: the request body is the file's bytes; folders on the way are created | |
| `DELETE` | `/v1/vms/{vm}/files` | Delete a file or folder; answers 204 | |
| `GET` | `/v1/vms/{vm}/files/list` | List a directory | |
| `POST` | `/v1/vms/{vm}/files/search` | Find files by name under a path | |
| `POST` | `/v1/vms/{vm}/files/find` | Find text in files under a path | |
| `POST` | `/v1/vms/{vm}/files/replace` | Replace text across files | |
| `POST` | `/v1/vms/{vm}/files/permissions` | Set mode, owner and group | |
| `POST` | `/v1/vms/{vm}/files/signed-url` | Short-lived upload or download URL | |

## Keys

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/keys` | Create a key; secret shown once | |
| `GET` | `/v1/keys` | List keys | |
| `GET` | `/v1/keys/{key}` | Read a key (never the secret) | |
| `PATCH` | `/v1/keys/{key}` | Rename, change preset or scopes | |
| `DELETE` | `/v1/keys/{key}` | Revoke a key | |
| `GET` | `/v1/keys/{key}/scopes` | What the key may do | |
| `PUT` | `/v1/keys/{key}/scopes` | Set scopes or a preset | |

## Ports

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/vms/{vm}/ports` | Exposed ports with URLs | |
| `POST` | `/v1/vms/{vm}/ports` | Expose a port, public or token-protected | |
| `DELETE` | `/v1/vms/{vm}/ports/{port}` | Hide a port | |

## Profiles

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/profiles` | Create a profile for an end user | |
| `GET` | `/v1/profiles` | List the account's profiles, optionally of one end user | |
| `GET` | `/v1/profiles/{pr}` | Read a profile | |
| `DELETE` | `/v1/profiles/{pr}` | Delete a profile and its saved browser | |
| `POST` | `/v1/profiles/{pr}/save` | Save a running browser into the profile | |
| `POST` | `/v1/profiles/{pr}/fork` | Make a new profile that starts as a copy | |
| `POST` | `/v1/profiles/{pr}/check` | Test in a copy of the saved browser that the login still works | |

## Regions

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/regions` | Regions where VMs and browsers can start (ams, ash) | |

## SSH

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/vms/{vm}/ssh` | How to reach the VM over SSH | |
| `GET` | `/v1/vms/{vm}/ssh-keys` | Authorized public keys | |
| `POST` | `/v1/vms/{vm}/ssh-keys` | Authorize an OpenSSH public key | |
| `DELETE` | `/v1/vms/{vm}/ssh-keys/{keyId}` | Revoke a key | |

## Sign-in links

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/signin-links` | Create a hosted sign-in link for an end user | |
| `GET` | `/v1/signin-links/{sl}` | Read a sign-in link | |
| `DELETE` | `/v1/signin-links/{sl}` | Cancel a sign-in link and stop its browser | |

## Snapshots

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/vms/{vm}/snapshots` | Save the VM as a named snapshot | |
| `GET` | `/v1/vms/{vm}/snapshots` | Snapshots taken of one VM | |
| `GET` | `/v1/snapshots` | All snapshots, newest first | |
| `GET` | `/v1/snapshots/{snap}` | Read a snapshot | |
| `DELETE` | `/v1/snapshots/{snap}` | Delete a snapshot (VMs started from it keep running) | |
| `GET` | `/v1/snapshots/{snap}/tree` | Files inside a snapshot | |
| `GET` | `/v1/snapshots/{snap}/files` | Download one file from a snapshot | |
| `GET` | `/v1/snapshots/{snap}/archive` | Download a file or folder as an archive | |
| `POST` | `/v1/snapshots/{snap}/start` | Start a VM from a snapshot | |

## State

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/state` | Account state usage and ceilings | |
| `GET` | `/v1/state/{ns}` | Keys of a namespace | |
| `DELETE` | `/v1/state/{ns}` | Delete a namespace | |
| `GET` | `/v1/state/{ns}/{key}` | Read a value | |
| `PUT` | `/v1/state/{ns}/{key}` | Write a value, optionally at a version | |
| `DELETE` | `/v1/state/{ns}/{key}` | Delete a value | |
| `GET` | `/v1/vms/{vm}/state` | Keys of the VM's own state | |
| `GET` | `/v1/vms/{vm}/state/{key}` | Read a VM state value | |
| `PUT` | `/v1/vms/{vm}/state/{key}` | Write a VM state value | |
| `DELETE` | `/v1/vms/{vm}/state/{key}` | Delete a VM state value | |

## Templates

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/templates` | Templates the key can start | |
| `GET` | `/v1/templates/{tpl}` | One template by id or alias | |
| `GET` | `/v1/templates/aliases/{alias}` | Resolve an alias | |

## Triggers

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/vms/{vm}/triggers` | Create a wake trigger; a webhook trigger answers its URL and secret once | |
| `GET` | `/v1/vms/{vm}/triggers` | The VM's wake triggers | |
| `GET` | `/v1/vms/{vm}/triggers/{trigger}` | Read a wake trigger | |
| `PATCH` | `/v1/vms/{vm}/triggers/{trigger}` | Change a wake trigger | |
| `DELETE` | `/v1/vms/{vm}/triggers/{trigger}` | Delete a wake trigger | |
| `GET` | `/v1/vms/{vm}/triggers/{trigger}/events` | A trigger's events, newest first | |
| `POST` | `/v1/vms/{vm}/triggers/{trigger}/fire` | Run the trigger now with the request body, for testing | |

## VMs

| Method | Path | What it does | Status |
| - | - | - | - |
| `POST` | `/v1/vms` | Create a VM from a template, snapshot or size | |
| `GET` | `/v1/vms` | List VMs (filters: state, region, metadata) | |
| `GET` | `/v1/vms/{vm}` | Read one VM | |
| `PATCH` | `/v1/vms/{vm}` | Change timeout\_seconds, metadata, auto\_pause | |
| `DELETE` | `/v1/vms/{vm}` | Kill a VM | |
| `POST` | `/v1/vms/{vm}/connect` | Return the VM and resume it if paused | |
| `POST` | `/v1/vms/{vm}/extend` | Extend the lifetime of a running VM | |
| `POST` | `/v1/vms/{vm}/pause` | Pause at a tier (hot, standby, archived) | |
| `POST` | `/v1/vms/{vm}/resume` | Resume a paused VM | |
| `POST` | `/v1/vms/{vm}/fork` | Fork a VM into count new VMs | |
| `PUT` | `/v1/vms/{vm}/network` | Set the egress policy | |
| `GET` | `/v1/vms/{vm}/metrics` | CPU, memory, disk and network over a window | |
| `GET` | `/v1/vms/{vm}/logs` | Command output log of the VM | |
| `GET` | `/v1/vms/{vm}/top` | Processes running now, busiest first | |
| `GET` | `/v1/vms/{vm}/cost` | Cost of this VM in the calendar month (UTC) | |
| `GET` | `/v1/names` | List the account's VM names | |

## Webhooks

| Method | Path | What it does | Status |
| - | - | - | - |
| `GET` | `/v1/webhooks` | Endpoints | |
| `POST` | `/v1/webhooks` | Register an HTTPS endpoint | |
| `GET` | `/v1/webhooks/deliveries` | Recent deliveries | |
| `GET` | `/v1/webhooks/{whk}` | One endpoint | |
| `PATCH` | `/v1/webhooks/{whk}` | Change URL, events, description | |
| `DELETE` | `/v1/webhooks/{whk}` | Delete | |
| `POST` | `/v1/webhooks/{whk}/rotate-secret` | Rotate signing secret (24 h overlap) | |
| `POST` | `/v1/webhooks/{whk}/test` | Send a test event | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.