Skip to main content
GET
Get spans
You are reading the docs of Galtea 5.17. 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-....

Query Parameters

ids
string[]

Filter by span IDs

inferenceResultIds
string[]

Filter by the IDs of the traces the spans belong to

sessionIds
string[]

Filter by session IDs (via the trace relationship)

types
enum<string>[]

Filter by span types. Only the values below are accepted, and any other value gives a 400. A span whose declared type was outside this list is stored under the type it was normalized to on write, so filter by that one. An LLM span is a GENERATION.

Available options:
SPAN,
GENERATION,
EVENT,
AGENT,
TOOL,
CHAIN,
RETRIEVER,
EVALUATOR,
EMBEDDING,
GUARDRAIL
names
string[]

Filter by span names

sort
string[]

Sort format createdAt,asc or createdAt,desc. A caller gets 400 for a sort on a field it sees as null on any product the list reaches (evaluation.readInference).

offset
integer

Number of items to skip

limit
integer

Maximum number of items to return

fromStartTime
string<date-time>

Filter spans started at or after this timestamp (ISO 8601 format)

toStartTime
string<date-time>

Filter spans started at or before this timestamp (ISO 8601 format)

Response

Spans retrieved successfully

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
modelId
string | null
read-only

The model that answered this LLM call, matched by name when the span was ingested. Null when no live model of the organization, or global model, had any of the model names of the span. A name also matches without its provider prefix. Deleting the model keeps it, so it can name a deleted model.

Example:

"model_123"

modelName
string | null
read-only

The model name the span reported, whether or not it matched a model.

Example:

"gpt-4o-mini"

inputTokens
integer | null
read-only

Input tokens the LLM call reported, cached input included. Null without evaluation.readInference on the product.

Example:

100

outputTokens
integer | null
read-only

Output tokens the LLM call reported. Null without evaluation.readInference on the product.

Example:

50

cacheReadInputTokens
integer | null
read-only

Input tokens the LLM call read from the cache, a part of inputTokens priced at the cache-read rate. A count above inputTokens is taken as counted apart and flagged in the metadata. Null without evaluation.readInference on the product.

Example:

20

tokens
integer | null
read-only

Sum of the input and output tokens, so cached input counts once, plus the cache read when the source counted it apart from the input. Null without evaluation.readInference on the product.

Example:

170

costPerInputToken
number | null
read-only

Price of one input token, frozen at ingest from the model of this call, or from the version model when the span names no model. Null when the named model links to nothing or has no price. Null without evaluation.readInference on the product.

Example:

0.00001

costPerOutputToken
number | null
read-only

Price of one output token, frozen at ingest like costPerInputToken. Null without evaluation.readInference on the product.

Example:

0.00003

costPerCacheReadInputToken
number | null
read-only

Price of one cache-read token, frozen at ingest like costPerInputToken. Null without evaluation.readInference on the product.

Example:

0.000005

cost
number | null
read-only

Cost of this call at the frozen rates. Null when no rates were found. A turn's cost sums the costs of the spans it counts. A call counts once for each side, input and output, from the deepest span that reports it. A span that loses one side to a span below is priced again for the side it keeps. Null without evaluation.readInference on the product.

Example:

0.0026