> For the complete documentation index, see [llms.txt](https://wong-coupon.gitbook.io/flutter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wong-coupon.gitbook.io/flutter/my-ai/chat-realtime.md).

# Chat & Realtime

AI Chat connections, subscription ownership, typed events, streaming, and message reconciliation.

AI Chat connections, subscription ownership, typed events, streaming, and message reconciliation.

## Articles

* [AI Chat with REST and WebSocket](/flutter/my-ai/chat-realtime/ai-chat-rest-websocket.md) — Separate REST reconciliation from realtime delivery with typed ownership, ambiguity, and recovery boundaries.
* [Subscription Lifecycle for AI Chat](/flutter/my-ai/chat-realtime/subscription-lifecycle-ai-chat.md) — Coordinate readiness, ref-counted consumer leases, reconnect generations, and terminal authentication policy.
* [Typed Events for Realtime AI](/flutter/my-ai/chat-realtime/typed-events-realtime-ai.md) — Parse untrusted realtime data into a versioned, bounded event union before reducers or telemetry can consume it.
* [Streaming Reducers for AI Chat](/flutter/my-ai/chat-realtime/streaming-reducers-ai-chat.md) — Order, deduplicate, bound, and reconcile streamed deltas without letting late frames reopen terminal state.
* [Reconciling Messages in AI Chat](/flutter/my-ai/chat-realtime/optimistic-realtime-history-reconciliation.md) — Reconcile optimistic entities, realtime publications, and REST history through exact aliases and atomic authority checks.

[Buy Me a Coffee](https://buymeacoffee.com/ducmng12g) | [Support Me on Ko-fi](https://ko-fi.com/I2I81AEJG8)
