Skip to main content
GET
/
v1
/
experiment
/
{experiment_id}
/
summarize
Summarize experiment
curl --request GET \
  --url https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.braintrust.dev/v1/experiment/{experiment_id}/summarize")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "project_name": "<string>",
  "experiment_name": "<string>",
  "project_url": "<string>",
  "experiment_url": "<string>",
  "comparison_experiment_name": "<string>",
  "scores": {},
  "metrics": {}
}
"<string>"
"<string>"
"<string>"
"<string>"
"<string>"

Authorizations

Authorization
string
header
required

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.

Path Parameters

experiment_id
string<uuid>
required

Experiment id

Query Parameters

summarize_scores
boolean | null

Whether to summarize the scores and metrics. If false (or omitted), only the metadata will be returned.

comparison_experiment_id
string<uuid>

The experiment to compare against, if summarizing scores and metrics. If omitted, will fall back to the base_exp_id stored in the experiment metadata, and then to the most recent experiment run in the same project. Must pass summarize_scores=true for this id to be used

Response

Experiment summary

Summary of an experiment

project_name
string
required

Name of the project that the experiment belongs to

experiment_name
string
required

Name of the experiment

project_url
string<uri>
required

URL to the project's page in the Braintrust app

experiment_url
string<uri>
required

URL to the experiment's page in the Braintrust app

comparison_experiment_name
string | null

The experiment which scores are baselined against

scores
object | null

Summary of the experiment's scores

metrics
object | null

Summary of the experiment's metrics