API Reference

Chat completions

Generate responses with the Disruptive Rain chat engine, with optional SSE streaming.

POST/v1/chat/completions

Requires chat:send entitlement. Use stream: true to receive SSE events.

Request body

FieldTypeNotes
input.textstringRequired prompt text.
conversationIdstringOptional; generated if omitted.
messageIdstringOptional; generated if omitted.
streambooleanEnable SSE streaming.
avatarbooleanEnable avatar-specific processing.
cotbooleanToggle chain-of-thought processing. Internal reasoning chunks are filtered from output.
retry.ofMessageIdstringRetry a specific message ID.
retry.attemptnumberRetry attempt counter.
schedule.cronstringOptional cron schedule for deferred execution.
schedule.notBeforeEpochMsnumberEarliest execution timestamp (epoch ms).
schedule.deadlineEpochMsnumberDeadline for the request (epoch ms).
schedule.prioritynumberPriority 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?