Skip to main content

What ingest is for

If your agent framework is not one of the built-in sources (OpenClaw, Hermes, Claude Code, Cursor CSV), you can still audit it. Export your usage as a Xerg event payload — a small, versioned JSON format — and run:
The full audit pipeline runs on the payload: spend rollups, waste findings, recommendations, local snapshots, --compare, and --push all work the same way they do for built-in sources.

The event payload format

Rules:
  • id must be a stable, unique string per event. Xerg uses it for deterministic deduplication, so re-exporting the same history does not double-count.
  • runId groups events into runs (a trace, session, or task execution).
  • Four event types are accepted: model-call, agent-invocation, tool-execution, and delegation. Orchestration events are first-class — they are preserved in run structure (agent lists, tool attribution, delegation counts) and never filtered.
  • Version 2 adds optional modelCallId and toolCallId fields. modelCallId must reference a model-call event in the same payload and runId; Xerg uses it before chronological association. Version 1 remains accepted.
  • On model-call events, pass costUsd when your platform reports billed cost (it becomes observed spend). Without it, Xerg estimates from local model pricing; models it cannot price stay visible as unpriced rather than being silently zeroed.
  • Numeric fields are validated strictly: inputTokens, outputTokens, retries, attempt, and iteration must be nonnegative integers; costUsd and latencyMs must be nonnegative finite numbers. Negative or fractional token/count values reject the payload.
  • An optional outcome: { "status": "success" | "failure" | "partial" | "unknown" } marker can be attached to any event. It is carried through to run tags for future cost-per-outcome analysis.

Options

The same output, persistence, and push flags as audit apply: --json, --markdown, --db, --no-db, --compare, --push, --dry-run, and --verbose. Invalid payloads fail with per-event error messages (bad timestamps, unknown event types, duplicate IDs) instead of partial results.