Overview

The Allternit Cloud API is the hosted control plane that binds user accounts to self-hosted and managed runtimes. It provides the runtime pairing protocol, the browser-to-runtime relay, hosted runtime lifecycle, the BYO-VPS deploy wizard, and the Cowork Runtime execution API. The API is built from cmd/allternit-cloud-api and runs at https://api.allternit.com in production.

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:

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