ComposeBeta

Compose API

Artifact creation, storage, and sharing — compose.casa

Authentication

Pass your API key via header:

X-Compose-Key: ck_xxxxxxxxxxxx

Or Bearer token:

Authorization: Bearer ck_xxxxxxxxxxxx

Endpoints

POST /api/create

Create a new artifact.

{
  "content": "# Hello World",
  "title": "My Document",
  "content_type": "text/markdown",
  "metadata": {}
}

Returns: { "id": "abc12345", "url": "https://compose.casa/v/abc12345" }

GET /api/{id}

Retrieve an artifact by ID. Returns full content, metadata, and version info.

PUT /api/{id}

Update an artifact. Creates a new version. Body same as create.

GET /api/{id}/versions

List all versions of an artifact.

GET /api/{id}/answers

Answers to the artifact's questions. No auth: anyone with the link can read them.

PUT /api/{id}/answers

Save one answer. No auth: anyone with the link can answer, like a shared doc.

{ "key": "q1-001", "question": "Keep Customize hidden?", "answer": "Yes", "name": "optional" }

To ask questions, put them in an html or canvas artifact as <ol data-questions><li>…</li></ol>. Each question gets an answer box under it that saves as the reader types. Add data-question="key" to an item to keep its answer attached if the list is reordered later. Readers can add their own questions under the first list (an empty <ol data-questions></ol> takes questions only from people). The creator gets one email listing every answer once answers stop coming in for two minutes.

POST /api/{id}/comments

Add a comment to the artifact's conversation. No auth.

{ "body": "Option B reads best", "name": "optional" }

GET /api/{id}/votes

Vote totals per card. ?voter= marks the cards that voter token voted for. POST casts or updates a vote ({ "key", "title", "voter", "note", "name" }); DELETE ?voter=&key= takes it back. No auth.

GET /api/{id}/conversation

Every published version, question, answer, comment and vote, oldest first.

POST /api/artifacts/{id}/push-to-porter

Queue the live version for your own Porter inbox workspace (porter.onl). Signed in only: your key's account email, or an AuthGate token. GET /api/artifacts/{id}/porter-status shows queued / sent (with the Porter URL) / failed. Also the MCP tool push_to_porter, or "metadata": {"porter_push": true} on create. Canvases are pushed baked: one static board per frame.

Frames (figure.frame or [data-frame]) get Expand, Download and a yellow Vote. data-play="url" adds Play, which opens the live design. data-full on a frame's image holds its full-resolution version. Full guide: docs/authoring-canvases.md in the repo.

GET /api/list

List recent artifacts. Query: ?limit=20

GET /api/keys

List API keys for the authenticated user (admin sees all).

POST /api/keys

Create a new API key (admin only).

{ "tier": "free", "owner": "[email protected]" }

DELETE /api/keys/{key}

Revoke an API key (admin only).

GET /api/og/{id}

Dynamic OG image (SVG) for social sharing previews.

GET /api/health

Health check. Returns { "status": "ok" }

Views

PathDescription
/v/{id}Rendered viewer with metadata
/raw/{id}Raw content (plain text)
/embed/{id}Embeddable iframe view

Rate Limits

TierArtifacts/dayMax size
free50256 KB
pro5002 MB
enterpriseunlimited10 MB

MCP Server

Compose is available as an MCP tool server:

HTTP:  compose.casa/mcp
Stdio: /opt/axecloud-mcp/compose-mcp

Tools: compose, canvas, recall

AXE Technologies — compose.casa