voicegw reconcile compares VoiceGateway’s recorded costs against a
provider’s usage export. Different providers ship different exports,
so VoiceGateway defines one canonical reconcile-input format per
provider, and documents how to produce that format from each
provider’s native export.
This page is the schema reference. The walkthrough that ties it to
the day-to-day reconciliation workflow lives at
Cost Reconciliation.
OpenAI
Canonical input shape
voicegw reconcile --provider openai --provider-usage-file <FILE>
expects either CSV or JSON. The format is auto-detected from the file
extension; the schemas are equivalent.
CSV (header row required, column order does not matter):
Field semantics
Cached tokens, audio tokens, and embedding-model lines (if present in
your export) are not in this schema. Drop those rows before running
reconcile, or include them with their own model id (e.g.,
gpt-4o-mini-audio-preview) and let VG report them as unmatched.
Producing the canonical format from the OpenAI dashboard
The OpenAI usage dashboard at platform.openai.com/usage ships a “Download CSV” button. Its column set varies over time; the columns this guide assumes are stable:model(orsnapshot_id): the model id.n_context_tokens_total: maps toinput_tokensin VoiceGateway’s schema.n_generated_tokens_total: maps tooutput_tokens.n_requests: maps ton_requests.cost_total_usd: maps tocost_usd. If the dashboard CSV does not include this column directly, sum thecost_input_usdandcost_output_usdcolumns.
convert-openai.py and invoke it with the
source export and the desired destination filename:
python convert-openai.py <openai-export.csv> <vg-format.csv>.
Why a normalized format and not a direct dashboard parser
OpenAI’s dashboard CSV columns have changed during 2025-2026 as new modalities (audio, embeddings, batch) shipped. A direct parser inside VoiceGateway would tie us to whatever shape was current the week we shipped. The normalized format is small enough that the conversion above is a few lines of Python, and stable enough that VoiceGateway’s reconcile semantics do not regress when OpenAI changes their export. When real users surface that the conversion is annoying, we will ship a built-invoicegw reconcile-import openai <NATIVE-FILE> helper.
Until then: the small Python snippet is the contract.
Deepgram
Canonical input shape
voicegw reconcile --provider deepgram --provider-usage-file <FILE>
expects either CSV or JSON. The format is auto-detected from the file
extension; the schemas are equivalent.
CSV (header row required, column order does not matter):
Field semantics
Real-time vs pre-recorded vs streaming distinctions are not in this
schema. Sum the durations across all delivery modes for a given model
into a single row; if your account uses different rate cards per
mode, split into separate model rows (e.g.,
nova-3-realtime,
nova-3-prerecorded) and record those same suffixed names in
voicegw.yaml so VG’s logs match.
Producing the canonical format from the Deepgram console
Deepgram’s console exposes a usage page with per-model rollups. Two paths to the canonical CSV: Path A: console export. Click “Export CSV” on the Usage page for your billing window. The exported columns this guide assumes:model(ormodel_name): the model id.seconds_total(orduration_seconds_total): maps toaudio_seconds. If your export reports minutes, multiply by 60.requests_total: maps ton_requests.total_cost_usd(oramount_usd): maps tocost_usd.
convert-deepgram.py and invoke it as
python convert-deepgram.py <deepgram-export.csv> <vg-format.csv>.
float(row.get("seconds_total", 0)) with
float(row.get("minutes_total", 0)) * 60.
Why audio_seconds and not minutes
Deepgram’s billing dashboards display minutes by default, but VG records audio duration in seconds (the unitlivekit-plugins-deepgram
emits on its usage_collected event, and the unit
src/voicegateway/pricing/stt.py calculates against). Storing seconds in
the canonical reconcile file keeps both sides of the comparison in
the same unit. If your export hands you minutes, the conversion above
multiplies in.
Cartesia
Canonical input shape
voicegw reconcile --provider cartesia --provider-usage-file <FILE>
expects either CSV or JSON. The format is auto-detected from the file
extension; the schemas are equivalent.
CSV (header row required, column order does not matter):
Field semantics
Voice-id selection (Cartesia lets you switch voices per-request) is not
in this schema. Voice id does not affect billing in Cartesia’s current
pricing; aggregate across all voices for a given model into a single
row. If a future Cartesia rate card differentiates by voice, split into
suffixed model rows (e.g.,
sonic-3-staging, sonic-3-production) and
mirror those names in voicegw.yaml.
Producing the canonical format from the Cartesia portal
Cartesia’s billing portal lists usage by model with both a character count and a credits column. The portal CSV columns this guide assumes:model(ormodel_id): the model id.chars_synthesized(orcharacters_total): maps tocharacters.credits_used(orcredits_consumed): maps tocredits.requests(orn_requests): maps ton_requests.cost_usd(ortotal_cost): maps tocost_usd.
convert-cartesia.py and invoke
as python convert-cartesia.py <cartesia-export.csv> <vg-format.csv>.
cost_usd directly,
multiply credits_used by your account’s USD-per-credit rate (visible
on the billing portal’s rate sheet) and write that into cost_usd.
Why both characters and credits
Cartesia is currently credit-based: the billing portal’s primary unit is credits, and the credits-to-USD conversion depends on the account’s plan tier. VG records characters (the LiveKit plugin’susage_collected event ships character counts, not credits) and
calculates an estimated cost via a documented per-character rate in
src/voicegateway/pricing/tts.py. Surfacing both columns lets reconcile
report two diffs:
- VG’s character-count vs Cartesia’s character-count (a units check).
- VG’s calculated USD vs Cartesia’s billed USD (the cost diff).
pricing/tts.py is stale relative to your plan; refresh that
catalog entry and re-run.
If your account is invoiced as flat-USD (not credits), set
credits = 0 and only the cost diff is meaningful.