POST
/
calls
/
query_stats
Calls Query Stats
curl --request POST \
  --url https://trace.wandb.ai/calls/query_stats \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "project_id": "<string>",
  "filter": {
    "op_names": [
      "<string>"
    ],
    "input_refs": [
      "<string>"
    ],
    "output_refs": [
      "<string>"
    ],
    "parent_ids": [
      "<string>"
    ],
    "trace_ids": [
      "<string>"
    ],
    "call_ids": [
      "<string>"
    ],
    "thread_ids": [
      "<string>"
    ],
    "turn_ids": [
      "<string>"
    ],
    "trace_roots_only": true,
    "wb_user_ids": [
      "<string>"
    ],
    "wb_run_ids": [
      "<string>"
    ]
  },
  "query": {
    "$expr": {
      "$and": [
        {
          "$literal": "<any>"
        }
      ]
    }
  },
  "limit": 123,
  "include_total_storage_size": true
}'
{
  "count": 123,
  "total_storage_size_bytes": 123
}

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
project_id
string
required
filter
object | null
query
object | null

The top-level object for querying traced calls.

The Query wraps a single $expr, which uses Mongo-style aggregation operators to filter calls. This expression can combine logical conditions, comparisons, type conversions, and string matching.

Examples: ``` # Filter calls where op_name == "predict" { "$expr": { "$eq": [ {"$getField": "op_name"}, {"$literal": "predict"} ] } }

# Filter where a call's display name contains "llm"
{
"$expr": {
"$contains": {
"input": {"$getField": "display_name"},
"substr": {"$literal": "llm"},
"case_insensitive": true
}
}
}
```
limit
integer | null
include_total_storage_size
boolean | null
default:false

Response

Successful Response

count
integer
required
total_storage_size_bytes
integer | null