forkr-api is the HTTP server behind the 4kr CLI. It owns the Kubernetes and btrfs state for your deployment and exposes a REST API plus WebSocket transports for interactive exec and console sessions. The 4kr CLI is the primary client, but every operation it performs maps to a route documented here, so you can drive Forkr from your own tooling.

Base URL

Requests go to your deployment’s API endpoint. The CLI resolves this from the selected profile (FORKR_PROFILE_<NAME>_URL), the --url flag, or FORKR_URL / FORKR_API_URL. See target selection and profiles.

Authentication

The CLI authenticates with a bearer token, configured per profile (FORKR_PROFILE_<NAME>_TOKEN) or passed with --token. Send it as an Authorization: Bearer <token> header.

Versioning

Resource routes are namespaced under /v1. A box’s lifecycle routes live under /v1/projects/{project}/boxes/{name}. The API version is reported by GET /version, and GET /healthz returns the health of the API and the underlying cluster.

Route groups

The endpoints in the sidebar are organized by area:

Boxes

Create, list, update, stop, resume, delete, and publish boxes.

Exec and console

Run commands and attach interactive terminals over HTTP and WebSocket.

Services

Manage long-lived services, publishing, and blue/green deploys.

Data volumes

Create, attach, snapshot, back up, and restore data volumes.

Snapshots and bases

Capture box-root checkpoints and manage base templates.

Files

Read, write, stat, list, and delete paths in a box filesystem.