Quick answer
Codex reports input, cached input, output, and reasoning tokens. Cached input is part of input, not a separate addition. Reasoning tokens are billed with output but often shown separately. To get fresh input, subtract cached from total input; to get billable output, use the output total as reported.
A worked example
Suppose a turn reports input 40,000, cached 32,000, output 1,200, reasoning 600.
| Field | Reported | What it means |
|---|---|---|
| Input | 40,000 | All context sent |
| Cached input | 32,000 | Part of the 40,000 served from cache |
| Fresh input | 8,000 | 40,000 minus 32,000 |
| Output | 1,200 | Generated tokens |
| Reasoning | 600 | Shown separately, billed with output |
Adding 40,000 and 32,000 double counts. Adding 1,200 and 600 may double count too, depending on whether the output total already includes reasoning. Check the label in your view.
Why the split exists
- Cached input is cheaper, so providers report it separately.
- Reasoning is invisible to the user but consumes compute.
- Input grows with conversation length; output does not.
- The split lets you see whether context or generation is the cost.
Use the fields correctly
- For total tokens sent, use input.
- For cost, apply the cached rate to cached input and the input rate to the remainder.
- For generation cost, apply the output rate to output.
- Never add cached to input.
- State which convention you use when comparing tools.
What the counters include
| Field | Counts | Grows with |
|---|---|---|
| Input | Everything sent | Files, history, instructions |
| Cached input | Reused prefix | Long stable prompts |
| Output | Generated text | Edits and explanations |
| Reasoning | Internal thinking | Hard problems |
| Total | Billed or reported sum | All of the above |
Two tools can disagree because one counts reasoning as output and the other reports it separately, or because one includes cached tokens in the input total. Neither is wrong; they answer different questions.
The cached input guide explains the discount, and why usage numbers differ covers cross-tool mismatches.
Questions, answered
Is cached input included in the input total?
Yes. Cached input is a subset of input, reported separately so it can be priced lower.
Are reasoning tokens included in output?
They are billed as output. In some views they appear as a separate line, so check before adding both.
Why do two tools report different totals for the same session?
One may include cached input in its total and the other may not. Compare the field definitions, not just the headline number.