Create a new chat session and start building with AI
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer macaly_... |
Content-Type | Yes | application/json |
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
content | string | Yes | - | The user’s message/prompt |
stream | boolean | No | true | If false, returns JSON instead of stream |
backend | string | No | "DEFAULT" | Backend to use |
executionMode | "auto" | "planning" | "build" | No | - | Controls how the AI approaches the task |
model | "sonnet-4-5" | "sonnet-4-6" | "opus-4-5" | "opus-4-6" | No | - | AI model to use. Defaults to team’s configured model |
reasoningEffort | "medium" | "high" | No | - | Controls how deeply the AI reasons about the task |
experimental_attachments | array | No | [] | File attachments (see format below) |
experimental_attachments array has the following structure:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL of the file to attach |
name | string | No | Display name for the attachment |
contentType | string | No | MIME type of the file |
stream: false)| Field | Type | Description |
|---|---|---|
chatId | string | The unique chat identifier |
url | string | Direct URL to view the chat |
streamId | string | undefined | Stream identifier for subscribing. Only present for workflow backends |
assistantMessageId | string | undefined | ID of the assistant message being generated. Only present for workflow backends |
stream: true, default)2:[{"chatId":"..."}].
| Status | Description |
|---|---|
| 200 | Success - Chat created |
| 400 | Invalid request body |
| 401 | Invalid or missing API key |
| 402 | Insufficient credits |
| 403 | Forbidden - No permission for the specified team |
| 422 | Validation error |
| 429 | Rate limited |
| 500 | Server error |
GET /api/chat/{chatId}/statusGET /api/chat/{chatId}/subscribe for real-time updatesPOST /api/chat/{chatId}/publish