Generation traces v0.2+
Ingest a batch of LLM generation events. Buzo correlates these with prior retrieval traces — by matching a generation's runId or parentRunId against the retrieval's parentQueryId — to produce CITED_FLAGGED attribution.
Endpoint
POST /v1/generation-tracesRequest body
JSON object with a single events array. Each event is idempotent on (organization_id, clientEventId).
events array required
One to 50 events per batch. The cap is lower than retrieval-traces because output payloads can be much larger.
events[].clientEventId string required
UUIDv7-style identifier. Max 128 chars.
events[].output object required
{ text?: string }. Send text when capturing plaintext or redacted output. Omit on error paths. Max 32,000 characters.
events[].latencyMs integer required
LLM call latency in milliseconds, non-negative, max 600,000 (10 min).
events[].timestamp iso8601 required
Client-side timestamp of the LLM call.
events[].sdk object required
{ lang: 'ts' | 'python', version: string }.
events[].runId string
Strongly recommended. Correlation anchor. When this value matches a prior retrieval's parentQueryId, the matcher attributes the generation's content to that retrieval's vectors. Without it, no citations will be written. LangChain users get this for free. Max 128 chars.
events[].parentRunId string
Secondary correlation anchor — matched the same way as runId. Use it when your run tree nests one level deeper than the retriever's parent (e.g. LCEL chains where the LLM step sits alongside the retriever under a common root). Max 128 chars.
events[].collectionId, agentId, model, promptTokens, completionTokens, error, metadata
Optional. Used to enrich the trace and for analytics.
How correlation works
When a generation is ingested, Buzo finds recent retrieval traces whose parentQueryId matches this generation's runId or parentRunId, loads the content it already stores for each returned vector, and runs a tiered content match against output.text — verbatim substring first, n-gram similarity as a fallback for paraphrase.
Hits on a currently-quarantined vector enqueue a CITED_FLAGGED alert and append to the tamper-evident audit chain.
Response
| Field | Type | Description |
|---|---|---|
accepted | integer | Rows newly inserted. |
duplicates | integer | Events with a pre-existing clientEventId. |
curl -X POST https://api.buzo.ai/v1/generation-traces \
-H "Authorization: Bearer $BUZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [{
"clientEventId": "01913e1f-3a40-7b2c-8d4f-bbbb00000001",
"runId": "chain-run-abc",
"parentRunId": "chain-run-root",
"collectionId": "00000000-0000-0000-0000-000000000001",
"agentId": "support-v3",
"output": {
"text": "Your password reset link expires in 24 hours."
},
"model": "gpt-4o",
"promptTokens": 82,
"completionTokens": 14,
"latencyMs": 812,
"timestamp": "2026-04-18T14:22:18.015Z",
"sdk": { "lang": "ts", "version": "0.4.0" }
}]
}'{
"accepted": 1,
"duplicates": 0
}
Buzo