v1
latestOpenAPI 3.1.02026-07-13154170539.0 KBCreate Logs
Creates one or more logs associated to a project. Logs are LLM-call-level data that might depend on other variables.
If a context is specified and it is versioned, all logs will be versioned and mutable. The context version will be incremented automatically when logs are added, updated, or removed.
The context parameter can be:
- A string: Uses the string as the context name with default values (description=None, is_versioned=False)
- An object: Uses the object's name, description, and is_versioned properties
An "explicit_types" dictionary can be passed as part of the entries. If present, any matching key inside this dictionary will override the inferred type of that particular entry. The explicit_types dictionary can also specify if a field is mutable via a 'mutable' boolean flag and if a field is unique via a 'unique' boolean flag:
{
"field_name": {
"type": "str",
"mutable": false, # Makes the field immutable (default is true)
"unique": true # Makes the field unique
}
}
By default, all fields are mutable. Set mutable: false to make a field immutable after creation. Only mutable fields can be modified through the update endpoint.
Response includes:
- log_event_ids: List of created log event IDs
- row_ids: Object with names (unique key column names) and ids (nested list of values)
- auto_counting: Dictionary mapping auto-counting column names to their generated/provided values. Empty dict {} when no auto-counting is configured.
This method returns the ids of the new stored logs along with any auto-counting values.
Request body
Example request
{
"project_name": "eval-project",
"context": {
"name": "experiment1/trial1",
"description": "Context for experiment 1 trial 1",
"is_versioned": true,
"allow_duplicates": true,
"unique_keys": {
"company_id": "int",
"department_id": "int",
"first_name": "str",
"last_name": "str"
},
"auto_counting": {
"company_id": "department_id"
},
"foreign_keys": [
{
"default": 0,
"name": "department_id",
"on_delete": "SET DEFAULT",
"on_update": "CASCADE",
"references": "Departments.id"
}
]
}
}Response
Successful Response