Skip to content

Stream an assistant reply for an existing conversation (SSE).

POST
/api/advisor/conversations/{id}/messages/stream
curl --request POST \
--url https://api.tradr.cloud/api/advisor/conversations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages/stream \
--header 'Content-Type: application/json' \
--data '{ "attachments": [ { "dataBase64": "example", "format": "png", "type": "image" } ], "clientMessageId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "personaId": "example", "text": "example" }'

Sends a user message to an existing conversation and streams the assistant reply as Server-Sent Events. Frames: event: token ({delta}), event: usage ({promptTokens, completionTokens}), event: done ({messageId, deduped?, source?}), event: error ({code, upstreamStatus, message}). Pre-stream failures return a JSON error envelope (no SSE) with the appropriate HTTP status. Rate limited to 30 requests per 60 s.

id
required
string format: uuid
Media typeapplication/json
object
attachments
Array<object>
<= 4 items
object
dataBase64
string
<= 4500000 characters
format
string
Allowed values: png jpeg webp
type
string
Allowed values: image
clientMessageId
required
string format: uuid
personaId
string
text
required
string
>= 1 characters <= 50000 characters

Server-Sent Event stream.

Media typetext/event-stream
string

Validation / image / cap error envelope (IMAGE_TOO_LARGE above the per-image byte cap).

Platform billing refusal — INSUFFICIENT_CREDITS / ALLOWANCE_EXHAUSTED (allowance model + allowance and credits exhausted) / INSUFFICIENT_CREDITS_ALLOWANCE_AVAILABLE (non-allowance model + free allowance turns remain) / MODEL_NOT_AVAILABLE / BILLING_NOT_AVAILABLE.

Monthly advisor image quota exceeded for the user’s tier (TIER_LIMIT_IMAGES) — text-only turns unaffected.

Conversation not found (or not owned).

Request body exceeds the byte-cap floor (PAYLOAD_TOO_LARGE).

Stream in progress

Provider-key decryption failure.