---
title: SpaceMIX API
summary: "The server's public HTTP API, `/api/v1`, for scripts and other services: its on/off switch, API keys and their eight scopes, every route with its scope, body, response and status codes, the server's MCP connection tools, how actions are relayed to an open SpaceMIX client, the server-side assistant and its streaming format, events and notifications from source `api`, and the limits."
audience: both
stability: experimental
since: protocol 1
---

# SpaceMIX API

The SpaceMIX API lets a script, a CI job or another service use a SpaceMIX server without a person signing in. It calls the same extension tools the assistant has (Team Chat included: it is an extension, reached through its tools like any other) and the tools of the server's [MCP connections](mcp-connections.md), talks to the assistant, emits and reads events, and sends notifications. Every request carries an **API key** and acts as the person who made the key, limited to the scopes they picked.

The API is the server's surface, not the extension contract: extensions never call it, and it is versioned by its `/api/v1` prefix. The routes live in `apps/desktop/src-tauri/src/api.rs`, keys in `api_keys.rs`, tools in `tools.rs` and `tool_runs.rs`, MCP connections in `mcp.rs`, the assistant in `assistant.rs`.

```sh
curl -s https://spacemix.example.com/api/v1/me \
  -H "Authorization: Bearer opk_k1a2b3c4d5e6f_0123456789abcdef0123456789abcdef"
```

## Switching the API on

The API is **off** on a new server. While it is off, every `/api/v1` request, `GET /api/v1/me` included, is answered `403` `{ "error": "The SpaceMIX API is switched off on this server." }` before its key is looked at.

- Switch it on or off in **Settings → API**, on the **SpaceMIX API** card. Only people with the `server:settings` permission may (see [Permissions](permissions.md)); for anyone else the switch is disabled, and the server refuses the write with `Only people who may change server settings can switch the API on or off.`
- The switch is the kv key `shell/apiEnabled`. The API is on only when it holds JSON `true`; absent, any other value, or a store that can't be read is off (`enabled` in `apps/desktop/src-tauri/src/api.rs`, the permission check in `check_kv_write` in `server.rs`).
- Switching off takes effect at once: new requests get the `403` above, an open `events/stream` ends, and a running assistant turn stops with the `403` as its reply (`api_switched_off` in `assistant.rs` watches the change feed for `shell/apiEnabled`; the 30-second key check is only a fallback).
- A relayed action or MCP tool run that an open client had already picked up when the switch flipped finishes in that client, but its result is not returned to the caller: `POST /api/v1/tools/<name>` answers the `403` instead.
- Keys are kept while the API is off, and can still be made, listed and revoked in **Settings → API**. They work again once it is switched on.

## Keys

Make a key in **Settings → API** in the SpaceMIX app. Give it a name and pick its scopes; the token is shown **once**, when the key is made. The page also shows the base URL to call: the server's **Public address** if one is set in Settings, else the address this device reaches the server at, followed by `/api/v1`.

- A token looks like `opk_<id>_<secret>`: `<id>` is `k` plus 12 hex characters, `<secret>` is 32 hex characters. The server keeps only its SHA-256 and the first 12 characters (`prefix`), to tell keys apart.
- A key belongs to one account and acts as that account. Within its scopes it has every right the account has: it sees only the extensions the account may use (see [Who can use an extension](permissions.md#who-can-use-an-extension)), and **an owner's key acts as the owner**.
- Each person manages their own keys. The owner sees and may revoke everyone's.
- A key stops working when it is revoked or its account is removed. Open event streams and running assistant turns notice within 30 seconds.
- At most 50 keys per account, a name of 1 to 80 characters on one line, and at least one scope.

The app's Settings page manages keys through the session routes `POST /api/api-keys/list`, `POST /api/api-keys/create` (`{ name, scopes }`, answers `{ key, token }`) and `POST /api/api-keys/revoke` (`{ id }`). These need a signed-in session; an API key can't make or revoke keys.

### Scopes

Four areas, each with a read and a write scope. Each scope is picked on its own: a `:write` scope does **not** include its `:read`.

| Area | Scope | Allows |
|---|---|---|
| Extensions | `tools:read` | `GET /api/v1/tools`; running read-only tools (collection `list`/`get`, actions declared `readOnly`, MCP connection tools an admin marked read-only); read-only tools for the assistant. |
| Extensions | `tools:write` | Running every other tool, MCP tools included, without approval; every tool for the assistant. |
| Assistant | `assistant:read` | Listing and reading the account's own chats; listing its projects. |
| Assistant | `assistant:write` | Making chats and sending messages to the assistant. |
| Events | `events:read` | `events/list` and `events/stream`: every event in the team's log, payloads included. |
| Events | `events:write` | `events/emit`, from source `api`. |
| Notifications | `notifications:read` | The account's own notification center. |
| Notifications | `notifications:write` | Sending notifications from source `api`. |

## Requests and errors

- Send the key as `Authorization: Bearer <token>`. Nothing else carries a key: no cookies, no query parameter. Every other `/api` route ignores keys and stays session-only.
- Routes that take a JSON body through `POST` need `Content-Type: application/json` and a body (`{}` when there is nothing to say), except `tools/<name>` and the `assistant/*` routes, which read the raw body and take an empty one as `{}`.
- Any origin may call the API (CORS without credentials), so a browser can too; a token in a web page is readable by everyone who loads it.

Errors from SpaceMIX are JSON, `{ "error": "<message>" }`:

| Status | When |
|---|---|
| `401` | No key, a malformed one, or one that is revoked or whose account is gone: `Invalid API key.` |
| `403` | The API is switched off on this server: `The SpaceMIX API is switched off on this server.` (checked first, before the key; see [Switching the API on](#switching-the-api-on)). Or the key lacks the route's scope: `This key lacks the scope <scope>.` |
| `404` | An unknown tool, chat or project. |
| `400` | The request is wrong; the message says how. |
| `500` | `Something went wrong on the server.` The real error is only in the server's log. |

A body the server can't parse on the routes that take JSON is answered by the HTTP framework with `400`, `415` or `422` and a plain-text message.

## Who the key is

`GET /api/v1/me`, no scope. Answers `{ user, key }`: `user` is the account (`id`, `firstName`, `lastName`, `email`, `role`, `createdAt`, `groups`, `permissions`, `effective`, `createGated`) and `key` is the key as Settings shows it (`id`, `name`, `prefix`, `scopes`, `userId`, `userName`, `createdAt`, `lastUsedAt`). `lastUsedAt` is updated at most once a minute. `createGated` is `true`: this server enforces [`server:extensions` and `server:widgets` for creating](permissions.md#who-may-create-extensions-and-widgets).

## Tools

The same extension tools the assistant gets in the app, by the same names, schemas and validation (see [Giving the assistant data](../guide/giving-the-assistant-data.md) and [Tools](host/tools.md)), and the tools of the [MCP connections](mcp-connections.md) the account may use (`mcp:<id>` or `mcp:*`).

### `GET /api/v1/tools`

Scope `tools:read`. Answers `{ tools: [...] }`, one entry per collection and action tool of the extensions the account may use, then one per tool of the MCP connections the account may use that are turned on:

| Field | Type | Meaning |
|---|---|---|
| `name` | string | The tool name: `<ns>_<collection>_<op>`, `<ns>_<action>`, or `<connection id>_<tool>` for an MCP connection's. |
| `title` | string | Short label. |
| `description` | string | What it does, for a model. |
| `inputSchema` | object | The arguments' JSON schema, with the manifest's key order and `options` form hints. |
| `extensionId` | string | The extension it belongs to. Absent on an MCP connection's tool. |
| `connectionId` | string | Only on an MCP connection's tool: the connection's id. |
| `requiresApproval` | boolean | What the app's assistant would ask about. Reported only: the API never asks. |
| `readOnly` | boolean | `true` for collection `list`/`get`, actions declared `readOnly`, and MCP connection tools someone with `server:settings` marked read-only (`readOnlyTools`; the MCP server's own hints don't count). |
| `kind` | `"collection"`, `"action"` or `"mcp"` | Where it runs: collection tools and MCP connection tools on the server, actions in a SpaceMIX client (below). |

An MCP connection's tools are listed and run by this server, which lists each connection at most every 5 minutes; a connection that can't be listed is left out. A connection tool whose name is taken, or is under the namespace of an extension that may have MCP tools, is left out, as in the app's chat (see [MCP connections](mcp-connections.md#tools)). A [member's build](permissions.md#tool-names) comes after the connections and loses every clash.

An extension's own MCP tools are **not** listed: only a SpaceMIX client can list an extension's MCP servers. They can still be called by name (below).

Team Chat is the Chat extension (`ai.spacemix.chat`), not a part of the API of its own: an integration reads and posts in it through the extension's tools (`chat_conversations`, `chat_history`, `chat_send`, `chat_react`, `chat_create_channel`, …), the read-only ones under `tools:read` and the rest under `tools:write`. They are actions, so like every extension's actions they are relayed to one of the key owner's open SpaceMIX clients ([below](#actions-run-in-a-spacemix-client)).

### `POST /api/v1/tools/<name>`

Runs one tool as the key's account. The body **is** the tool's arguments as a JSON object (empty: `{}`), at most 256 KB.

- A read-only tool needs `tools:read`. Every other tool, and any name that isn't in the list (possibly an extension's MCP tool), needs `tools:write`.
- Arguments are validated against the tool's schema before anything runs: undeclared fields are refused, `required` is enforced, common slips are coerced. An MCP connection's tool is the exception: its arguments go to the MCP server as sent, checked only to be an object, and the MCP server checks them.
- Nobody is asked for approval, whatever `requiresApproval` says: the scope is that decision.

```sh
curl -s -X POST https://spacemix.example.com/api/v1/tools/tasks_items_create \
  -H "Authorization: Bearer $SPACEMIX_KEY" \
  -d '{"title":"Renew the certificate"}'
```

| Status | Body | When |
|---|---|---|
| `200` | `{ "result": <value> }` | The tool ran. `<value>` is what the assistant would get. |
| `422` | `{ "error": "<message>" }` | The tool itself failed: bad arguments, a missing record, an action that threw, an MCP connection that failed or answered `isError`, or a result whose only field is a string `error`. Also an action relayed to a client that doesn't have the extension yet: `The SpaceMIX client that took the call doesn't have <tool> yet; try again.` |
| `400` | `{ "error": … }` | The body isn't JSON. |
| `413` | plain text | The body is over 256 KB; the server's body limit refuses it before the tool is looked up. |
| `403` | `{ "error": … }` | The key lacks the scope this tool needs. |
| `404` | `{ "error": "There's no tool \"<name>\". Similar: a, b." }` | No such tool for this account (`… List the tools to see them.` when nothing is similar). A key with only `tools:read` gets `403` for an unknown name instead, because the scope check runs first and an unknown name needs `tools:write`. |
| `503` | `{ "error": "No SpaceMIX client is open for <name>. …" }` | An action or an extension's MCP tool, and none of the person's SpaceMIX windows or browser tabs is open. |
| `504` | `{ "error": "<name>'s SpaceMIX client didn't finish <tool> within 90 seconds; it may still have run." }` | The client took the call and didn't answer in time. |
| `429` | `{ "error": … }` | Too many relayed calls of this person's are waiting, or were started in the last minute. |

### Actions run in a SpaceMIX client

Collection tools run entirely on the server, against the record store, and record their `<collection>_created`, `_updated` and `_deleted` events as in the app. MCP connection tools run on the server too: it makes the request to the MCP server itself. Actions and an extension's MCP tools are JavaScript in the extension's sandboxed frame, so the server can't run them itself. It **relays** the call to one of the key owner's open SpaceMIX clients (the desktop app or a browser tab signed in as that person):

1. The server announces the run to that person's clients only, without the arguments.
2. The first client to claim it within **5 seconds** gets the call. Nobody claims: `503`, at once.
3. The client runs the action in its frame (the action's own limit is the host's 60 seconds, see [Actions](host/actions.md#errors)) and posts the result back. No answer within **90 seconds**: `504`.

A `504` does **not** mean the action didn't run: it may have finished after the server stopped waiting. Retry only actions that are safe to run twice.

The action receives `ctx.via = { extension: "ai.spacemix.api", extensionName: "SpaceMIX API", label: "<key name>" }` (see [`ctx.via`](host/actions.md#ctxvia-who-is-behind-the-call)). An extension's MCP tool is relayed only when its name starts with the namespace of an installed extension that has a `net:` permission, that the account may use and that is not turned off; a client that doesn't find it makes it a `404`.

## Assistant

The assistant runs on the server: an integration sends a message and the whole turn (the model call, the tool loop, saving every message) runs there, with no SpaceMIX client open. The chats are the account's own chats, in the same tables as the app's: a chat made through the API shows in the app's chat list, and a chat started in the app can be continued through the API. A reply being written shows live in an open window.

How a turn runs:

- **Model.** The chat's pinned model, else the server's default connected model (**Settings → Models**). With none connected, `409` `No model connected yet. Open Settings → Models to connect one.` An OpenAI-compatible model runs the tool loop on the server; a CLI agent runs one turn with SpaceMIX's tools on its bridge. A [SpaceMIX Hub model](hub-models.md) runs the same loop through SpaceMIX Hub, billed to the server's credit, and only for an account with `server:hubModels`: without it the message is refused with `403` `You don't have permission to use SpaceMIX Hub models on this server. Ask someone who manages members.` before the turn starts.
- **Tools follow the `tools:*` scopes.** The model gets the account's extension tools and the tools of the MCP connections it may use. Without `tools:read` or `tools:write` it gets no tools. With `tools:read` it gets only read-only ones (for an MCP connection, only the tools marked read-only). With `tools:write` it gets all of them. **Nobody is asked to approve a call**, ever: the scope is that decision, and the system prompt tells the model so. Actions are relayed as above, with `ctx.via` naming the key.
- **Tools on demand.** An OpenAI-compatible model (a SpaceMIX Hub model too) isn't sent every tool on every call. The system prompt has the catalogue of the tool groups the key allows, one line per extension and per MCP connection; each call carries `tools_load`, `tool_result_read` and the `material_*` tools, then the groups of the extensions the chat's project links to, then the groups the chat loaded, each group's tools sorted by name. `tools_load` adds groups from the next call on, calling a tool whose group isn't loaded loads it and runs it, and the loaded groups stay on the chat (field `toolGroups`, at most 12), shared with the app. A CLI agent gets every tool the key allows at once, plus `tool_result_read` and the `material_*` tools. The rules, the same as the app's, are in [How the assistant gets its tools](../agents.md#how-the-assistant-gets-its-tools) (`apps/desktop/src-tauri/src/assistant.rs`, `tools.rs`). `GET /api/v1/tools` still lists every tool.
- **Long results.** Each tool result is stored on its message whole, up to 256 KB, and at most 1 MB of one turn's results are stored whole (past it, a long result keeps only its structured view). The model gets it whole in the turn that made it, or a structured view when it is over 12,000 characters, and a digest in later turns when it is over 1,500; `tool_result_read` reads past either. See [What the model sees of tool results](../agents.md#what-the-model-sees-of-tool-results) (`apps/desktop/src-tauri/src/tool_results.rs`).
- **Materials.** The tables in an extension's or connection's result become the chat's materials, listed at the end of the system prompt and read with `material_query`, as in the app. `material_refresh` runs only a read-only tool the key still gives the model. See [Materials](../agents.md#materials) (`apps/desktop/src-tauri/src/materials.rs`).
- **What's not there.** SpaceMIX's own client-side tools (`widget_*`, `dashboard_*`, `extension_*` and `project_*`) don't exist on the server and aren't offered. Studio chats (a widget's or an extension's) can be read but not sent to: `409`.
- **Projects.** In a chat inside a project, the prompt names the project, its instructions and its linked items, as in the app; a linked record's read tool is named only when the key gives the model that tool. See [Projects](projects.md#the-assistant).
- **The system prompt** is the app's (`apps/desktop/prompts/`), plus a paragraph saying the message comes through the SpaceMIX API from a program connected with the named key and that nobody is looking at a screen.
- **One turn per chat** at a time: a second is refused with `409` `This chat is already replying.`, not queued. A reply the app is writing in a window doesn't hold the chat.
- A turn stops after 25 tool steps (`MAX_STEPS` in `apps/desktop/src-tauri/src/assistant.rs`, with the notice `Stopped after 25 tool steps. Send another message to let it continue.` in the chat), after 10 minutes, when the caller disconnects, or when the key is revoked. Tools still running are then marked interrupted.

### `GET /api/v1/assistant/chats`

Scope `assistant:read`. Answers `{ chats: [...] }`, latest activity first. Studio chats are left out unless `?all=1`. A chat is `{ id, title, renamed?, projectId?, modelId?, model?, widget?, extension?, createdAt, updatedAt }` (milliseconds).

### `POST /api/v1/assistant/chats`

Scope `assistant:write`. Body `{ title?, projectId? }`. Makes an empty chat and answers `{ chat }`. A given `title` (at most 200 characters, whitespace collapsed) counts as the person's own name for the chat, so the first message doesn't retitle it. An unknown `projectId` is `404` `There's no project with that id.`

### `GET /api/v1/assistant/chats/<id>`

Scope `assistant:read`. Answers `{ chat, messages, materials }`. A message is `{ id, role, text, error?, toolCalls?, tool?, stats?, createdAt }`; `role` is `user`, `assistant`, `tool` or `notice`. A tool message's `tool` has `callId`, `name`, `title`, `args`, `status` and, once it ran, `result`: the result as stored, at most 256 KB (see [Long results](#assistant)). `materials` are the chat's [materials](../agents.md#materials), pinned first, then newest, each `{ id, name, source, rows, columns, fetchedAt, pinned }`: `id` is its id in the chat (`M3`), `source` is `{ kind, tool?, args?, callId?, messageId?, originMessageId?, path?, from?, query?, file? }` (`originMessageId` is the tool message that first made the material, kept across refreshes) with `kind` `tool`, `query` or `user`, `rows` its row count, `columns` `[{ name, type }]`, `fetchedAt` in milliseconds; an empty list for a chat without any. The rows themselves aren't in the answer. Another person's chat id is `404` `There's no chat with that id.`

### `GET /api/v1/assistant/projects`

Scope `assistant:read`. Answers `{ projects: [{ id, name }] }` in the app's order, for `projectId`.

### `POST /api/v1/assistant/chats/<id>/messages` and `POST /api/v1/assistant/messages`

Scope `assistant:write`. Body `{ text }` for a chat by id, or `{ text, chatId? }` on `/assistant/messages`, which makes a new chat without `chatId`. `text` is 1 to 100,000 characters after trimming; the body is at most 512 KB. A new chat takes its title from the first message.

Without `?stream=1` the response comes when the turn is done:

| Status | Body | When |
|---|---|---|
| `200` | `{ chat, reply, messages }` | The turn finished. `reply` is the last assistant message, `{ id, text, error? }`; `messages` is every message this turn added, the user's first. |
| `502` | `{ chat, reply, messages, error }` | The model call failed. `error` (also the reply's text) gives only the HTTP status or that the model was out of reach, never its address or the provider's body. For a SpaceMIX Hub model it is SpaceMIX Hub's own sentence instead, such as `This server's SpaceMIX Hub credit is used up. Someone who manages settings can top it up in Settings → Models.` (see [Errors](hub-models.md#errors)). |
| `504` | `{ chat, reply, messages, error }` | The turn ran out of time (10 minutes). |
| `401` | `{ chat, reply, messages, error }` | The key was revoked during the turn: `Stopped: the API key was revoked.` |
| `403` | `{ chat, reply, messages, error }` | The API was switched off during the turn: `The SpaceMIX API is switched off on this server.` |
| `403` | `{ error }` | The chat's model is a SpaceMIX Hub model and the key's account lacks `server:hubModels`. |
| `400` | `{ error }` | `Give the message some text.`, `Keep a message under 100000 characters.`, or a body that isn't a JSON object. |
| `404` | `{ error }` | No such chat. |
| `409` | `{ error }` | The chat is already replying, no model is connected, or it's a Studio chat. |
| `429` | `{ error }` | `Too many assistant turns are running.` |

A turn may take minutes, and a reverse proxy in front of the server may cut a long silent response. Use `?stream=1` for anything but short questions.

```sh
curl -s -X POST https://spacemix.example.com/api/v1/assistant/messages \
  -H "Authorization: Bearer $SPACEMIX_KEY" \
  -d '{"text":"Which tasks are due this week?"}'
```

### Streaming

With `?stream=1` the response is `application/x-ndjson`: one JSON object per line, as the turn happens. Errors found before the turn starts (`400`, `404`, `409`, `429`) are still ordinary responses with a status.

| `type` | Fields | Meaning |
|---|---|---|
| `delta` | `text` | More of the reply's text. |
| `toolCall` | `id`, `name`, `arguments` | The model calls a tool; `arguments` is the JSON string it wrote. |
| `toolResult` | `id`, `status` (`done` or `error`), `result` | The tool's result as the model gets it, a string: the result itself, or its structured view when it is over 12,000 characters. The whole result is on the tool message in `messages`. |
| `done` | `chat`, `reply`, `messages` | The last line of a turn that finished. |
| `error` | `message`, and `chat`, `reply`, `messages` when the turn had started | The last line of a turn that failed or was stopped. |

```sh
curl -sN -X POST "https://spacemix.example.com/api/v1/assistant/chats/$CHAT/messages?stream=1" \
  -H "Authorization: Bearer $SPACEMIX_KEY" \
  -d '{"text":"Summarise the open support tickets."}'
```

Closing the connection stops the turn.

## Events

### `POST /api/v1/events/emit`

Scope `events:write`. Body `{ type, payload?, summary?, target? }`; answers the event as stored ([`SpacemixEvent`](host/events.md)). An event from the API **never speaks for an extension**:

- Its `source` is always `api`. Leave `source` out (or send `"api"`); any other value is `400` `Through the API the source is always "api", not "<source>"; leave it out.` So a key can't trigger an automation listening for an extension's events.
- `type` is free, but snake_case like any event's: a lowercase letter first, then lowercase letters, digits and `_`, at most 64 characters.
- `payload` is any object, not checked against a schema, at most 16 KB as JSON. Its `via` field is set to `{ "apiKey": "<key name>" }`, replacing any `via` you sent.
- `summary`: one line, at most 280 characters after cleaning; `target`: at most 512 characters, no control characters.
- `by` is the key's account.

### `POST /api/v1/events/list`

Scope `events:read`. Body: an `EventQuery`, `{ source?, type?, after?, before?, limit? }` (send `{}` for the latest). Answers an array of events, newest first; `limit` defaults to 50, at most 500. The log is the team's: every extension's events and every key's. Retention and paging are as in [`host.events.list`](host/events.md#hosteventslist).

### `GET /api/v1/events/stream`

Scope `events:read`. Server-sent events: one `event` event per new event recorded, its data the event as JSON. A client that falls too far behind gets a `resync` event and should catch up with `events/list`. At most 5 open streams per key (another is `429` `Too many open streams for this key.`). Every 30 seconds the stream checks that its key and account still exist, and ends when either is gone. It ends at once when the API is switched off.

```sh
curl -sN https://spacemix.example.com/api/v1/events/stream -H "Authorization: Bearer $SPACEMIX_KEY"
```

## Notifications

### `GET /api/v1/notifications`

Scope `notifications:read`. Answers the key's account's own notification center as an array, newest first: `{ id, source, kind, text, target, from, createdAt, read }`.

### `POST /api/v1/notifications/send`

Scope `notifications:write`. Body `{ text, target?, to? }`; answers `{ sent }`.

- The `source` is always `api`, with no kind (a `kind` in the body is ignored; a `source` other than `"api"` is `400`). `from` is the key's account.
- `text` follows the notification rules: one line of plain text, 1 to 280 characters after cleaning.
- `target`: at most 512 characters. It is kept on the notification for API callers to read back; the app can't open anything with it.
- `to`: 1 to 50 account ids (the key's own is `user.id` from `/me`). Omit it to notify only the key's account.

In the app the notification shows under the name **API**. It isn't an extension's: clicking it only marks it read, and no extension's `markRead` touches it. See [Notifications](host/notifications.md).

## Limits

| What | Limit |
|---|---|
| Keys per account | 50 |
| Key name | 1 to 80 characters, one line |
| `tools/<name>` body | 256 KB |
| Relayed call: claimed by a client | within 5 seconds, else `503` |
| Relayed call: answered | within 90 seconds, else `504` |
| Relayed calls waiting, per person | 16, else `429` |
| Relayed calls started, per person | 60 a minute, else `429` |
| An action in its frame | 60 seconds (the host's) |
| Assistant message | 1 to 100,000 characters; body at most 512 KB |
| Assistant chat title | 200 characters |
| Assistant turns at once | 3 per key, 3 per account, 16 per server, else `429` |
| Assistant turn | 10 minutes, 25 tool steps |
| Turns per chat | 1 at a time, else `409` |
| Event streams | 5 per key, key checked every 30 seconds |
| Event payload / summary / target | 16 KB / 280 characters / 512 characters |
| Notification text / target / recipients | 280 characters / 512 characters / 50 |

## How the API differs from the app

- **No approval prompts.** A `tools:write` key runs tools declared `requiresApproval` (and collection operations in `requireApproval`) without asking anyone. Give a key `tools:write` only where that is what you want.
- **An extension's MCP tools are callable but not listed.** `GET /api/v1/tools` lists collection and action tools and the MCP connections' tools, not the MCP tools an extension's `mcp(host)` returns.
- **MCP connection tools never ask.** In the app's chat a connection tool not marked read-only asks first (unless the connection runs without asking); through the API the key's scope decides: `tools:read` runs only the ones marked read-only, `tools:write` all of them.
- **Tool names aren't filtered against SpaceMIX's own.** In the app, an extension tool with the exact name of one of SpaceMIX's own tools is left out of chats; the API has none of those tools, so it lists and runs such a tool.
- **Owner keys act as the owner**, with every right the owner has within the key's scopes.
- **Actions need an open client.** Collection tools, MCP connection tools and the assistant work with nobody signed in; actions and an extension's MCP tools need one of the person's SpaceMIX windows open.

## Stability

Experimental: new, and not yet exercised by many integrations. The routes, scopes and shapes above are expected to stay under `/api/v1`; limits may change.
