POST
/
threads
/
stream_query
Threads Query Stream
curl --request POST \
  --url https://trace.wandb.ai/threads/stream_query \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "project_id": "my_entity/my_project",
  "filter": {
    "after_datetime": "2024-01-01T00:00:00Z",
    "before_datetime": "2024-12-31T23:59:59Z"
  },
  "limit": 123,
  "offset": 123,
  "sort_by": [
    {
      "direction": "desc",
      "field": "last_updated"
    }
  ]
}'
"<any>"

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

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.

project_id
string
required

The ID of the project

Examples:

"my_entity/my_project"

filter
object | null

Filter criteria for the threads query

limit
integer | null

Maximum number of threads to return

offset
integer | null

Number of threads to skip

sort_by
SortBy · object[] | null

Sorting criteria for the threads. Supported fields: 'thread_id', 'turn_count', 'start_time', 'last_updated', 'p50_turn_duration_ms', 'p99_turn_duration_ms'.

Examples:
[
{
"direction": "desc",
"field": "last_updated"
}
]

Response

Successful Response

The response is of type any.