Track realtime voice AI costs at the provider response level. Attach each response to the customer and application session that caused it, and keep audio, text, and cached input in separate usage buckets. Use provider billing to reconcile totals for the account and period. The application ledger supplies the customer mapping even when multiple customers share one provider project.
Record usage once per response
Resolve the customer from your application session before opening a provider session. Store the mapping from provider session ID to your customer ID, feature, and application operation ID. Keep the operation ID stable if the client reconnects, but assign a new session record if the provider opens another session. This lets you group the costs of a reconnect under the same operation without treating responses from the two sessions as duplicates.
For OpenAI's conversational Realtime API, read usage from response.done and retain the response ID, model, response status, and the available input and output token details. Earlier turns can contribute to later input, and part of that input can qualify for cached rates. The same guide describes separate transcription charges and duration-based billing for continuous transcription and translation sessions. Meter those paths in their documented units. OpenAI Realtime cost guidance
Keep parent totals for validation. Submit one rated quantity per mutually exclusive bucket. For example, if the usage reports 800 audio input tokens, of which 300 are cached, rate 500 as uncached and 300 as cached. Recording a charge for 800 plus 300 would count cached tokens twice. Preserve the model and the effective rate-card version with the calculation so you can reproduce last month's estimate after a price change.
Account for interrupted playback
Suppose a support assistant creates two responses for one application session. The following quantities and rates are hypothetical and exclude text and transcription. Assume rates of $20 per million uncached audio input tokens, $5 per million cached audio input tokens, and $40 per million audio output tokens.
| Response | Uncached audio input | Cached audio input | Audio output | Estimated cost |
|---|---|---|---|---|
| First response | 200 | 0 | 100 | $0.008 |
| Second response, playback interrupted | 100 | 300 | 150 | $0.0095 |
| Session total | 300 | 300 | 250 | $0.0175 |
If the listener heard only 50 of the second response's 150 output tokens, keep 150 in the estimate when that is the provider-reported quantity. Use an application playback measure to study wasted output separately. Changing the accounting quantity to match playback would hide a cost that could appear in the provider bill. Compare interruption rates and output usage by feature before deciding whether to shorten responses or adjust turn detection.
A browser disconnect can leave your collector without usage. Track these responses as pending or unresolved, and count them in a telemetry completeness metric. Mark them as zero only when your evidence supports that result. If a completed event arrives twice, update the same provider response row and recalculate the estimate. Preserve response status separately from billing status so interrupted or failed calls remain visible.
Reconcile one provider day
Group your estimates by provider project, billing day and compatible billing line item. Include a bucket for provider usage you cannot attribute to a customer. Compare those totals with the provider's cost rows at the same granularity. OpenAI's Costs API returns bucketed amounts and supports grouping by fields such as project and line item. OpenAI Costs API
Investigate a residual in this order. Check whether both cutoffs use the same timezone and whether usage is still arriving. Then check for separate transcription charges and rate mismatches. Finally, compare unmatched provider traffic with development and administrative usage. Keep any residual unapplied until you can explain it. Assigning it proportionally can conceal a missing voice pipeline and give customer teams a misleading spending report.
Alectura documents spend estimation and limits for supported gateway requests. Meter direct Realtime sessions in your application and compare the unit and customer dimensions with the rest of your inference ledger. Review Alectura's limits and usage model and the customer cost tracking guide.
4 December Sydney edition, released on 5 December.
Source documents (2)
- OpenAI Realtime cost guidanceChecked
- OpenAI Costs APIChecked
Trace a request through Alectura.
Bring a sample prompt and a customer policy. See what reaches the model and which decisions appear in the request record.