Use this endpoint to submit a model input and output pair to a workflow for evaluation with streaming responses.
By default, when you submit a workflow event, the response is delivered all at once after processing completes. Streaming lets you start receiving outputs immediately, before processing is entirely finished — perfect for chat interfaces or any application where perceived latency matters.
Add stream=true to your request, and you’ll receive a stream of Server-Sent Events instead of a single JSON response.
Streaming is supported on all run modes except precision_max and precision_max_codex.
Note: ultra_fast and super_fast do not support Web Search or File Search. If your workflow has these capabilities enabled, either switch to a run mode that supports them (e.g. fast, precision, precision_codex) or edit the workflow to disable Web Search / File Search.
Defend evaluates the model output against your workflow’s guardrails. If the output passes, it streams back the original. If it fails, Defend improves it and streams back the improved version. Either way, you receive a single stream of token events containing the final output — just forward them to your end-user.
– token: These are the output chunks. Stream them directly to your end-user as they arrive.
– error: This means something went wrong, and will include a message.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the workflow to create the event for.
Enable SSE streaming for real-time token feedback. Supported on all run modes except precision_max and precision_max_codex.
The input provided to the model (e.g., prompt, messages).
The output generated by the model to be evaluated.
The model that generated the output (e.g., "gpt-4", "claude-3").
The evaluation run mode. Streaming is supported on all run modes except precision_max and precision_max_codex. Note: ultra_fast and super_fast do not support Web Search or File Search — if your workflow has these enabled, use a different run mode or disable the capability on the workflow.
ultra_fast, super_fast, fast, precision, precision_codex Optional tag to identify this event.
A stream of Server-Sent Events delivering the output directly to your end-user.
Each event has an event: type and a data: JSON payload. You'll receive:
– token — Output chunks. Stream these directly to your end-user as they arrive. If the original output passed all guardrails, the tokens contain the original. If improvement was needed, the tokens contain the improved version. Either way, you should forward them.
– error — This means something went wrong and includes a message field.
The response is of type string<sse>.