Skip to main content
POST
/
v0
/
logs
/
query
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
}
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

Authorization
string
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

project
string
required
Project name
context
string | null
Context name
column_context
string | null
The context (prepending ’/’ seperated field names) from which to retrieve the logs.
filter_expr
string | null
Boolean string to filter entries. Supports embed_image() for image similarity queries.
sorting
string | null
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.
group_sorting
string | null
Sorting configuration for groups when using group_by
from_ids
any | null
Log IDs to include
exclude_ids
any | null
Log IDs to exclude
from_fields
string | null
Fields to include
exclude_fields
string | null
Fields to exclude
limit
integer | null
offset
integer
default:"0"
group_by
array | null
Fields to group by
group_limit
integer | null
Maximum number of groups to return at each level
group_offset
integer
default:"0"
Number of groups to skip at each level
group_depth
integer | null
Maximum depth of nested groups to return
nested_groups
boolean
default:"true"
If True, groups are returned as a nested structure
groups_only
boolean
default:"false"
If True, only return groups without full logs list
return_timestamps
boolean
default:"false"
When groups_only is True, return timestamps with log IDs
return_ids_only
boolean
default:"false"
If True, return only log IDs instead of full entries
randomize
boolean
default:"false"
If true, return logs in a deterministic random order
seed
string | null
default:"42"
Seed for deterministic random ordering
value_limit
integer | null
Maximum number of characters to return for string values
group_threshold
integer | null
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
}