User manual

External Agents (CLI, API & MCP)

Create a personal API key once in Settings, then call Kalamos anywhere through the CLI, the HTTP/SSE API, or standard MCP.

Updated November 15, 2026

Quickstart with Personal API Keys

Open Settings → API & External Access in Kalamos Desktop.app (or use the top menu Agent → API & External Access Settings…) to create and manage personal kal_... API tokens. One token powers all three external surfaces—CLI, HTTP/SSE API, and MCP:

  1. Create a personal API key (kal_...)

    In Settings → API & External Access → API Keys, click Create API Key, name the token for its destination (for example MacBook CLI or Cloud Worker), and copy the kal_... secret immediately. Only created tokens and their prefixes are listed in Settings—no redundant local client wall.

    API key hygiene: the full kal_... secret is displayed once at creation while the server stores only its HKDF-SHA256 digest. Never commit kal_ keys to Git, pass --token in CLI arguments (TOKEN_ARGV_FORBIDDEN), or share screenshots containing unmasked secrets; click Revoke next to any unused token in Settings → API & External Access.

  2. Sign in from the CLI (kalamos login)

    Link the bundled kalamos binary into your PATH, run kalamos login, and paste your kal_... key at the hidden prompt (or set KALAMOS_API_KEY on remote servers and CI). Then inspect identity, list conversations, or start runs from any terminal:

    Terminal · Link CLI, sign in & check status
    mkdir -p ~/.local/bin
    ln -sf "/Applications/Kalamos Desktop.app/Contents/Resources/app/bin/kalamos" ~/.local/bin/kalamos
    kalamos login
    kalamos auth status --output json
    kalamos desktop status --output json
  3. Call via HTTP + SSE API or kalamos mcp

    Send Authorization: Bearer kal_... directly to official HTTPS /api/v1/... endpoints (GET /api/v1/me/whoami, GET /api/v1/conversations, POST /api/v1/conversations/:id/runs, GET /api/v1/runs/:id/events), or register kalamos mcp in any MCP-compatible host using the same personal API key:

    curl · Verify personal API key identity
    curl -sS "https://kalamos.uk/api/v1/me/whoami" \
      -H "Authorization: Bearer $KALAMOS_API_KEY"

Kalamos CLI (Remote & Local)

With a personal kal_... API key from Settings → API & External Access → API Keys, the kalamos CLI works identically across remote Linux servers, CI pipelines, cloud sandboxes, and your local Mac terminal. Every command supports --output json|table|text (alias --json), writing pure JSON to stdout and diagnostics to stderr.

Copy kalamos login from Settings → API & External Access and paste your kal_... key at the hidden prompt (saved with 0600 permissions in ~/.config/kalamos/credentials.json). Then manage conversations, stream runs, and check whether your Mac desktop is online:

Terminal · Universal remote & local commands
kalamos login
kalamos auth status --output json
kalamos whoami --output json
kalamos desktop status --output json

kalamos conversations list --limit 20 --output json
kalamos conversations create --title "Weekly research brief" --output json
kalamos runs create --conversation <conversation-id> --model <model-id> --prompt-file ./brief.md --output json
kalamos runs events <run-id>
kalamos runs get <run-id> --output json
kalamos runs stop <run-id> --output json
CommandPurpose & key flags
kalamos login / logoutSave or remove personal kal_... credentials (--token-stdin, --url <https-origin>, or KALAMOS_API_KEY).
kalamos auth status / whoamiVerify current authentication state, account identity, and active API origin.
kalamos desktop statusCheck whether your linked macOS desktop workspace is currently online (GET /api/v1/me/desktop-presence).
kalamos conversationslist [--limit N], get <id>, and create [--title "<title>"] across remote and local environments.
kalamos runscreate --conversation <id> --model <id> --prompt-file <path>, get <id>, events <id> (live SSE), and stop <id>.
kalamos mcpStart the standard MCP stdio server authenticated by your kalamos login session or KALAMOS_API_KEY (--profile core|readonly).

Remote HTTP + SSE API

Cloud services, webhooks, and custom orchestrators can call the official Kalamos HTTPS API directly with Authorization: Bearer <KALAMOS_API_KEY>. Pass an Idempotency-Key header on POST requests so network retries never duplicate runs, and subscribe to /events (text/event-stream) for real-time token and tool progress. When a conversation invokes authorized desktop workspace capabilities, Kalamos bridges to your online desktop automatically.

Shell · Configure API origin & personal key
export KALAMOS_API_URL='https://kalamos.uk'
export KALAMOS_API_KEY='kal_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Verify the personal API key identity (/api/v1/me/whoami) and check online desktop bridge readiness (/api/v1/me/desktop-presence):

curl · /api/v1/me/whoami & desktop-presence
curl -sS "$KALAMOS_API_URL/api/v1/me/whoami" \
  -H "Authorization: Bearer $KALAMOS_API_KEY"

curl -sS "$KALAMOS_API_URL/api/v1/me/desktop-presence" \
  -H "Authorization: Bearer $KALAMOS_API_KEY"
EndpointDescription
GET /api/v1/me/whoamiVerify the authenticated user profile and confirm authMethod: "api_key".
GET /api/v1/me/desktop-presenceCheck online desktop presence and workspace bridge availability.
GET /api/v1/conversationsList recent conversations (?limit=N).
POST /api/v1/conversationsCreate a new conversation ({ "title": "..." }).
GET /api/v1/conversations/:idRead conversation metadata and message history.
POST /api/v1/conversations/:id/runsStart an agent run in the conversation (prompt, optional modelId, Idempotency-Key).
GET /api/v1/runs/:idInspect run lifecycle state, metadata, and completed output.
GET /api/v1/runs/:id/eventsReal-time text/event-stream SSE feed for streaming deltas and tool events.
POST /api/v1/runs/:id/stopStop an active run cleanly.

Standard MCP via kalamos mcp

If your external host prefers MCP tool calls over CLI commands, point it at kalamos mcp. It reuses the exact same personal API key saved by kalamos login (or KALAMOS_API_KEY in the MCP server env), with no local port to open and no separate client toggle in Settings:

After signing in once with kalamos login, add kalamos mcp to any MCP-compatible client configuration:

mcpServers · Standard stdio config
{
  "mcpServers": {
    "kalamos": {
      "command": "kalamos",
      "args": ["mcp"]
    }
  }
}

On a narrow screen, scroll the table sideways to see all columns.

ToolAccessWhat it covers
kalamos_whoamiRead-onlyInspect the authenticated Kalamos account for the configured personal API key.
kalamos_desktop_statusRead-onlyCheck whether a Kalamos desktop workspace is currently online for this account.
kalamos_conversations_listRead-onlyList recent conversations (limit 1–100).
kalamos_conversations_getRead-onlyRead conversation metadata and messages by UUID.
kalamos_conversations_createWriteCreate a new conversation with an optional title.
kalamos_runs_createWrite (model usage)Start a run on conversationId with modelId, prompt, and idempotency protection.
kalamos_runs_getRead-onlyInspect run status and output by runId.
kalamos_runs_stopWriteStop an active run by runId.

Security Boundaries & Error Codes

  • Single token model & immediate revocation: Settings → API & External Access lists only the personal kal_... tokens you created. Revoking a token invalidates CLI, HTTP/SSE, and kalamos mcp requests immediately, including active SSE streams.
  • Hashed personal keys & Cookie-only management: personal kal_... keys show plaintext once at creation (HKDF-SHA256 digest stored server-side), remote CLI/API calls enforce HTTPS (HTTPS_API_ORIGIN_REQUIRED) without following redirects, and sensitive interactive endpoints (/api/v1/session, key creation/revocation, password, billing) reject Bearer tokens with 403 api_key_not_allowed.
  • Zero upstream credential export & workspace approvals: external interfaces never export model provider API keys, OAuth tokens, or Keychain sign-in credentials. Workspace file actions continue to obey authorized project folders, interactive approvals (waiting_approval), unsaved editor draft locks (409 EDITOR_BUSY), and idempotent reconciliation (OUTCOME_UNCONFIRMED).

On a narrow screen, scroll the table sideways to see all columns.

Symptom or codeCauseWhat to do next
401 / INVALID_API_KEYThe kal_... personal API key is missing, mistyped, or was revoked in Settings → API & External Access.Create a new key under Settings → API & External Access → API Keys, then run kalamos login or update KALAMOS_API_KEY.
403 / api_key_not_allowedA Bearer kal_... token was sent to an interactive-only account or session management route.Call /api/v1/me/whoami for API key identity checks, and manage keys or account settings inside Kalamos Desktop.
TOKEN_ARGV_FORBIDDEN--token was passed directly on the CLI command line, which could expose secrets in process listings.Authenticate via kalamos login (hidden prompt), --token-stdin, or the KALAMOS_API_KEY environment variable instead.
409 EDITOR_BUSYThe target Copy Library document, profile, or knowledge entry currently has unsaved edits in Kalamos Desktop.Save or close the active draft in Kalamos Desktop first, fetch the latest revision, and then retry the write.
Task stays in waiting_approvalA file write or command inside the conversation is waiting for your confirmation in Kalamos Desktop.Open the corresponding conversation in Kalamos Desktop to review and allow or deny the request; do not resend duplicate tasks.
OUTCOME_UNCONFIRMEDA write or run request timed out before confirmation returned.Inspect the run status (kalamos runs get <id>) with the original Idempotency-Key before retrying.
Compare desktop and web →Read about your data →General troubleshooting guide →