Docs/WebSocket Chat

WebSocket Chat

Real-time streaming chat powered by Claude. Supports conversation history, model selection, and custom system prompts.

WebSocket URL
wss://p417pa2mu2.execute-api.us-east-1.amazonaws.com/prod?token=<idToken>
🔑 Connect by appending your idToken as a query parameter: ?token=<idToken>

Send Message

SEND

sendMessage

WebSocket

Send a chat message to get a streaming AI response.

Payload

action"sendMessage"
questionThe user's message/question
knowledgeDbIdKnowledge base context
model_id"basic" (default model)
system_promptOptional system prompt
// Send message
{
  "action": "sendMessage",
  "question": "What are the key findings?",
  "knowledgeDbId": "kb_abc123",
  "model_id": "basic"
}

Response Events

start

AI has started generating a response.

{ "type": "start" }
chunk

A piece of the streaming response text.

{ "type": "chunk", "text": "Based on..." }
end

The response is complete.

{ "type": "end" }
error

An error occurred during processing.

{ "type": "error", "error": "Rate limit" }
history

Response to load_history action.

{ "type": "history", "messages": [...] }
clear_complete

Conversation history was cleared.

{ "type": "clear_complete" }

Other Actions

load_history

Load conversation history with pagination.

{ "action": "load_history", "knowledgeDbId": "kb_abc123", "start": 0, "end": 50 }

clear_conversation

Clear all conversation history for a knowledge base.

{ "action": "clear_conversation", "knowledgeDbId": "kb_abc123" }

Live Test

Disconnected
No messages yet. Connect and send a message to start.