List datasets
List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first
Authorization
Authorization
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
Query Parameters
limit
integerLimit the number of objects to return
0
starting_after
stringPagination cursor id.
For example, if the final item in the last page you fetched had an id of foo
, pass starting_after=foo
to fetch the next page. Note: you may only pass one of starting_after
and ending_before
"uuid"
ending_before
stringPagination cursor id.
For example, if the initial item in the last page you fetched had an id of foo
, pass ending_before=foo
to fetch the previous page. Note: you may only pass one of starting_after
and ending_before
"uuid"
ids
Any properties in string, array<string>Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times
dataset_name
stringName of the dataset to search for
project_name
stringName of the project to search for
project_id
stringProject id
"uuid"
org_name
stringFilter search results to within a particular organization
Returns a list of dataset objects
Create dataset
Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified
Authorization
Authorization
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
OptionalAny desired information about the new dataset object
project_id
Unique identifier for the project that the dataset belongs under
"uuid"
name
Name of the dataset. Within a project, dataset names are unique
1
description
stringTextual description of the dataset
metadata
objectUser-controlled metadata about the dataset
Returns the new dataset object
Get dataset
Get a dataset object by its id
Authorization
Authorization
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
dataset_id
Dataset id
"uuid"
Returns the dataset object
Partially update dataset
Partially update a dataset object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.
Authorization
Authorization
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
OptionalFields to update
name
stringName of the dataset. Within a project, dataset names are unique
description
stringTextual description of the dataset
metadata
objectUser-controlled metadata about the dataset
Path Parameters
dataset_id
Dataset id
"uuid"
Returns the dataset object
Delete dataset
Delete a dataset object by its id
Authorization
Authorization
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
dataset_id
Dataset id
"uuid"
Returns the deleted dataset object
Insert dataset events
Insert a set of events into the dataset
Authorization
Authorization
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 dataset events to insert
events
A list of dataset events to insert
Path Parameters
dataset_id
Dataset id
"uuid"
Returns the inserted row ids
Fetch dataset (GET form)
Fetch the events in a dataset. 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
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
dataset_id
Dataset id
"uuid"
Query Parameters
limit
integerlimit 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
stringDEPRECATION 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
stringDEPRECATION 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
stringRetrieve 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
Fetch dataset (POST form)
Fetch the events in a dataset. 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
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
integerlimit 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
stringAn 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
stringDEPRECATION 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
stringDEPRECATION 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
stringRetrieve 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
dataset_id
Dataset id
"uuid"
Returns the fetched rows
Feedback for dataset events
Log feedback for a set of dataset events
Authorization
Authorization
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
A list of dataset feedback items
Path Parameters
dataset_id
Dataset id
"uuid"
Returns a success status
Summarize dataset
Summarize dataset
Authorization
Authorization
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
dataset_id
Dataset id
"uuid"
Query Parameters
summarize_data
booleanWhether to summarize the data. If false (or omitted), only the metadata will be returned.
Dataset summary