curl --request POST \
--url https://api.example.com/threads/stream_query \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"filter": {
"after_datetime": "2024-01-01T00:00:00Z",
"before_datetime": "2024-12-31T23:59:59Z",
"thread_ids": [
"thread_1",
"thread_2",
"my_thread_id"
]
},
"limit": 123,
"offset": 123,
"sort_by": [
{
"direction": "desc",
"field": "last_updated"
}
]
}
'[
{}
]curl --request POST \
--url https://api.example.com/threads/stream_query \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"filter": {
"after_datetime": "2024-01-01T00:00:00Z",
"before_datetime": "2024-12-31T23:59:59Z",
"thread_ids": [
"thread_1",
"thread_2",
"my_thread_id"
]
},
"limit": 123,
"offset": 123,
"sort_by": [
{
"direction": "desc",
"field": "last_updated"
}
]
}
'[
{}
]Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query threads with aggregated statistics based on turn calls only.
Turn calls are the immediate children of thread contexts (where call.id == turn_id). This provides meaningful conversation-level statistics rather than including all nested implementation details.
The ID of the project
"my_entity/my_project"
Filter criteria for the threads query
Show child attributes
Maximum number of threads to return
Number of threads to skip
Sorting criteria for the threads. Supported fields: 'thread_id', 'turn_count', 'start_time', 'last_updated', 'p50_turn_duration_ms', 'p99_turn_duration_ms'.
Show child attributes
[
{
"direction": "desc",
"field": "last_updated"
}
]Stream of data in JSONL format
Was this page helpful?