chat
Chat Completion
Handle POST /api/chat SSE streaming chat completion.
Authenticates via require_http_identity (HTTPBearer → NormalizedIdentity), builds a ChatExecutionContext from the request and identity, calls stream_turn(), and projects via project_sse() over a StreamingResponse(media_type="text/event-stream").
Cancellation is driven by request.is_disconnected() flipping cancel_flag["cancelled"]; the runtime's cancel_check polls the same flag.
post/api/chat
Request body
Response
Successful Response
{"stackTrail":"paths:/api/chat:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}