Hoppa till innehållet
Docs

Den här guiden finns bara på engelska.

API and SDK

The API every Vixi app uses, how devices sign in, and the TypeScript client you can build on.

Every Vixi app talks to the server through the same HTTP and streaming API, using one shared TypeScript client. You can use that client to build your own app or script against a Vixi server. This page explains how the API is organized, how sign-in works and where the code is.

How the API is organized

The two API endpointsApps call control for accounts, settings, connections, devices and approvals, and the edge for chats, streams, files, memory and the live browser. The edge forwards those calls to the person's workspace, waking it if it is asleep.Your app@hermes/client/v1/…/u/…ControlAccounts, settings,connections, devicesEdgeChats, streams,files, memoryWorkspaceWakes on demand
PartAddressWhat it covers
Discovery/.well-known/vixi.jsonThe server's API, edge and web addresses, its version, edition, and whether it still needs setup
Control/v1/…Sign-in, account, settings, devices, connections, the vault list, approvals, data export, setup and the owner's server settings
Edge/u/…Chats and their live streams, steering and stopping, files, memory, skills, background tasks and the live browser view. The edge forwards these to your workspace.
Realtime socketOn the edgeAccount events pushed to open apps: run state, approvals, helper questions, device presence

Errors come back as {error: {code, message}} with an HTTP status. Common codes are unauthorized, forbidden, not_found, invalid, conflict, rate_limited and instance_unavailable.

Signing in

Vixi signs in devices, not just people. Each app, script or computer has its own Ed25519 key, made on the device.

  1. Sign in with email and password, an emailed code, a passkey or Google. The device sends its public key.
  2. Control returns an access token, valid for 15 minutes, and a refresh token. Send the access token as Authorization: Bearer <token>.
  3. To refresh, the device signs the request with its private key. Refresh tokens change on every use.
  4. Removing a device in Settings stops its refresh and closes its live connections.

Access tokens are signed by control with an Ed25519 key. The edge only has the public half, so it can check tokens but never make one. Computers and browsers pair with a short code you approve in the app instead of a password.

The TypeScript client

@hermes/client in packages/client is the client every Vixi app uses: web, desktop, phone and the browser extension. It handles device keys, token refresh, retries, waking a sleeping workspace and streams that reconnect from where they stopped.

AreaExamples
Accountlogin, magicStart / magicVerify, me, settings, devices, connections, requestDataExport
ChatscreateSession, chat (send and stream one turn), sendMessage + attach (follow a run from any device), steerRun, stopRun, answerApproval
Knowledgememory, memorySearch, exportMemory, skillsTree
FilesuploadFile, listFiles, createFileLink, deleteFile
Liveconnect (the realtime socket), browserStream, streamScreens

The package is TypeScript source in the monorepo, not a published npm package. Use it from a clone of the repository, as part of the pnpm workspace.

Example

A short script that signs in to a self-hosted server, starts a chat and prints the answer as it streams. It runs in Node 22 inside the repository's workspace:

TypeScript
import { HermesClient, discoverServer, loadOrCreateDeviceKey, type SecretStore } from "@hermes/client";

// Keeps the device key and tokens in memory. A real app uses the OS keychain.
const mem = new Map<string, string>();
const store: SecretStore = {
  get: async (k) => mem.get(k) ?? null,
  set: async (k, v) => { mem.set(k, v); },
  delete: async (k) => { mem.delete(k); },
};
const random = (n: number) => crypto.getRandomValues(new Uint8Array(n));

// Reads /.well-known/vixi.json and checks the addresses it names.
const server = await discoverServer("https://vixi.example.com");

const client = new HermesClient({
  apiUrl: server.apiUrl,
  edgeUrl: server.edgeUrl,
  store,
  deviceKey: () => loadOrCreateDeviceKey(store, random),
  device: { name: "My script", platform: "desktop" },
});

await client.login("you@example.com", "your-password");
const chat = await client.createSession("From a script");
await client.chat(chat.id, "What's on my calendar tomorrow?", (e) => {
  if (e.type === "assistant.delta" && "delta" in e) process.stdout.write(e.delta);
});

A new device from a script counts as a signed-in device on the account. Remove it in Settings when you no longer need it. Approvals still apply: if the chat needs one, an approval event arrives and you answer it with answerApproval, or from the app.

Chat events

chat and attach deliver typed events as the turn runs:

EventMeaning
assistant.deltaMore of the answer's text
assistant.commentaryA short note on what the agent is doing
tool.started, tool.completed, tool.failedA tool call and how it ended
approval.requestThe agent waits for an approval card
approval.respondedSome device answered an approval
run.completed, run.failed, run.cancelledThe turn ended

Each event of attach has a sequence number, so a stream that drops picks up where it left off. Other kinds of events can appear; ignore the ones you don't use.

The protocol package

@hermes/protocol in packages/protocol holds the shared types and rules that the server, the apps and the agent agree on:

  • types for every request and response, and the realtime frames
  • connections.json, the catalog of every connected app and what each permission allows
  • risk.json, the table that rates how risky each tool call is, with test vectors that the TypeScript and Python checks both run
  • model choices, plans, approvals, payments and file types

See Architecture for how the services fit together, and Source and contributing to build them.

MCP

Vixi can also use tools from MCP servers you add, and it treats their results as information, not instructions. On Vixi AI for Work, an organization also gets an MCP server with search and answer tools over its company knowledge, for its members' own AI tools. See Teams and organizations.