Skip to content

Developer Reference

Streaming Chat API Reference

Query your AI agent programmatically and stream answers with exact citation footnotes.

POST/api/chat/stream

Streams tokens via Server-Sent Events (SSE) while performing real-time MongoDB Atlas Vector Search retrieval.

Request Body (JSON)

{ "botId": "65e8a1f2b3c4d5e6f7a8b9c0", "message": "What is the return policy duration?", "conversationId": "optional-session-id" }

Streaming SSE Events

data: {"event":"citations","citations":[{"title":"Return_Policy.pdf","pageNumber":4,"confidenceScore":0.92}]} data: {"event":"token","text":"Returns "} data: {"event":"token","text":"are accepted within 30 days."} data: {"event":"done"}

Your next great answer starts here.

Bring your content. Build an assistant that knows it.