One turn of a Compose-with-Nu drafting conversation.
Nu helps the user draft a message for a specific chat. The client sends the drafting conversation so far (`messages`, oldest first); the server reads the target chat for context and tone and returns Nu's commentary (`text`) plus, when it has one, a `proposal` — the message Nu suggests posting. Nothing is posted; the user decides whether the proposal reaches their composer. Requires `canAiComposeMessage` on the workspace, an active subscription, the `ai` capability, `aiComposeEnabled` (and `aiComposeAllowReviewer` for reviewers) and sufficient balance — see the AI overview. The caller must also be able to read `chatId`, so you can only compose into a chat you can already read. Caps: 1–40 turns; each turn's `text` / `proposal` ≤ 4000 characters.
Nu helps the user draft a message for a specific chat. The client sends
the drafting conversation so far (messages, oldest first); the server
reads the target chat for context and tone and returns Nu's commentary
(text) plus, when it has one, a proposal — the message Nu suggests
posting. Nothing is posted; the user decides whether the proposal
reaches their composer.
Requires canAiComposeMessage on the workspace, an active
subscription, the ai capability, aiComposeEnabled (and
aiComposeAllowReviewer for reviewers) and sufficient balance — see
the AI overview. The caller must also be able to read chatId, so
you can only compose into a chat you can already read.
Caps: 1–40 turns; each turn's text / proposal ≤ 4000 characters.
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/ai/compose" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c", "chatId": "f255124e-3419-4f6e-b7ee-17a6577db94d", "messages": [ { "role": "user", "text": "string" } ] }'{ "text": "Here's a short version you could post:", "proposal": "Heads up — the review has moved to Thursday. Same time, same link.", "billedCredits": 4, "balanceAfter": 9993, "eventId": "0193e4a1-b2c3-7000-8000-00000000abcd"}