Run agent with streaming response
Run an agent with streaming via SSE, combining inline configuration with real-time updates including messages, tool executions, and status.
Authorizations
Body
A unique identifier for the agent. This key must be unique within the same workspace and cannot be reused. When executing the agent, this key determines if the agent already exists. If the agent version differs, a new version is created at the end of the execution, except for the task. All agent parameters are evaluated to decide if a new version is needed.
1^[A-Za-z][A-Za-z0-9]*([._-][A-Za-z0-9]+)*$A model ID string (e.g., openai/gpt-5.6-sol or anthropic/claude-sonnet-5). The agent can be run with a wide range of models with different capabilities, performance characteristics, and price points. Only models that support tool calling (function_calling) can be used to run agents. See supported models documentation for the complete list of available models.
Entity storage path.
With workspace-level API keys, use the format project/folder/subfolder/.... The first element must be the display name of an existing project, followed by nested folders (auto-created as needed). Example: Default Project/agents.
With project-level API keys, the project is predetermined by the API key, so the path is relative to that project. Example: agents. For backward compatibility, a leading project name is ignored when it matches the scoped project.
"Default Project"
Optional array of fallback models used when the primary model fails. Fallbacks are attempted in order. All models must support tool calling.
A fallback model ID string (e.g., openai/gpt-4o-mini). Will be used if the primary model request fails. Must support tool calling.
Response
Server-Sent Event stream successfully established. Delivers real-time agent execution events including message fragments, tool invocations, intermediate results, and completion status. Stream terminates with [DONE] sentinel upon completion.
Initial event emitted when an agent stream begins. Contains the task ID for tracking, workspace context, and trace ID for observability.
- Agent Execution Started Event
- Agent Started Event
- Agent Thought Event
- Agent Inactive Event
- Agent Errored Event
- Action Review Requested Event
- Action Reviewed Event
- Execution Review Required Event
- Execution Reviewed Event
- Execution Named Event
- Agent Handed Off Event
- Agent Message Created Event
- Tool Execution Started Event
- Tool Execution Finished Event
- Tool Execution Failed Event
- Timeout Event
- Error Event