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:
Create a personal API key (kal_...)
In
Settings → API & External Access → API Keys, clickCreate API Key, name the token for its destination (for exampleMacBook CLIorCloud Worker), and copy thekal_...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 itsHKDF-SHA256digest. Never commitkal_keys to Git, pass--tokenin CLI arguments (TOKEN_ARGV_FORBIDDEN), or share screenshots containing unmasked secrets; clickRevokenext to any unused token inSettings → API & External Access.Sign in from the CLI (kalamos login)
Link the bundled
kalamosbinary into yourPATH, runkalamos login, and paste yourkal_...key at the hidden prompt (or setKALAMOS_API_KEYon remote servers and CI). Then inspect identity, list conversations, or start runs from any terminal:Terminal · Link CLI, sign in & check statusmkdir -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 jsonCall 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 registerkalamos mcpin any MCP-compatible host using the same personal API key:curl · Verify personal API key identitycurl -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:
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 jsonIn headless environments, inject KALAMOS_API_KEY via your secret manager or pipe it over stdin with --token-stdin (never pass --token on the command line; kalamos rejects argv tokens with TOKEN_ARGV_FORBIDDEN so secrets cannot leak in process listings):
export KALAMOS_API_KEY='kal_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
kalamos whoami --json
printf '%s
' "$KALAMOS_API_KEY" | kalamos login --token-stdin| Command | Purpose & key flags |
|---|---|
kalamos login / logout | Save or remove personal kal_... credentials (--token-stdin, --url <https-origin>, or KALAMOS_API_KEY). |
kalamos auth status / whoami | Verify current authentication state, account identity, and active API origin. |
kalamos desktop status | Check whether your linked macOS desktop workspace is currently online (GET /api/v1/me/desktop-presence). |
kalamos conversations | list [--limit N], get <id>, and create [--title "<title>"] across remote and local environments. |
kalamos runs | create --conversation <id> --model <id> --prompt-file <path>, get <id>, events <id> (live SSE), and stop <id>. |
kalamos mcp | Start 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.
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 -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"List or create a conversation (/api/v1/conversations), then start a run with POST /api/v1/conversations/<CONVERSATION_ID>/runs and an Idempotency-Key:
curl -sS -X POST "$KALAMOS_API_URL/api/v1/conversations" \
-H "Authorization: Bearer $KALAMOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Editorial outline"}'
curl -sS -X POST "$KALAMOS_API_URL/api/v1/conversations/<CONVERSATION_ID>/runs" \
-H "Authorization: Bearer $KALAMOS_API_KEY" \
-H "Idempotency-Key: run-brief-001" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize the key points from my notes into a structured outline."
}'Stream real-time execution events from GET /api/v1/runs/<RUN_ID>/events (text/event-stream), including start, text_delta, tool_start, tool_approval_required, tool_end, message_end, done, and error:
curl -N "$KALAMOS_API_URL/api/v1/runs/<RUN_ID>/events" \
-H "Authorization: Bearer $KALAMOS_API_KEY" \
-H "Accept: text/event-stream"Fetch run status and messages via GET /api/v1/runs/<RUN_ID> or stop an in-flight run via POST /api/v1/runs/<RUN_ID>/stop:
curl -sS "$KALAMOS_API_URL/api/v1/runs/<RUN_ID>" \
-H "Authorization: Bearer $KALAMOS_API_KEY"
curl -sS -X POST "$KALAMOS_API_URL/api/v1/runs/<RUN_ID>/stop" \
-H "Authorization: Bearer $KALAMOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'| Endpoint | Description |
|---|---|
GET /api/v1/me/whoami | Verify the authenticated user profile and confirm authMethod: "api_key". |
GET /api/v1/me/desktop-presence | Check online desktop presence and workspace bridge availability. |
GET /api/v1/conversations | List recent conversations (?limit=N). |
POST /api/v1/conversations | Create a new conversation ({ "title": "..." }). |
GET /api/v1/conversations/:id | Read conversation metadata and message history. |
POST /api/v1/conversations/:id/runs | Start an agent run in the conversation (prompt, optional modelId, Idempotency-Key). |
GET /api/v1/runs/:id | Inspect run lifecycle state, metadata, and completed output. |
GET /api/v1/runs/:id/events | Real-time text/event-stream SSE feed for streaming deltas and tool events. |
POST /api/v1/runs/:id/stop | Stop 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": {
"kalamos": {
"command": "kalamos",
"args": ["mcp"]
}
}
}When running inside isolated containers or delegating strictly read-only inspection (5 read tools only, write calls rejected with PROFILE_FORBIDDEN), pass KALAMOS_API_KEY via env or add --profile readonly:
{
"mcpServers": {
"kalamos": {
"command": "/Applications/Kalamos Desktop.app/Contents/Resources/app/bin/kalamos",
"args": ["mcp", "--profile", "readonly"]
}
}
}On a narrow screen, scroll the table sideways to see all columns.
| Tool | Access | What it covers |
|---|---|---|
kalamos_whoami | Read-only | Inspect the authenticated Kalamos account for the configured personal API key. |
kalamos_desktop_status | Read-only | Check whether a Kalamos desktop workspace is currently online for this account. |
kalamos_conversations_list | Read-only | List recent conversations (limit 1–100). |
kalamos_conversations_get | Read-only | Read conversation metadata and messages by UUID. |
kalamos_conversations_create | Write | Create a new conversation with an optional title. |
kalamos_runs_create | Write (model usage) | Start a run on conversationId with modelId, prompt, and idempotency protection. |
kalamos_runs_get | Read-only | Inspect run status and output by runId. |
kalamos_runs_stop | Write | Stop an active run by runId. |
Security Boundaries & Error Codes
- Single token model & immediate revocation:
Settings → API & External Accesslists only the personalkal_...tokens you created. Revoking a token invalidates CLI, HTTP/SSE, andkalamos mcprequests immediately, including active SSE streams. - Hashed personal keys & Cookie-only management: personal
kal_...keys show plaintext once at creation (HKDF-SHA256digest 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 with403 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 code | Cause | What to do next |
|---|---|---|
401 / INVALID_API_KEY | The 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_allowed | A 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_BUSY | The 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_approval | A 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_UNCONFIRMED | A write or run request timed out before confirmation returned. | Inspect the run status (kalamos runs get <id>) with the original Idempotency-Key before retrying. |