curl --request POST \
--url https://api.galileo.ai/v2/projects/{project_id}/spans \
--header 'Content-Type: application/json' \
--header 'Galileo-API-Key: <api-key>' \
--data '
{
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"parent_id": "11000011-0000-0000-0000-110000110000",
"spans": [
{
"created_at": "2026-05-29T19:35:35.801276Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-05-29T19:35:35.783367Z",
"dataset_metadata": {},
"id": "22222222-2222-4222-a222-222222222222",
"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": "workflow",
"user_metadata": {}
}
],
"trace_id": "11000011-0000-0000-0000-110000110000"
}
'import requests
url = "https://api.galileo.ai/v2/projects/{project_id}/spans"
payload = {
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"parent_id": "11000011-0000-0000-0000-110000110000",
"spans": [
{
"created_at": "2026-05-29T19:35:35.801276Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-05-29T19:35:35.783367Z",
"dataset_metadata": {},
"id": "22222222-2222-4222-a222-222222222222",
"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": "workflow",
"user_metadata": {}
}
],
"trace_id": "11000011-0000-0000-0000-110000110000"
}
headers = {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Galileo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
log_stream_id: '00000000-0000-0000-0000-000000000000',
parent_id: '11000011-0000-0000-0000-110000110000',
spans: [
{
created_at: '2026-05-29T19:35:35.801276Z',
dataset_metadata: {},
input: 'who is a smart LLM?',
metrics: {},
name: '',
output: 'I am!',
spans: [
{
created_at: '2026-05-29T19:35:35.783367Z',
dataset_metadata: {},
id: '22222222-2222-4222-a222-222222222222',
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: 'workflow',
user_metadata: {}
}
],
trace_id: '11000011-0000-0000-0000-110000110000'
})
};
fetch('https://api.galileo.ai/v2/projects/{project_id}/spans', 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}/spans",
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',
'parent_id' => '11000011-0000-0000-0000-110000110000',
'spans' => [
[
'created_at' => '2026-05-29T19:35:35.801276Z',
'dataset_metadata' => [
],
'input' => 'who is a smart LLM?',
'metrics' => [
],
'name' => '',
'output' => 'I am!',
'spans' => [
[
'created_at' => '2026-05-29T19:35:35.783367Z',
'dataset_metadata' => [
],
'id' => '22222222-2222-4222-a222-222222222222',
'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' => 'workflow',
'user_metadata' => [
]
]
],
'trace_id' => '11000011-0000-0000-0000-110000110000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Galileo-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}/spans"
payload := strings.NewReader("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"parent_id\": \"11000011-0000-0000-0000-110000110000\",\n \"spans\": [\n {\n \"created_at\": \"2026-05-29T19:35:35.801276Z\",\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-05-29T19:35:35.783367Z\",\n \"dataset_metadata\": {},\n \"id\": \"22222222-2222-4222-a222-222222222222\",\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\": \"workflow\",\n \"user_metadata\": {}\n }\n ],\n \"trace_id\": \"11000011-0000-0000-0000-110000110000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Galileo-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}/spans")
.header("Galileo-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"parent_id\": \"11000011-0000-0000-0000-110000110000\",\n \"spans\": [\n {\n \"created_at\": \"2026-05-29T19:35:35.801276Z\",\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-05-29T19:35:35.783367Z\",\n \"dataset_metadata\": {},\n \"id\": \"22222222-2222-4222-a222-222222222222\",\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\": \"workflow\",\n \"user_metadata\": {}\n }\n ],\n \"trace_id\": \"11000011-0000-0000-0000-110000110000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/projects/{project_id}/spans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Galileo-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"parent_id\": \"11000011-0000-0000-0000-110000110000\",\n \"spans\": [\n {\n \"created_at\": \"2026-05-29T19:35:35.801276Z\",\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-05-29T19:35:35.783367Z\",\n \"dataset_metadata\": {},\n \"id\": \"22222222-2222-4222-a222-222222222222\",\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\": \"workflow\",\n \"user_metadata\": {}\n }\n ],\n \"trace_id\": \"11000011-0000-0000-0000-110000110000\"\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"project_name": "<string>",
"records_count": 123,
"trace_id": "<string>",
"parent_id": "<string>",
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"session_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Log Spans
curl --request POST \
--url https://api.galileo.ai/v2/projects/{project_id}/spans \
--header 'Content-Type: application/json' \
--header 'Galileo-API-Key: <api-key>' \
--data '
{
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"parent_id": "11000011-0000-0000-0000-110000110000",
"spans": [
{
"created_at": "2026-05-29T19:35:35.801276Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-05-29T19:35:35.783367Z",
"dataset_metadata": {},
"id": "22222222-2222-4222-a222-222222222222",
"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": "workflow",
"user_metadata": {}
}
],
"trace_id": "11000011-0000-0000-0000-110000110000"
}
'import requests
url = "https://api.galileo.ai/v2/projects/{project_id}/spans"
payload = {
"log_stream_id": "00000000-0000-0000-0000-000000000000",
"parent_id": "11000011-0000-0000-0000-110000110000",
"spans": [
{
"created_at": "2026-05-29T19:35:35.801276Z",
"dataset_metadata": {},
"input": "who is a smart LLM?",
"metrics": {},
"name": "",
"output": "I am!",
"spans": [
{
"created_at": "2026-05-29T19:35:35.783367Z",
"dataset_metadata": {},
"id": "22222222-2222-4222-a222-222222222222",
"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": "workflow",
"user_metadata": {}
}
],
"trace_id": "11000011-0000-0000-0000-110000110000"
}
headers = {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Galileo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
log_stream_id: '00000000-0000-0000-0000-000000000000',
parent_id: '11000011-0000-0000-0000-110000110000',
spans: [
{
created_at: '2026-05-29T19:35:35.801276Z',
dataset_metadata: {},
input: 'who is a smart LLM?',
metrics: {},
name: '',
output: 'I am!',
spans: [
{
created_at: '2026-05-29T19:35:35.783367Z',
dataset_metadata: {},
id: '22222222-2222-4222-a222-222222222222',
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: 'workflow',
user_metadata: {}
}
],
trace_id: '11000011-0000-0000-0000-110000110000'
})
};
fetch('https://api.galileo.ai/v2/projects/{project_id}/spans', 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}/spans",
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',
'parent_id' => '11000011-0000-0000-0000-110000110000',
'spans' => [
[
'created_at' => '2026-05-29T19:35:35.801276Z',
'dataset_metadata' => [
],
'input' => 'who is a smart LLM?',
'metrics' => [
],
'name' => '',
'output' => 'I am!',
'spans' => [
[
'created_at' => '2026-05-29T19:35:35.783367Z',
'dataset_metadata' => [
],
'id' => '22222222-2222-4222-a222-222222222222',
'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' => 'workflow',
'user_metadata' => [
]
]
],
'trace_id' => '11000011-0000-0000-0000-110000110000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Galileo-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}/spans"
payload := strings.NewReader("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"parent_id\": \"11000011-0000-0000-0000-110000110000\",\n \"spans\": [\n {\n \"created_at\": \"2026-05-29T19:35:35.801276Z\",\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-05-29T19:35:35.783367Z\",\n \"dataset_metadata\": {},\n \"id\": \"22222222-2222-4222-a222-222222222222\",\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\": \"workflow\",\n \"user_metadata\": {}\n }\n ],\n \"trace_id\": \"11000011-0000-0000-0000-110000110000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Galileo-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}/spans")
.header("Galileo-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"parent_id\": \"11000011-0000-0000-0000-110000110000\",\n \"spans\": [\n {\n \"created_at\": \"2026-05-29T19:35:35.801276Z\",\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-05-29T19:35:35.783367Z\",\n \"dataset_metadata\": {},\n \"id\": \"22222222-2222-4222-a222-222222222222\",\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\": \"workflow\",\n \"user_metadata\": {}\n }\n ],\n \"trace_id\": \"11000011-0000-0000-0000-110000110000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/projects/{project_id}/spans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Galileo-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"log_stream_id\": \"00000000-0000-0000-0000-000000000000\",\n \"parent_id\": \"11000011-0000-0000-0000-110000110000\",\n \"spans\": [\n {\n \"created_at\": \"2026-05-29T19:35:35.801276Z\",\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-05-29T19:35:35.783367Z\",\n \"dataset_metadata\": {},\n \"id\": \"22222222-2222-4222-a222-222222222222\",\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\": \"workflow\",\n \"user_metadata\": {}\n }\n ],\n \"trace_id\": \"11000011-0000-0000-0000-110000110000\"\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"project_name": "<string>",
"records_count": 123,
"trace_id": "<string>",
"parent_id": "<string>",
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"session_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Body
Request model for ingesting spans.
List of spans to log.
1- AgentSpan
- WorkflowSpan
- LlmSpan
- RetrieverSpan
- ToolSpan
- ControlSpan
Show child attributes
Show child attributes
Trace id associated with the spans.
Parent trace or span id.
Log stream id associated with the traces.
Experiment id associated with the traces.
Metrics testing id associated with the traces.
playground, python_client, typescript_client, api_direct 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.
Response
Successful Response
Project id associated with the traces.
Project name associated with the traces.
Total number of records ingested
Trace id associated with the spans.
Parent trace or span id.
Log stream id associated with the traces.
Experiment id associated with the traces.
Metrics testing id associated with the traces.
Session id associated with the traces.
Was this page helpful?