A runtime is the program a bot runs in: Allternit itself, or a coding CLI such as Claude Code, Codex, Kimi or Antigravity. The brain is the model that runtime uses. Every picker (Desktop, ai.allternit.com, the phone apps and Gizzi Code) reads the same list of runtimes from this endpoint, so they always offer the same choices. The list is the runtimes array of cmd/gizzi-code/src/runtime/providers/discovery/cli-catalog.json (version 3, with choices). Both servers build it into their binary, so a new runtime arrives with a new release, not at run time.

GET /api/v1/runtimes

No sign-in needed. Two servers answer the same path with the same list:
  • cloud-api answers web and phones, so the picker works with no computer.
  • allternit-api on a computer answers Desktop. When the caller owns that computer, it also adds installed (see What is installed).
The example is shortened. A real look carries the full set of tokens. Clients ignore fields they do not know, so new fields can be added without a new version.

Caching

  • The response has a strong ETag. It is a hash of the catalog file, so it is the same on both servers and changes only when the file changes.
  • Cache-Control: public, max-age=3600.
  • Send the ETag back in If-None-Match to get 304 Not Modified with no body.
  • Clients keep the last good copy and use it when the request fails, so the picker still opens offline.

What is installed

When the caller owns the computer, allternit-api adds one more key. Ownership means the runtime belongs to one person (the Desktop app or a self-hosted install) and the request carries the Desktop access token or a valid signed-in session.
  • installed and signedIn come from the same check the Connections page and GET /api/v1/cli-tools/catalog use.
  • version is null for now: that check does not read the CLI’s version yet.
  • This response is per computer and per person, so it is sent with Cache-Control: private, no-cache and no ETag.
  • cloud-api never sends installed. Only your computer knows what is installed on it.

Choices

The response also carries choices: the things a person picks to run on. Every picker draws its list from it, so a new runtime shows up without a client change. It sits next to runtimes and is passed through from the same catalog file, unchanged on both servers.
  • There is one cloud choice, one plan choice per subscription provider in the runtimes’ plans, and one cli choice for every runtime whose tool is not null.
  • id is cloud, plan:<provider> or cli:<runtime>. A plan choice runs on the allternit runtime with the brain provider plan-<provider>. A cli choice names its runtime and its catalog tool.
  • logo is an id the web and native logo maps already know.
  • The brains shown for a picked choice: cloud shows the models the account can use, with plan providers left out. plan shows the models of that plan’s connection row. cli shows the tool’s models that fit the runtime.

Ready rule

A choice is ready when a person can start it now. Everything else goes under “Set up more” with one action. cloud-api never sends installed, so web, the phone layout, the PWA, iOS and Android can mark a cli choice ready only when they hold the map from the selected computer’s runtime. When installed cannot be read, show that the computer cannot be checked and offer a retry. Do not guess. A client that gets a response with no choices (an older server) builds the same list from runtimes and plans with the same rule.

Which brains a runtime may use

A plan login (a Claude, ChatGPT, Kimi, Gemini or Copilot subscription) belongs to that provider’s own app. Most providers do not allow it inside another company’s agent, so each runtime lists the plans it may use in plans: Every client (Desktop, ai.allternit.com, the phone apps, Gizzi Code) and the server use one rule, allowed(runtime, brain). The reference is allowed in cmd/gizzi-code/src/runtime/providers/discovery/runtime-registry.ts; the server copy is allowed in cmd/allternit-api/src/bot_brain.rs.
  1. The brain fits. brains is "any", or the brain’s provider is listed (a subs- prefix is stripped), or the provider is the runtime’s own CLI (its tool, its id, its aliases or the tool’s aliases).
  2. A plan brain needs the plan. A brain is a plan brain when its provider id starts with subs- (vendor ids map to their plan: subs-anthropic is claude, subs-openai is chatgpt), or when it is a CLI sign-in whose runtime holds exactly one plan (claude-cli, codex-cli, kimi-cli, antigravity, copilot). The plan must be in the runtime’s plans.
  3. A runtime’s own CLI sign-in always passes. claude-cli on Claude Code is allowed whatever plans says.
Clients never offer a brain that fails allowed. When a new runtime can’t use the current brain, the picker switches to the first allowed brain (the runtime CLI’s default model) and shows a one-line note. Gizzi Code refuses an explicit --brain that is a plan the runtime can’t use, with the plan_not_allowed_on_runtime message below.

Saving a bot: errors and warnings

422 errors

allternit-api checks the runtime and brain only when the request sets config.botBrain.runtime itself:
  • POST /api/v1/agents (create): always checked.
  • PUT and PATCH /api/v1/agents/:id (update): checked when the runtime or brain changes. The request’s runtime and brain provider are compared with the stored record’s normalized botBrain (and its model when modelRef is absent). When both are the same, the save is never rejected, even if that pair would fail today’s rules. Bots saved before these rules keep working, and clients that send the whole config back on a rename are not refused. A request with no brain keeps the stored brain.
A save in the old shape (no runtime) is normalized as described below and never rejected. The brain is botBrain.modelRef (a provider/model string or a {providerID, modelID} object), else the request’s model when it is provider/model. A brain with no provider is not checked. runtime: "custom" is not checked either.

Install warning

When a create or update that carries config.botBrain succeeds and its runtime (after normalizing) is not allternit, allternit-api checks whether the runtime’s CLI is on this computer, with the same check that fills installed in What is installed. When it is not, the response gets warnings. The save still succeeds.
warnings is added to the usual body of each route ({agent} on POST and PATCH, {success} on PUT) and is absent when there is nothing to say. Clients show the message under the Runtime layer.

A runtime’s own web app

Some runtimes ship a web app of their own: the registry entry carries liveUi. Your computer’s runtime (allternit-api) can start that app, keep it to your computer, and stop it again. cloud-api has no such routes: the app always runs on your own computer. All three routes are owner only: the same check as What is installed. Anyone else gets 403 owner_only. They take an optional session id (sessionId in the POST body, ?sessionId= on GET and DELETE). The app runs in that session’s workspace folder, or in your home folder when there is none.

POST /api/v1/runtimes/:id/live

:id is a runtime id or alias. The answer:
  • The app listens on 127.0.0.1 only, never on your network.
  • The registry’s port is used when it is free; otherwise a free local port is picked.
  • It never opens a browser window. BROWSER points at a command that does nothing, and the usual browser openers on its PATH (open, xdg-open, *-browser) do nothing either. A command the app’s agent runs that calls open does nothing while the app runs.
  • The route waits up to 20 seconds for the app’s liveUi.health path to answer. If it does not, the app is stopped and the route answers 504 live_timeout.
  • There is one app per person, runtime and folder. A second POST returns the running one with reused: true.
  • Clients frame the app through resourceUri (the MCP Apps frame, see MCP servers), not with a plain iframe of url.
How each runtime’s app is started: Errors:

GET /api/v1/runtimes/:id/live

Returns the same body as POST with reused: true, or {"running": false, "runtime": "<id>"}. Each GET counts as a heartbeat.

DELETE /api/v1/runtimes/:id/live

Stops the app and answers {"stopped": true|false, "runtime": "<id>"}. The app’s whole process group gets SIGTERM, then SIGKILL after 3 seconds.

When an app stops

  • You send DELETE.
  • The session that started it is deleted (DELETE /api/v1/agent-sessions/:id) and no other session still uses it.
  • Nobody sends a POST or GET for 30 minutes.
  • The runtime shuts down (Desktop quits). On Linux the app also stops if the runtime crashes.

From the web and phones

ai.allternit.com and the PWA reach your computer through the Cloud relay. The POST, GET and DELETE calls are ordinary /api paths, so the relay already carries them. To show the app itself, the web frame needs a forward to the app’s port on your computer (POST /api/v1/computers/:id/forward with remotePort set to port). Until the web and PWA frame uses that forward, they show the runtime’s look with a note to open it on your computer.

Bot record fields

A bot’s runtime and brain live in the agent’s config (Agents API). All of these fields are optional, so older clients keep working.
The fields mode, harness, uhpHarnessId, nativeSessionId, modelRef and effort are unchanged.

How the server fills in the record

Each create, PUT or PATCH that carries config.botBrain passes through one normalizer before it is saved, so a record always has both the old and the new fields and they agree:
  • No runtime. It is worked out from the old fields:
    • allternit_cloud becomes allternit.
    • native_harness with harness h becomes the runtime whose legacy.harness, id or alias is h, or custom when there is none.
    • uhp_harness becomes the runtime whose legacy.uhp holds uhpHarnessId, or custom.
  • With runtime. mode and harness are worked out from it. The Allternit runtime sets mode: "allternit_cloud". A runtime with adapter unsupported sets uhp_harness. Any other runtime sets native_harness with its harness id.
  • A runtime this server does not know is rejected with 422 runtime_unknown when a create, or an update that changes the runtime, names it (see 422 errors). A stored record that already holds one is read as a native harness with that id. custom keeps the stored mode and harness as they are.
  • Every other key in botBrain is kept. An empty or missing botBrain is left alone.
Config is merged one top-level key at a time. A client that saves only botBrain replaces that object, which is why agentView is a separate key.

Wire names that stay vendor

In the apps and these docs, bots run by another company’s service are called Connected bots. Their wire names did not change, and there is no connected alias:
  • the bot type 'vendor'
  • the vendor_bot_* tables and bot_execution_bindings.type = 'vendor'
  • the MCP route /mcp/bots/<id>
  • the event vendor.ticket.created
botKind: "connected" is the one place the new name appears in an API response, and it is read only.