POST
/
v2
/
projects
/
{project_id}
/
traces
Log Traces
curl --request POST \
  --url https://api.galileo.ai/v2/projects/{project_id}/traces \
  --header 'Content-Type: application/json' \
  --header 'Galileo-API-Key: <api-key>' \
  --data '{
  "log_stream_id": "00000000-0000-0000-0000-000000000000",
  "session_id": "00000000-0000-0000-0000-000000000000",
  "traces": [
    {
      "created_at": "2025-09-17T22:31:49.809807Z",
      "dataset_metadata": {},
      "input": "who is a smart LLM?",
      "metrics": {},
      "name": "",
      "output": "I am!",
      "spans": [
        {
          "created_at": "2025-09-17T22:31:49.809752Z",
          "dataset_metadata": {},
          "input": [
            {
              "content": "Question: who is a smart LLM?",
              "role": "user"
            }
          ],
          "metrics": {},
          "name": "",
          "output": {
            "content": "I am!",
            "role": "user"
          },
          "tags": [],
          "type": "llm",
          "user_metadata": {}
        }
      ],
      "tags": [],
      "type": "trace",
      "user_metadata": {}
    }
  ]
}'
{
  "log_stream_id": "<string>",
  "experiment_id": "<string>",
  "metrics_testing_id": "<string>",
  "project_id": "<string>",
  "project_name": "<string>",
  "session_id": "<string>",
  "records_count": 123,
  "traces_count": 123
}

Authorizations

Galileo-API-Key
string
header
required

Path Parameters

project_id
string<uuid4>
required

Body

application/json

Request model for ingesting traces.

traces
Trace · object[]
required

List of traces to log.

Minimum length: 1
log_stream_id
string<uuid4> | null

Log stream id associated with the traces.

experiment_id
string<uuid4> | null

Experiment id associated with the traces.

metrics_testing_id
string<uuid4> | null

Metrics testing id associated with the traces.

logging_method
enum<string>
Available options:
playground,
python_client,
typescript_client,
api_direct
client_version
string | null
reliable
boolean
default:false

Whether or not to use reliable logging. If set to False, the method will respond immediately before verifying that the traces have been successfully ingested, and no error message will be returned if ingestion fails. If set to True, the method will wait for the traces to be successfully ingested or return an error message if there is an ingestion failure.

session_id
string<uuid4> | null

Session id associated with the traces.

is_complete
boolean
default:true

Whether or not the records in this request are complete.

Response

Successful Response

project_id
string<uuid4>
required

Project id associated with the traces.

project_name
string
required

Project name associated with the traces.

session_id
string<uuid4>
required

Session id associated with the traces.

records_count
integer
required

Total number of records ingested

traces_count
integer
required

total number of traces ingested

log_stream_id
string<uuid4> | null

Log stream id associated with the traces.

experiment_id
string<uuid4> | null

Experiment id associated with the traces.

metrics_testing_id
string<uuid4> | null

Metrics testing id associated with the traces.