Build

API and MCP

Workspace API keys, the REST API and the MCP server for your customers' agents.

01API keys

Workspace owners create keys at /dashboard/api-keys with two scopes: read (workspace and documents) and ai (spends credits). Keys are hashed, can expire or be revoked, and are limited to 120 requests a minute each.

02REST API

MethodPathScope
GET/api/v1/workspaceread
GET/api/v1/documentsread
POST/api/v1/documents/searchread (1 credit per search)
POST/api/v1/ai/generateai
Terminal
curl https://your-app.com/api/v1/workspace \
  -H "Authorization: Bearer sk_..."

The OpenAPI spec is served at /api/v1/openapi.json.

03MCP server

/api/mcp exposes the same operations to Claude, ChatGPT or Cursor with the same key: get_workspace, list_documents, search_documents and, with the ai scope, generate_text. Add new operations in features/api/server/operations.ts and features/api/openapi.ts; both surfaces pick them up.