Quick answer
There is no fixed token count per task. The same bug fix can cost 8,000 tokens or 80,000 depending on context size, model, and how many tool calls it takes. Measure a task type once in your own repository, then use that as your benchmark rather than a generic table.
Illustrative ranges
The numbers below are order-of-magnitude illustrations for a mid-sized repository, not guarantees. Use them to sanity-check a measurement, not to plan a budget.
| Task type | Order of magnitude | Main driver |
|---|---|---|
| Explain one function | Thousands | File size |
| Fix a failing test | Tens of thousands | Iterations |
| Add a small feature | Tens of thousands | Files touched |
| Refactor a module | Hundreds of thousands | Context of every file |
| Migrate a dependency | Hundreds of thousands to millions | Repeated builds and errors |
What moves the number
- Context size per turn, which multiplies by the number of turns.
- Tool output: test logs and directory listings are expensive.
- Model choice: reasoning tokens are billed as output.
- Retry loops: each repeat resends the same context.
- Whether the agent writes a diff or a whole file.
Benchmark your own repository
- Pick three tasks you repeat weekly.
- Run each in a fresh session with the same prompt.
- Record input, cached, output, and wall-clock time.
- Repeat once on a different day to see variance.
- Use the median as your planning number.
The Codex cost per project guide turns those token medians into a budget.
Measure per task, not per prompt
A prompt is not a unit of work. One prompt can start forty model calls; ten prompts can solve one tiny bug. Counting per task is what makes two weeks comparable.
- Write down the tasks you repeat weekly.
- After a session, tag it with the task type in your notes or in the tracker.
- Total tokens for that task across a week.
- Divide by completed tasks to get a per-task cost.
- Compare the same task type month over month.
The cost per project guide uses the same method at repository level, and AI tokens per day covers what normal volume looks like.
Questions, answered
How many tokens does one Codex request use?
It varies with the context sent. A short prompt in a small session can be a few thousand tokens; a turn late in a long agent run can be over a hundred thousand.
Are reasoning tokens counted in output?
They are billed as output. Some views show them separately, so check whether your total already includes them.
Is there a public Codex benchmark?
Not one that matches your repository. Published averages hide the context and retry behaviour that dominate real consumption.