Billing: Usage-Based Billing Audit with Codex: API Runtime Pattern
A production playbook for usage-based billing audit in billing operations using Codex: api runtime pattern, run-scoped inputs, logs, typed results, and artifacts.
Audience: SaaS billing and finance teams
The problem
SaaS billing and finance teams need usage-based billing audit to run repeatedly against usage events, invoices, contracts, credits, and customer disputes. In billing operations, the pain is not one good answer; it is repeatability, auditability, exception handling, and evidence that survives handoff.
Implementation path
Package the usage-based billing audit instructions as a skill, send usage events, invoices, contracts, credits, and customer disputes as run-scoped inputs, execute with Codex, poll terminal status, and consume argo.result.v1 instead of parsing a transcript.
Tradeoffs and failure modes
The API boundary forces the workflow to define inputs, terminal states, and result shape before customers depend on it. For usage-based billing audit, the practical test is whether a second run can be debugged, retried, and consumed by a product without reading the raw agent transcript.
Run request
POST /api/skills/<skill_id>/run
provider=codex
workflow=billing-usage-audit
inputs[]=@./input-pack.zip
result_schema=argo.result.v1
Run this on Argo