MfC#
Microsoft Agent Framework (.NET) — Streaming Server
Where to find the .NET streaming examples: your own server-sent-events endpoint with AIHostAgent and a session store, the OpenAI Responses streaming endpoint, AG-UI and A2A streaming.
The streaming examples that used to be on this page are now part of the hosting page, checked against Microsoft.Agents.AI 1.28.0 (2026-11-19):
- Your own streaming endpoint: a minimal ASP.NET Core route that forwards
RunStreamingAsyncdeltas as server-sent events, and keeps each conversation in a session store withAIHostAgentinstead of creating a new session per request. - OpenAI-compatible endpoints:
MapOpenAIResponsesstreams Responses API events ("stream": true) to any OpenAI client. - AG-UI:
MapAGUIServerstreams AG-UI events for CopilotKit and other front ends. - A2A: streaming between agents over the A2A protocol.
The essentials of a hand-written SSE endpoint, which that section shows in full: set Content-Type: text/event-stream, flush after each data: line, pass HttpContext.RequestAborted into RunStreamingAsync so a closed tab cancels the model call, skip updates whose Text is empty (tool calls and usage), and save the session after the stream ends. Streaming workflows, as opposed to agents, are on the workflows page.