Skip to main content
POST
/
v2
/
projects
/
{project_id}
/
spans
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": "2025-10-17T23:03:10.273344Z",
      "dataset_metadata": {},
      "input": "who is a smart LLM?",
      "metrics": {},
      "name": "",
      "output": "I am!",
      "spans": [
        {
          "created_at": "2025-10-17T23:03:10.257765Z",
          "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"
}'
{
  "log_stream_id": "<string>",
  "experiment_id": "<string>",
  "metrics_testing_id": "<string>",
  "project_id": "<string>",
  "project_name": "<string>",
  "session_id": "<string>",
  "records_count": 123,
  "trace_id": "<string>",
  "parent_id": "<string>"
}

Authorizations

Galileo-API-Key
string
header
required

Path Parameters

project_id
string<uuid4>
required

Body

application/json

Request model for ingesting spans.

spans
Spans · array
required

List of spans to log.

Minimum length: 1
  • AgentSpan
  • WorkflowSpan
  • LlmSpan
  • RetrieverSpan
  • ToolSpan
trace_id
string<uuid4>
required

Trace id associated with the spans.

parent_id
string<uuid4>
required

Parent trace or span id.

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.

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

trace_id
string<uuid4>
required

Trace id associated with the spans.

parent_id
string<uuid4>
required

Parent trace or span id.

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.

I