voicegw reconcile
Diff VoiceGatewayโs recorded costs against a providerโs usage export.Purpose
Thereconcile command reads VGโs per-request log records for a date window, parses an operator-supplied normalized provider usage file, and produces a per-model diff with absolute and percent differences. The full workflow (when to reconcile, how to interpret the diff, expected drift per modality) lives at Cost Reconciliation.
The provider-side input file format is documented per provider at Reconcile File Formats.
Syntax
Options
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--provider | string | required | Provider name: openai, deepgram, or cartesia. | |
--start | string | required | Start date in YYYY-MM-DD (UTC, inclusive). | |
--end | string | required | End date in YYYY-MM-DD (UTC, inclusive day). | |
--provider-usage-file | string | required | Path to the providerโs normalized usage file (.csv or .json). | |
--format | -f | string | text | Output format: text, csv, or json. |
--threshold | float | 5.0 | Flag rows whose absolute cost diff % exceeds this threshold. The default reflects that LLM estimates can drift up to ~5%. | |
--config | -c | string | null | Path to voicegw.yaml. Auto-discovered if omitted. |
Prerequisites
- Cost tracking enabled in
voicegw.yaml(the command exits with 1 otherwise). - A provider usage file in VGโs canonical schema (one schema per provider; see Reconcile File Formats).
Output
Text (default)
An aligned table with one row per model. Columns: model, VG units, provider units, units ฮ%, VG cost, provider cost, cost ฮ$, cost ฮ%. Rows whose absolute cost diff % exceeds--threshold are tagged with a trailing * and rendered in ANSI yellow when stdout is a TTY (no color when piped or captured). Models present in only one side carry a (no vg data) or (no provider data) suffix instead.
A Total row sums VG cost and provider cost across rows where both sides matched (missing-side rows are excluded so their $0 placeholders do not skew the total). When any rows are flagged, a footer line (N flagged row(s) marked with *) follows.
The unit label adapts to the provider:
tokensfor OpenAI (input + output, summed).audio_sfor Deepgram (seconds; VG-side minutes are converted at the boundary).charsfor Cartesia.
CSV
Twelve columns:model, vg_units, provider_units, units_diff_abs, units_diff_pct, vg_cost_usd, provider_cost_usd, cost_diff_abs, cost_diff_pct, matched_in_vg, matched_in_provider, flagged. The flagged column is True/False so spreadsheets can filter on it without re-deriving the threshold comparison.
JSON
A nested document matching design ยง2.2:total sums only rows where both sides matched (missing-side rows excluded, mirroring the text format). flagged_count counts rows where flagged=True. Useful for piping into a monitoring or alerting tool.
Examples
Diff May 2026 OpenAI usage
Same window as JSON for piping
.rows[] selector: the JSON output is a nested document
keyed on rows, not a top-level array. See the JSON section
above for the full schema.
Cartesia with the JSON variant of the canonical file
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | Cost tracking is not enabled. |
2 | Bad input: unsupported provider, malformed date, missing usage file, parse error, or unknown format. |
Related commands
voicegw export-costsโ inspect VGโs per-request rows directly.voicegw costsโ aggregated summary by provider/model.
See also
- Cost Reconciliation โ when to reconcile, how to interpret the diff, per-modality drift tolerance.
- Reconcile File Formats โ per-provider schemas this command expects.