Query logs via POST request.
This endpoint accepts the exact same parameters as GET /logs, but via request body
instead of query parameters. This is useful for:
- Large filter expressions that would exceed URL length limits
- Filter expressions containing base64-encoded images (e.g., embed_image(‘data:image/png;base64,…’))
- Complex sorting expressions
Example with image embedding:
{
"project": "my-project",
"filter_expr": "cosine(image_embedding, embed_image('data:image/png;base64,iVBORw0KG...')) < 0.3",
"limit": 10
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The context (prepending ’/’ seperated field names) from which to retrieve the logs.
Boolean string to filter entries. Supports embed_image() for image similarity queries.
JSON-encoded dict mapping either static column names (e.g. timestamp) or full Python2SQL expressions (e.g. cosine(embed('search text'), embedding_vector)) to sort directions ("ascending" or "descending"). The first key is the primary sort field; subsequent keys break ties.
Sorting configuration for groups when using group_by
Maximum number of groups to return at each level
Number of groups to skip at each level
Maximum depth of nested groups to return
If True, groups are returned as a nested structure
If True, only return groups without full logs list
When groups_only is True, return timestamps with log IDs
If True, return only log IDs instead of full entries
If true, return logs in a deterministic random order
seed
string | null
default:"42"
Seed for deterministic random ordering
Maximum number of characters to return for string values
When set, entries that appear in at least this many logs will be grouped together
curl --request POST \
--url 'https://api.unify.ai/v0/logs/query' \
--header "Authorization: Bearer $UNIFY_KEY" \
--header 'Content-Type: application/json' \
--data '{
"project": "eval-project",
"context": "training",
"column_context": "subjects/science/physics",
"filter_expr": "len(output) > 200 and temperature == 0.5",
"sorting": "{\"timestamp\": \"descending\", \"round(score, 2)\": \"ascending\"}",
"group_sorting": {
"entries/student": {
"direction": "descending",
"field": "score",
"metric": "mean"
}
},
"from_ids": "0&1&2",
"exclude_ids": "0&1&2",
"from_fields": "score&response",
"exclude_fields": "score&response",
"group_by": [
"model",
"temperature"
]
}'
{
"params": {},
"logs": [
{
"id": "0",
"ts": "2024-10-30 12:20:03",
"entries": {
"key1": "a",
"key2": 1.0
},
"derived_entries": {},
"params": {}
}
],
"count": 1
}