Overview

The Allternit Cloud API is the only public API. It is the hosted control plane that binds user accounts to self-hosted and managed data-plane nodes. It provides the runtime pairing protocol, the browser-to-runtime relay, hosted runtime lifecycle, Allternit-provisioned instances, the BYO-VPS deploy wizard, the Cowork Runtime execution API, and the /v1 model gateway. The API is built from cmd/allternit-cloud-api and runs at https://api.allternit.com in production (Postgres). The Allternit API (:8013, SQLite) is the private data plane — never a public hostname. See API Overview. The /v1/chat/completions model gateway is on this origin.

Base URL

Public health endpoints require no authentication. Runtime pairing creation and exchange are public (like an OAuth device flow). All other endpoints require either a Clerk session JWT or a runtime device token in the Authorization: Bearer <token> header.

Runtime pairing

First-party device pairing binds a desktop or VPS runtime to a human account without giving the runtime the human’s Clerk session token. The runtime generates an Ed25519 keypair, polls for approval, and exchanges the pairing for a revocable device credential.

Pairing endpoints

Create a pairing

Response

Exchange a pairing

The runtime signs the challenge with its Ed25519 private key and polls the exchange endpoint.

Response

While approval is pending, the endpoint returns HTTP 428:

Capability scopes

Runtime relay

Once paired, a runtime opens an outbound WebSocket to the cloud API. A Clerk-authenticated browser can then proxy HTTP requests and WebSocket traffic to that runtime without exposing the runtime’s loopback API publicly.

Relay endpoints

Proxy a request to a runtime

The cloud API verifies ownership and capability, forwards the request over the runtime WebSocket, and streams the response back.

WebSocket ticket

For streaming endpoints, request a ticket first:

Response

Connect to the ticketed WebSocket:

Allowed relay paths

The runtime proxy only accepts paths under the following prefixes:

Relayed data-plane namespaces

These Cloud API routes authenticate with a Clerk session, resolve the caller’s default healthy node, and relay the request to Allternit API on that node. They do not store a second copy of the resource in Cloud API Postgres. HTTP 428 means the account has no healthy node (pair a desktop/VPS or start a provisioned instance). The original Authorization header is forwarded. SSE is not buffered.

Provisioned instances

Paid subscriptions can get an Allternit-provisioned data-plane instance (isolated container, per-instance SQLite, auto-pair). These routes are control-plane only: they create/start/stop the instance. Traffic to Allternit API inside the instance still goes through the runtime relay. Host registration (/api/v1/provisioned-hosts) is operator-only.
This is mode 3 in BYOC Overview. It is separate from Fly hosted runtimes.

Hosted runtimes

Paid users can provision managed runtimes as Fly Machines. The agent-daemon inside the machine auto-pairs using a one-time bootstrap token.

Hosted runtime endpoints

Create a hosted runtime

Response

BYO-VPS deploy wizard

The wizard provisions a self-hosted runtime on Hetzner, DigitalOcean, AWS, or a manual SSH target. It runs idempotent bootstrap over SSH, joins the box to the mesh, registers it as a gizzi instance, and mints a one-time pairing token.

Wizard endpoints

Start a wizard

Response

The response is redacted: apiToken, sshPrivateKey, and sshPassword are never echoed.

Bootstrap the box

Response

If the bootstrap fails for a recoverable reason, retry the same request. Non-recoverable failures or exhausted attempt caps return HTTP 409:

Cowork Runtime

Runs are the core execution unit in the Cowork Runtime. The cloud API exposes run lifecycle, event streaming, schedules, approvals, jobs, and checkpoints.

Run endpoints

Create a run

Response

Stream events

Each SSE line is a JSON event:

Schedule endpoints

Approval endpoints

Health and metrics

Error codes

Rate limits

  • Authenticated API routes: 60 requests per minute by default (RATE_LIMIT_RPM).
  • Public pairing and relay routes: 30 requests per minute by default (PUBLIC_RATE_LIMIT_RPM).
Rate limit headers are included on responses:

Environment variables