What ingest is for
If your agent framework is not one of the built-in sources (OpenClaw, Hermes, QM, Claude Code, Cursor CSV), you can still audit it. Export your usage as a Xerg event payload — a small, versioned JSON format — and run:--compare, and --push all work the same way they do for built-in sources.
The event payload format
idmust be a stable, unique string per event. Xerg uses it for deterministic deduplication, so re-exporting the same history does not double-count.runIdgroups events into runs (a trace, session, or task execution).- Four event types are accepted:
model-call,agent-invocation,tool-execution, anddelegation. Orchestration events are first-class — they are preserved in run structure (agent lists, tool attribution, delegation counts) and never filtered. - Version 4 is current and adds the evidence needed for the latest detector and comparison contracts. Version 3 added stable request/cost-component IDs and content-free input, result, state, and cache-entry fingerprints. Version 2 added
modelCallIdandtoolCallId;modelCallIdmust reference a model-call event in the same payload andrunId. Versions 1 through 4 are accepted, but older payloads cannot gain evidence they did not contain. - The public machine-readable contract is Xerg Event Payload v4 JSON Schema. Generate a minimal valid example with
npx @xerg/cli@latest ingest --print-example. - On
model-callevents, passcostUsdwhen your platform reports billed cost (it becomes observed spend). Without it, Xerg estimates from local model pricing; models it cannot price stay visible asunpricedrather than being silently zeroed. - Numeric fields are validated strictly:
inputTokens,outputTokens,retries,attempt, anditerationmust be nonnegative integers;costUsdandlatencyMsmust 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
--details, --json, --markdown, --db, --no-db, --compare, --push, --dry-run, and --verbose. --details selects the full human report and cannot be combined with --json, --markdown, --print-example, or --push --dry-run. Automation should use --json.
Invalid payloads fail with per-event error messages (bad timestamps, unknown event types, duplicate IDs) instead of partial results.