curl --request POST \
--url https://api.orq.ai/v2/agents/{key}/stream-task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"messageId": "<string>"
},
"task_id": "<string>",
"variables": {},
"contact": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "[email protected]",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer"
}
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering"
]
},
"thread": {
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high"
]
},
"memory": {
"entity_id": "<string>"
},
"metadata": {},
"stream_timeout_seconds": 1800.5
}
'{
"data": {
"type": "agents.execution_started",
"timestamp": "<string>",
"data": {
"agent_task_id": "<string>",
"workspace_id": "<string>",
"trace_id": "<string>"
}
}
}Executes an agent and streams the interaction in real-time using Server-Sent Events (SSE). Provides live updates as the agent processes the request, including message chunks, tool calls, and execution status. Perfect for building responsive chat interfaces and monitoring agent progress. The stream continues until the agent completes its task, encounters an error, or reaches the configured timeout (default 30 minutes, configurable 1-3600 seconds).
curl --request POST \
--url https://api.orq.ai/v2/agents/{key}/stream-task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"messageId": "<string>"
},
"task_id": "<string>",
"variables": {},
"contact": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "[email protected]",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer"
}
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering"
]
},
"thread": {
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high"
]
},
"memory": {
"entity_id": "<string>"
},
"metadata": {},
"stream_timeout_seconds": 1800.5
}
'{
"data": {
"type": "agents.execution_started",
"timestamp": "<string>",
"data": {
"agent_task_id": "<string>",
"workspace_id": "<string>",
"trace_id": "<string>"
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The key or ID of the agent to invoke
The A2A message to send to the agent (user input or tool results)
Show child attributes
Message role (user or tool for continuing executions)
user A2A message parts (text, file, or tool_result only)
Message part that can be provided by users. Use "text" for regular messages, "file" for attachments, or "tool_result" when responding to tool call requests.
Optional A2A message ID in ULID format
Optional task ID to continue an existing agent execution. When provided, the agent will continue the conversation from the existing task state. The task must be in an inactive state to continue.
Information about the contact making the request. If the contact does not exist, it will be created automatically.
Show child attributes
Unique identifier for the contact
"contact_01ARZ3NDEKTSV4RRFFQ69G5FAV"
Display name of the contact
"Jane Doe"
Email address of the contact
URL to the contact's avatar or logo
"https://example.com/avatars/jane-doe.jpg"
A list of tags associated with the contact
["hr", "engineering"]
Thread information to group related requests
Memory configuration for the agent execution. Used to associate memory stores with specific entities like users or sessions.
Show child attributes
An entity ID used to link memory stores to a specific user, session, or conversation. This ID is used to isolate and retrieve memories specific to the entity across agent executions.
Stream timeout in seconds (1-3600). Default: 1800 (30 minutes)
1 <= x <= 3600Server-Sent Event stream successfully established. Returns real-time events including agent messages, tool calls, status updates, and completion signals. The stream ends with a [DONE] sentinel value.
Initial event emitted when an agent stream begins. Contains the task ID for tracking, workspace context, and trace ID for observability.
Show child attributes
agents.execution_started ISO timestamp of the event
Was this page helpful?