Skip to main content
POST
/
traces
/
batch
Create traces batch
curl --request POST \
  --url https://api.galtea.ai/traces/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "inferenceResultId": "ir_123",
    "name": "<string>",
    "id": "id_123",
    "description": "Example Name",
    "type": "SPAN",
    "inputData": {},
    "outputData": {},
    "error": "Error message",
    "latencyMs": 123,
    "metadata": {},
    "parentTraceId": "<string>",
    "startTime": "2023-11-07T05:31:56Z",
    "endTime": "2023-11-07T05:31:56Z"
  }
]
'
[
  {
    "id": "trace_123",
    "inferenceResultId": "ir_123",
    "name": "fetch_user_data",
    "type": "TOOL",
    "description": "Fetches user data from the database by ID",
    "inputData": {
      "user_id": "123"
    },
    "outputData": {
      "name": "John Doe",
      "email": "john@example.com"
    },
    "error": "Connection timeout",
    "latencyMs": 45.5,
    "metadata": {
      "model": "gpt-4",
      "temperature": 0.7
    },
    "parentTraceId": "trace_parent_123",
    "startTime": "2023-11-07T05:31:56Z",
    "endTime": "2023-11-07T05:31:56Z",
    "createdAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z"
  }
]

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

ID of the inference result this trace belongs to

Example:

"ir_123"

name
string
required

Name of the trace

id
string

Optional custom trace ID

Example:

"id_123"

description
string | null

Optional description of the trace

Example:

"Example Name"

type
enum<string> | null

Type of trace

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

Input data for the trace

outputData
object

Output data from the trace

error
string | null

Error message if the trace failed

Example:

"Error message"

latencyMs
number | null

Duration in milliseconds

metadata
object

Additional trace attributes

parentTraceId
string | null

Parent trace ID for hierarchical traces (references id of another trace in batch)

startTime
string<date-time> | null

Start time of the trace

endTime
string<date-time> | null

End time of the trace

Response

Traces created 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 32KB.

Example:

"Fetches user data from the database by ID"

inputData
object

Input parameters passed to the operation

Example:
{ "user_id": "123" }
outputData
object

Result returned by the operation

Example:
{
"name": "John Doe",
"email": "john@example.com"
}
error
string | null

Error message if failed

Example:

"Connection timeout"

latencyMs
number | null

Execution time in milliseconds

Example:

45.5

metadata
object

Additional custom metadata

Example:
{ "model": "gpt-4", "temperature": 0.7 }
parentTraceId
string | null

ID of parent trace 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