Trasmetti in streaming gli eventi del thread di sessione
GET/v1/sessions/{session_id}/threads/{thread_id}/stream
Requires
anthropic-beta: managed-agents-2026-04-01. Learn how to send beta headers.Trasmetti in streaming gli eventi del thread di sessione
Parameters
Returns
Trasmetti in streaming gli eventi del thread di sessione
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
for event in client.beta.sessions.threads.events.stream(
thread_id="sthr_011CZkZVWa6oJjw1rgXZpnBt",
session_id="sesn_011CZkZAtmR3yMPDzynEDxu7",
):
print(event)Response 200
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}Returns Examples
Response 200
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}