By Anant MishraDesign study
Two local Python runs reproduced the 4.68 and 8.52 US-cent endpoints. Seven software tests passed. The rates, route counts and token records are invented. Applying the method requires authorised usage and billing evidence.
Design feature 01
4 fictional calls
Design feature 02
2 missing labels
Design feature 03
7 software tests
Executive Summary
An independent Design study reconstructs the lowest and highest token charge allowed by four fictional records and a separate model count. Includes a Python replay.
Architectural Deep Dive
Design study. A fictional internal document service has four text-model calls in its finance extract. Every input and output token count survived the export. Two model labels did not. A separate counter for the same interval says that two calls used economy and two used premium. The finance reviewer wants to know how much of the token charge can be reconstructed before anyone recovers the missing labels.
This case uses invented rates and records. Its deliverable is an executable accounting calculation. It assumes the four calls form the entire priced population, each call used exactly one route, and either missing call was eligible for either route. The fixture contains no user text. No provider or client system supplied the records.
First agree on the population
The independent counter matters only if it covers these four calls. A gateway might count a user action once while an upstream service counts each attempt. An hourly extract in local time can also straddle two hours in a UTC report. For an operational review, write down the clock, start and end instants, model versions and treatment of attempts before using one export to constrain another. A coincidental match on the grand total offers little protection against two different populations.
One possible check is a provider-side split by deployment. Microsoft documents summed input and output token metrics with deployment, model, version and region dimensions. Where an authorised team has the matching per-model totals and effective rates, it can price those totals directly. This study asks how much can be said when the reviewer has only the per-model call counts and the following local quantities. See Microsoft’s Azure OpenAI monitoring reference.
| Call | Known route | Input tokens | Output tokens |
|---|---|---|---|
| A | Economy | 2,000 | 500 |
| B | Premium | 3,000 | 250 |
| C | Unknown | 1,000 | 300 |
| D | Unknown | 9,000 | 700 |
Keep the known money fixed
The economy rates are $1 per million input and $4 per million output. The premium rates are $5 and $20. A costs $0.004 and B costs $0.020. Their combined 2.40 cents remain in every possible answer. Each route has already used one of its two calls. Of C and D, exactly one must take the remaining premium place.
If C used premium, it would cost 1.10 cents. D on economy would cost 1.18 cents. Add the known calls and the total is 4.68 US cents. If D used premium, it would cost 5.90 cents and C on economy would cost 0.22 cents. The four calls would total 8.52 cents. Those are the only two feasible totals under the fixture. A number halfway between them might look reasonable on a dashboard, yet neither possible assignment produces it.
Find which piece of evidence changes the answer
Price every unlabelled call on economy as a starting point. For each one, calculate the extra charge for using premium. With one premium place left, allocating it to the smallest extra charge gives the lower endpoint. Giving it to the largest gives the upper endpoint. With several places, select that many smallest or largest differences. Each selection is achievable here because every unlabelled call is eligible for both routes. A third price tier or a destination restriction would change the problem.
The output side can change the ordering. A boundary check gives one call 4,000 input and 100 output tokens and another 2,000 input and 1,000 output. At these rates, premium adds 1.76 cents for the first and 2.40 for the second. Selecting the longest prompt would pick the wrong upper endpoint. A separate check restores C’s economy label in the original fixture. The independent count then places D on premium and the interval closes at 8.52 cents. Either recovered label would settle this particular ledger.
What is the independent count worth?
Set the route counter aside but retain the labels on A and B. Four assignments now fit the records. Both unknown calls on economy give 3.80 cents, and both on premium give 9.40 cents. The mixed assignments still give 4.68 and 8.52 cents. Bringing back the independent counter eliminates the two extremes. If a separate record then establishes that C used economy, only 8.52 cents remains. The comparison script enumerates every assignment, and the comparison record shows which assignments survive each new piece of evidence. C’s recovered label is a hypothetical observation in that final scenario.
Reproduce the calculation
Download the four invented records, Python reference and seven checks into one folder. The reproduction notes give the two commands. Two local runs reproduced the same bounds and source and input hashes. The saved execution record includes the UTC run time, interpreter version, known charge and an assignment attaining each endpoint. Integer microdollars preserve the fractional cents until presentation.
The checks include enumerating all assignments for four unlabelled rows at each possible premium call count. They also reject inconsistent totals, a duplicate identifier and a missing token quantity. An equal-rate check produces an exact total with both route labels still unknown. Knowing the price and knowing where a particular document was processed are different evidence requirements.
Hand the interval to the right person
The finance owner can use the endpoints to decide whether recovering another label could change a budget decision. For a real reconciliation, the owner also needs the provider’s monetary report for the period, effective prices and any credits or separately charged usage. OpenAI’s organisation Costs endpoint, for example, supplies monetary amounts and currencies. A reviewer can compare costs at the granularity the report supports and leave any unexplained difference visible. See the Costs API reference.
A reviewer concerned with data residency needs trustworthy serving-location evidence even when the money is exact. The fictional accounting exercise cannot establish that fact. It also supplies no observed invoice, service quality or deployment outcome. For a fully labelled extract, the companion guide to pricing tokens by route shows how to carry measured input and output totals into a budget.
Proposed approach
- Method
- Exact two-route cost bounds in integer microdollars
- Materials
- Fictional ledger, Python, tests and execution record
Sources
- Monitoring data reference for Azure OpenAI — Microsoft Learn · checked 5 December 2026
- Organisation Costs API — OpenAI · checked 5 December 2026
Related reading
Read the publishing standards or suggest a correction.