Skip to main content
POST
/
v1
/
project_logs
/
{project_id}
/
insert
Insert project logs events
curl --request POST \
  --url https://api.braintrust.dev/v1/project_logs/{project_id}/insert \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "events": [
    {
      "input": "<any>",
      "output": "<any>",
      "expected": "<any>",
      "error": "<any>",
      "scores": {},
      "metadata": {
        "model": "<string>"
      },
      "tags": [
        "<string>"
      ],
      "metrics": {
        "start": 123,
        "end": 123,
        "prompt_tokens": 123,
        "completion_tokens": 123,
        "tokens": 123,
        "caller_functionname": "<any>",
        "caller_filename": "<any>",
        "caller_lineno": "<any>"
      },
      "context": {
        "caller_functionname": "<string>",
        "caller_filename": "<string>",
        "caller_lineno": 123
      },
      "span_attributes": {
        "name": "<string>",
        "type": "llm"
      },
      "id": "<string>",
      "created": "2023-11-07T05:31:56Z",
      "origin": {
        "object_type": "project_logs",
        "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "id": "<string>",
        "_xact_id": "<string>",
        "created": "<string>"
      },
      "_object_delete": true,
      "_is_merge": true,
      "_merge_paths": [
        [
          "<string>"
        ]
      ],
      "_parent_id": "<string>",
      "span_id": "<string>",
      "root_span_id": "<string>",
      "span_parents": [
        "<string>"
      ]
    }
  ]
}'
{
  "row_ids": [
    "<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

project_id
string<uuid>
required

Project id

Body

application/json

An array of project logs events to insert

events
object[]
required

A list of project logs events to insert

Response

Returns the inserted row ids

row_ids
string[]
required

The ids of all rows that were inserted, aligning one-to-one with the rows provided as input