I Audited Ten Million Free Tokens. The Ledger Drifted First.
I Audited Ten Million Free Tokens. The Ledger Drifted First. My free allowance didn't evaporate because a model was slow. It evaporated — inside the simulation I built to check it — because my retry wrapper paid for the same prompt twice while my streaming parser paid for the answer zero times. Two bugs, opposite signs, almost cancelling. That's the dangerous case, isn't it? A near-cancel looks…
The reporter conducted an audit of ten million free tokens, discovering a discrepancy in the ledger. The initial assumption was that the free allowance would remain untouched, but it evaporated due to a bug in the retry wrapper. This bug resulted in the same prompt being paid for twice, while the streaming parser failed to account for the answer.
The reporter built a harness and ran three probes to identify and rectify the issue. Probe A compared the token sum against the platform's report, Probe B logged duplicate prompt tokens caused by the retry policy, and Probe C calculated the cost of repairs when a stream ended without a usage block. All the tools used were standard libraries, and the reporter did not utilize any SDKs, frameworks, or dashboards.
The harness was named ledger.py and was written with standard library only. The reporter pointed the endpoint variables at MonkeyCode's free model access, as it was the free tier they had access to.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.