Ingest a batch of traces
Validates the payload, resolves the API key, prices each span, and buffers the rows for a flush to ClickHouse. Fire-and-forget: a 202 means the batch was accepted, not yet durably written.
Request body
Example request
{
"version": "v1",
"traces": [
{
"traceId": "0192f1c0-1a2b-7c3d-8e4f-1a2b3c4d5e6f",
"traceName": "classify-email",
"agentName": "summarizer",
"workflowName": "deploy-digest",
"workflowRunId": "run_2024_05_24",
"sessionId": "session_abc123",
"customer": {
"id": "cus_acme",
"name": "Acme Inc",
"imageUrl": "https://logo.clearbit.com/acme.com"
},
"metadata": {
"environment": "production",
"region": "us-east-1"
},
"spans": [
{
"spanId": "span_1",
"parentSpanId": "span_0",
"spanType": "llm",
"name": "generateText",
"startTime": 1716566400000,
"endTime": 1716566401200,
"status": "ok",
"provider": "openai",
"modelId": "gpt-4o",
"usage": {
"inputTokens": 1200,
"outputTokens": 350,
"totalTokens": 1550
},
"ttftMs": 320,
"metadata": {
"environment": "production",
"region": "us-east-1"
}
}
]
}
]
}Response
Batch accepted into the write buffer.
Example response
{
"accepted": 3
}Changes
Changed in 3 of the 4 revisions of this API.2216
- ○
added the new optional request property
traces/items/customernew-optional-request-property
- ○
- ▲
added 'propertyNames' constraint to the request property
traces/items/metadatarequest-property-property-names-added
- ▲
added 'propertyNames' constraint to the request property
traces/items/spans/items/metadatarequest-property-property-names-added
- ●
the
traces/items/metadata/additionalProperties/request property's maxLength was set to1024request-property-max-length-set
- ●
the
traces/items/spans/items/metadata/additionalProperties/request property's maxLength was set to1024request-property-max-length-set
- ○
added the new optional request property
traces/items/spans/items/chunkOffsetsnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/chunkTokensnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/modelCallMsnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/rateLimitnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/reasoningChunkTokensnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/reasoningDurationMsnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/reasoningOffsetsnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/safetyMetadatanew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/sourcesnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/systemFingerprintnew-optional-request-property
- ○
added the new optional request property
traces/items/spans/items/toolCatalognew-optional-request-property
- ○
the
traces/items/spans/items/ttftMsrequest property type/format was generalized frominteger/tonumber/request-property-type-generalized
- ○
added the non-success response with the status
413response-non-success-status-added
- ○
added the non-success response with the status
503response-non-success-status-added
- ▲
- ○
added the new optional request property
traces/items/traceNamenew-optional-request-property
- ○