Skip to main content
POST
Create span
You are reading the docs of Galtea 5.10. Read this page in the latest version.

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Body

application/json
inferenceResultId
string
required
Example:

"ir_123"

name
string
required
Example:

"Example Name"

type
enum<string>

Type of span. A value outside this list is not dropped, it is normalized to one of these types, and the original label is kept in the span's metadata under galtea.span.original_type.

Available options:
SPAN,
GENERATION,
EVENT,
AGENT,
TOOL,
CHAIN,
RETRIEVER,
EVALUATOR,
EMBEDDING,
GUARDRAIL
inputData
object
outputData
error
string
Example:

"Error message"

latencyMs
number
metadata
object

Response

Span created successfully

A span: one step inside a trace, such as a tool call, a retrieval or an LLM call. The schema name and the /traces path still carry the old name of this entity, "trace". The parent trace is inferenceResultId; the parentTraceId field is the parent span, not the trace. Span ids start with trace_, so a trace_ id belongs here and never to a trace.

id
string
Example:

"trace_123"

inferenceResultId
string
Example:

"ir_123"

name
string
Example:

"fetch_user_data"

type
enum<string> | null
Available options:
SPAN,
GENERATION,
EVENT,
AGENT,
TOOL,
CHAIN,
RETRIEVER,
EVALUATOR,
EMBEDDING,
GUARDRAIL
Example:

"TOOL"

description
string | null

Human-readable description of the operation. Maximum 1MB.

Example:

"Fetches user data from the database by ID"

inputData
object | null

Input parameters passed to the operation

Example:
outputData

Result returned by the operation. Usually an object; a plain string for retrieval-context spans

Example:
error
string | null

Error message if failed

Example:

"Connection timeout"

latencyMs
number | null

Execution time in milliseconds

Example:

45.5

metadata
object | null

Additional custom metadata

Example:
parentTraceId
string | null

ID of parent span for hierarchical relationships

Example:

"trace_parent_123"

startTime
string<date-time> | null
endTime
string<date-time> | null
createdAt
string<date-time>
deletedAt
string<date-time> | null