Log Traces
curl --request POST \
--url https://api.galileo.ai/v2/projects/{project_id}/traces \
--header 'Content-Type: application/json' \
--header 'Splunk-AO-API-Key: <api-key>' \
--data '
{
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"session_id": "00000000-0000-0000-0000-000000000000",
"traces": [
{
"created_at": "2026-11-11T20:11:38.865086Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-11-11T20:11:38.865041Z",
"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": {}
}
]
}
'import requests
url = "https://api.galileo.ai/v2/projects/{project_id}/traces"
payload = {
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"session_id": "00000000-0000-0000-0000-000000000000",
"traces": [
{
"created_at": "2026-11-11T20:11:38.865086Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-11-11T20:11:38.865041Z",
"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": {}
}
]
}
headers = {
"Splunk-AO-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Splunk-AO-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
log_stream_id: '00000000-0000-0000-0000-000000000000',
session_id: '00000000-0000-0000-0000-000000000000',
traces: [
{
created_at: '2026-11-11T20:11:38.865086Z',
dataset_metadata: {},
input: 'who is a smart LLM?',
metrics: {},
name: '',
output: 'I am!',
spans: [
{
created_at: '2026-11-11T20:11:38.865041Z',
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: {}
}
]
})
};
fetch('https://api.galileo.ai/v2/projects/{project_id}/traces', 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.galileo.ai/v2/projects/{project_id}/traces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'log_stream_id' => '00000000-0000-0000-0000-000000000000',
'session_id' => '00000000-0000-0000-0000-000000000000',
'traces' => [
[
'created_at' => '2026-11-11T20:11:38.865086Z',
'dataset_metadata' => [
],
'input' => 'who is a smart LLM?',
'metrics' => [
],
'name' => '',
'output' => 'I am!',
'spans' => [
[
'created_at' => '2026-11-11T20:11:38.865041Z',
'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' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Splunk-AO-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.galileo.ai/v2/projects/{project_id}/traces"
payload := strings.NewReader("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"session_id\": \"00000000-0000-0000-0000-000000000000\",\n \"traces\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865086Z\",\n \"dataset_metadata\": {},\n \"input\": \"who is a smart LLM?\",\n \"metrics\": {},\n \"name\": \"\",\n \"output\": \"I am!\",\n \"spans\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865041Z\",\n \"dataset_metadata\": {},\n \"input\": [\n {\n \"content\": \"Question: who is a smart LLM?\",\n \"role\": \"user\"\n }\n ],\n \"metrics\": {},\n \"name\": \"\",\n \"output\": {\n \"content\": \"I am!\",\n \"role\": \"user\"\n },\n \"tags\": [],\n \"type\": \"llm\",\n \"user_metadata\": {}\n }\n ],\n \"tags\": [],\n \"type\": \"trace\",\n \"user_metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Splunk-AO-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.galileo.ai/v2/projects/{project_id}/traces")
.header("Splunk-AO-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"session_id\": \"00000000-0000-0000-0000-000000000000\",\n \"traces\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865086Z\",\n \"dataset_metadata\": {},\n \"input\": \"who is a smart LLM?\",\n \"metrics\": {},\n \"name\": \"\",\n \"output\": \"I am!\",\n \"spans\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865041Z\",\n \"dataset_metadata\": {},\n \"input\": [\n {\n \"content\": \"Question: who is a smart LLM?\",\n \"role\": \"user\"\n }\n ],\n \"metrics\": {},\n \"name\": \"\",\n \"output\": {\n \"content\": \"I am!\",\n \"role\": \"user\"\n },\n \"tags\": [],\n \"type\": \"llm\",\n \"user_metadata\": {}\n }\n ],\n \"tags\": [],\n \"type\": \"trace\",\n \"user_metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/projects/{project_id}/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Splunk-AO-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"session_id\": \"00000000-0000-0000-0000-000000000000\",\n \"traces\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865086Z\",\n \"dataset_metadata\": {},\n \"input\": \"who is a smart LLM?\",\n \"metrics\": {},\n \"name\": \"\",\n \"output\": \"I am!\",\n \"spans\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865041Z\",\n \"dataset_metadata\": {},\n \"input\": [\n {\n \"content\": \"Question: who is a smart LLM?\",\n \"role\": \"user\"\n }\n ],\n \"metrics\": {},\n \"name\": \"\",\n \"output\": {\n \"content\": \"I am!\",\n \"role\": \"user\"\n },\n \"tags\": [],\n \"type\": \"llm\",\n \"user_metadata\": {}\n }\n ],\n \"tags\": [],\n \"type\": \"trace\",\n \"user_metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"project_name": "<string>",
"records_count": 123,
"traces_count": 123,
"spans_count": 123,
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"session_id": "<string>",
"trace_ids": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}trace
Log Traces
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 'Splunk-AO-API-Key: <api-key>' \
--data '
{
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"session_id": "00000000-0000-0000-0000-000000000000",
"traces": [
{
"created_at": "2026-11-11T20:11:38.865086Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-11-11T20:11:38.865041Z",
"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": {}
}
]
}
'import requests
url = "https://api.galileo.ai/v2/projects/{project_id}/traces"
payload = {
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"session_id": "00000000-0000-0000-0000-000000000000",
"traces": [
{
"created_at": "2026-11-11T20:11:38.865086Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-11-11T20:11:38.865041Z",
"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": {}
}
]
}
headers = {
"Splunk-AO-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Splunk-AO-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
log_stream_id: '00000000-0000-0000-0000-000000000000',
session_id: '00000000-0000-0000-0000-000000000000',
traces: [
{
created_at: '2026-11-11T20:11:38.865086Z',
dataset_metadata: {},
input: 'who is a smart LLM?',
metrics: {},
name: '',
output: 'I am!',
spans: [
{
created_at: '2026-11-11T20:11:38.865041Z',
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: {}
}
]
})
};
fetch('https://api.galileo.ai/v2/projects/{project_id}/traces', 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.galileo.ai/v2/projects/{project_id}/traces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'log_stream_id' => '00000000-0000-0000-0000-000000000000',
'session_id' => '00000000-0000-0000-0000-000000000000',
'traces' => [
[
'created_at' => '2026-11-11T20:11:38.865086Z',
'dataset_metadata' => [
],
'input' => 'who is a smart LLM?',
'metrics' => [
],
'name' => '',
'output' => 'I am!',
'spans' => [
[
'created_at' => '2026-11-11T20:11:38.865041Z',
'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' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Splunk-AO-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.galileo.ai/v2/projects/{project_id}/traces"
payload := strings.NewReader("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"session_id\": \"00000000-0000-0000-0000-000000000000\",\n \"traces\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865086Z\",\n \"dataset_metadata\": {},\n \"input\": \"who is a smart LLM?\",\n \"metrics\": {},\n \"name\": \"\",\n \"output\": \"I am!\",\n \"spans\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865041Z\",\n \"dataset_metadata\": {},\n \"input\": [\n {\n \"content\": \"Question: who is a smart LLM?\",\n \"role\": \"user\"\n }\n ],\n \"metrics\": {},\n \"name\": \"\",\n \"output\": {\n \"content\": \"I am!\",\n \"role\": \"user\"\n },\n \"tags\": [],\n \"type\": \"llm\",\n \"user_metadata\": {}\n }\n ],\n \"tags\": [],\n \"type\": \"trace\",\n \"user_metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Splunk-AO-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.galileo.ai/v2/projects/{project_id}/traces")
.header("Splunk-AO-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"session_id\": \"00000000-0000-0000-0000-000000000000\",\n \"traces\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865086Z\",\n \"dataset_metadata\": {},\n \"input\": \"who is a smart LLM?\",\n \"metrics\": {},\n \"name\": \"\",\n \"output\": \"I am!\",\n \"spans\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865041Z\",\n \"dataset_metadata\": {},\n \"input\": [\n {\n \"content\": \"Question: who is a smart LLM?\",\n \"role\": \"user\"\n }\n ],\n \"metrics\": {},\n \"name\": \"\",\n \"output\": {\n \"content\": \"I am!\",\n \"role\": \"user\"\n },\n \"tags\": [],\n \"type\": \"llm\",\n \"user_metadata\": {}\n }\n ],\n \"tags\": [],\n \"type\": \"trace\",\n \"user_metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/projects/{project_id}/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Splunk-AO-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"session_id\": \"00000000-0000-0000-0000-000000000000\",\n \"traces\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865086Z\",\n \"dataset_metadata\": {},\n \"input\": \"who is a smart LLM?\",\n \"metrics\": {},\n \"name\": \"\",\n \"output\": \"I am!\",\n \"spans\": [\n {\n \"created_at\": \"2026-11-11T20:11:38.865041Z\",\n \"dataset_metadata\": {},\n \"input\": [\n {\n \"content\": \"Question: who is a smart LLM?\",\n \"role\": \"user\"\n }\n ],\n \"metrics\": {},\n \"name\": \"\",\n \"output\": {\n \"content\": \"I am!\",\n \"role\": \"user\"\n },\n \"tags\": [],\n \"type\": \"llm\",\n \"user_metadata\": {}\n }\n ],\n \"tags\": [],\n \"type\": \"trace\",\n \"user_metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"project_name": "<string>",
"records_count": 123,
"traces_count": 123,
"spans_count": 123,
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"session_id": "<string>",
"trace_ids": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
APIKeyHeaderClassicAPIKeyHeaderOAuth2PasswordBearerHTTPBasic
Body
application/json
Request model for ingesting traces.
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 durably accepted or return an error message if there is an ingestion failure. On the streaming write path (kafka_metrics_pipeline) accepted means acknowledged by Kafka; the records become readable after the data-writer flush, about GALILEO_STREAMING_EXPECTED_LAG_SECONDS (default 2.5 s) later, so a read issued immediately after the response can miss them.
Response
Successful Response
Was this page helpful?