API Reference
Chat completions
Generate responses with the Disruptive Rain chat engine, with optional SSE streaming.
POST
/v1/chat/completionsRequires chat:send entitlement. Use stream: true to receive SSE events.
Request body
| Field | Type | Notes |
|---|---|---|
| input.text | string | Required prompt text. |
| conversationId | string | Optional; generated if omitted. |
| messageId | string | Optional; generated if omitted. |
| stream | boolean | Enable SSE streaming. |
| avatar | boolean | Enable avatar-specific processing. |
| cot | boolean | Toggle chain-of-thought processing. Internal reasoning chunks are filtered from output. |
| retry.ofMessageId | string | Retry a specific message ID. |
| retry.attempt | number | Retry attempt counter. |
| schedule.cron | string | Optional cron schedule for deferred execution. |
| schedule.notBeforeEpochMs | number | Earliest execution timestamp (epoch ms). |
| schedule.deadlineEpochMs | number | Deadline for the request (epoch ms). |
| schedule.priority | number | Priority level for scheduling. |
curl https://<gateway-host>/v1/chat/completions \
-H "Authorization: Bearer $DISRUPTIVERAIN_CLIENT_ID:$DISRUPTIVERAIN_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"conversationId": "conv_001",
"messageId": "msg_001",
"input": {"text": "Draft a status update for leadership."},
"stream": false,
"avatar": false,
"cot": false
}'Query parameter
You can also supply
?stream=true as a query parameter.Response
Non-streaming responses include the full output text, usage totals, and captured chunks from the upstream stream.
{
"conversationId": "conv_001",
"messageId": "msg_001",
"createdAt": "2024-01-01T00:00:00.000Z",
"output": { "text": "Here is a concise leadership update..." },
"usage": {
"inputTokens": 18,
"outputTokens": 74,
"totalTokens": 92
},
"chunks": []
}Streaming
SSE streams emit chunk events with partial tokens, followed by a done event that includes usage totals.
curl -N https://<gateway-host>/v1/chat/completions \
-H "Authorization: Bearer $DISRUPTIVERAIN_CLIENT_ID:$DISRUPTIVERAIN_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"input": {"text": "Stream the response with SSE."},
"stream": true
}'Was this page helpful?