v1
/project_logs
/{project_id}
/insert
Insert project logs events
Insert a set of events into the project logs
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body
application/json
OptionalAn array of project logs events to insert
events
Requiredarray<object>
A list of project logs events to insert
Path Parameters
project_id
Requiredstring
Project id
"uuid"
Returns the inserted row ids
v1
/project_logs
/{project_id}
/fetch
Fetch project logs (GET form)
Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the POST /btql
endpoint.
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Path Parameters
project_id
Requiredstring
Project id
"uuid"
Query Parameters
limit
integer | null
limit the number of traces fetched
Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest _xact_id
. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier _xact_id
. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by id
) from your combined result set.
The limit
parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces.
0
max_xact_id
string
DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
Together, max_xact_id
and max_root_span_id
form a pagination cursor
Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple (_xact_id, root_span_id)
. See the documentation of limit
for an overview of paginating fetch queries.
max_root_span_id
string
DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
Together, max_xact_id
and max_root_span_id
form a pagination cursor
Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple (_xact_id, root_span_id)
. See the documentation of limit
for an overview of paginating fetch queries.
version
string
Retrieve a snapshot of events from a past time
The version id is essentially a filter on the latest event transaction id. You can use the max_xact_id
returned by a past fetch as the version to reproduce that exact fetch.
Returns the fetched rows
v1
/project_logs
/{project_id}
/fetch
Fetch project logs (POST form)
Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the POST /btql
endpoint.
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body
application/json
OptionalFilters for the fetch query
limit
integer | null
limit the number of traces fetched
Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest _xact_id
. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier _xact_id
. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by id
) from your combined result set.
The limit
parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces.
0
cursor
string | null
An opaque string to be used as a cursor for the next page of results, in order from latest to earliest.
The string can be obtained directly from the cursor
property of the previous fetch query
max_xact_id
string | null
DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
Together, max_xact_id
and max_root_span_id
form a pagination cursor
Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple (_xact_id, root_span_id)
. See the documentation of limit
for an overview of paginating fetch queries.
max_root_span_id
string | null
DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
Together, max_xact_id
and max_root_span_id
form a pagination cursor
Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple (_xact_id, root_span_id)
. See the documentation of limit
for an overview of paginating fetch queries.
version
string | null
Retrieve a snapshot of events from a past time
The version id is essentially a filter on the latest event transaction id. You can use the max_xact_id
returned by a past fetch as the version to reproduce that exact fetch.
Path Parameters
project_id
Requiredstring
Project id
"uuid"
Returns the fetched rows
v1
/project_logs
/{project_id}
/feedback
Feedback for project logs events
Log feedback for a set of project logs events
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body
application/json
OptionalAn array of feedback objects
feedback
Requiredarray<object>
A list of project logs feedback items
Path Parameters
project_id
Requiredstring
Project id
"uuid"
Returns a success status