client.Stream return EventStream<T> (IAsyncEnumerable<T> and IAsyncDisposable). Use await using with await foreach so the HTTP connection closes when you exit the loop.
Filtered and sampled streams
Keep-alive and idle timeout
The X API sends a blank-line heartbeat about every 20 seconds. SetIdleTimeout (e.g., TimeSpan.FromSeconds(60)) and ReconnectOnClose = true on StreamOptions to recover silently stalled or closed connections, and OnKeepAlive to observe heartbeats: