Table of Contents

Event schema

UsageEvent

The canonical record of one LLM API call.

Field Type Notes
Id GUID Server-generated if not supplied.
IdempotencyKey string Unique per org; makes ingestion safe to retry.
SchemaVersion int Must match a known schema version row.
OrgId GUID Organization the call belongs to.
RepoId string Stable hash of the git remote URL.
ProjectId GUID Defaults to a 1:1 relationship with the repo, but can span repos.
SessionId string The agent session.
TaskId string? Optional task within the session.
TurnSeq int Turn number within the task.
CallId string The individual call.
PullRequestId string? Filled by a caller hint or VCS enrichment.
CommitSha string? Filled by a caller hint or VCS enrichment.
Provider string e.g. anthropic, openai, google.
Model string e.g. claude-sonnet-4-20250514.
Tokens TokenCounts Input, output, cache-create and cache-read counts.
Cost decimal USD.
LatencyMs double Round-trip latency.
TurnCount int Turns covered by the call.
ToolCalls ToolCallRecord[] Each tool call's name, success flag and failure reason.
Thinking ThinkingConfig? Whether extended thinking was on, and its budget.
Outcome enum Success, error, abandoned, …
CaptureLevel enum MetadataOnly (default) or Redacted.
RedactedPromptSummary string? Only at Redacted capture level.
RedactedResponseSummary string? Only at Redacted capture level.
Timestamp datetime When the call happened at the source.
IngestedAt datetime Server-set on receipt.
CustomMetadata map? Your own tags.

TokenCounts

InputTokens, OutputTokens, CacheCreateTokens, CacheReadTokens, plus a computed TotalTokens.

ToolCallRecord

Name, Success, FailureReason.

AugmentationEvent

The transparency ledger: one row per change the SDK applied to a real call.

Field Type Notes
Id GUID
OrgId, RepoId, SessionId, TaskId The same hierarchy as the usage event.
CallId string Correlates to the UsageEvent it changed.
ActionType enum The kind of augmentation.
BeforeValue string Human-readable before state.
AfterValue string Human-readable after state.
Reason string Why it was applied.
PolicyVersionId GUID? The policy that authorised it.
DetectorId string? The detector that recommended it.
AppliedAt datetime When.

Ingestion

POST /api/events/batch, authenticated with X-Api-Key, rate limited to 100 requests/minute per key. A batch is validated as a whole: a malformed event rejects the batch rather than being silently dropped.