Streaming AI Responses in Laravel with Server-Sent Events A developer upgraded a Laravel AI chatbot to stream responses using Server-Sent Events (SSE), leveraging Laravel 11's built-in `response()->eventStream()` method. The approach eliminates the 5-second wait for full completion by showing tokens as they arrive, improving perceived performance without extra infrastructure like WebSockets. The implementation uses the OpenAI PHP client's `createStreamed()` method and requires releasing the session lock to prevent blocking other requests. In the first post of this series https://dev.to/adityakdevin/adding-an-ai-chatbot-to-your-laravel-app-with-the-openai-api-177f we built a working AI chatbot in Laravel. It had one problem every user notices immediately: you send a message, then stare at a spinner for five seconds while the whole response generates. LLMs produce text token by token. If you wait for the full completion before showing anything, you're throwing away the single biggest UX win available: streaming . The same answer that takes 5 seconds to finish starts appearing in ~300ms when streamed. Nothing about the model got faster — but to the user, it feels 10x faster. In this post we'll upgrade the chatbot to stream responses with Server-Sent Events SSE — no WebSockets, no Pusher, no extra infrastructure. Just Laravel. WebSockets are bidirectional and need a long-running server Reverb, Soketi or a paid service. For chat completions you only need one direction : server → browser, for the lifetime of one request. That's exactly what SSE is for, and since Laravel 11 it's built into the framework as response - eventStream . Rule of thumb: presence, typing indicators, multiplayer → WebSockets. Streaming one AI answer → SSE. We keep the ChatService from part 1 and add a streaming method. The openai-php client exposes createStreamed , which returns an iterator of deltas: php