Guide · AI cost
What does a task cost when an AI agent does it?
Anthropic and OpenAI bill by tokens, per account and per month. Which task, which project and which model the money went to is on no invoice. This guide shows where the numbers come from and how to measure them per task, with no estimating by hand.
- Claude Code and Codex
- Measured, not guessed
- Per task and project
- Updated October 30, 2026
The problem
The invoice knows no project.
An AI agent like Claude Code or Codex reads and writes thousands of tokens every turn, the small pieces of text the provider bills by. The invoice comes per account or API key. Whether the amount went into a new feature, a bug fix or an attempt nobody needs any more is not on it.
With a subscription, the number disappears from view altogether. The team lead's question remains: what does working with agents cost us, per task, per project, per week? The answer is in the logs the agents write on the machine anyway.
Tokens
What the cost is made of.
Every model has its own prices, and not every token costs the same.
- Input
- What the agent sends to the model: your instruction, files, command output, the history so far.
- Output
- What the model writes, code and explanations alike. Usually several times more expensive per token than input.
- Cache
- Repeated input, such as the history, can come from the cache and then costs much less. At Anthropic, writing to the cache costs more than regular input in return.
- Model
- Larger models cost more per token. If you switch between models, you need the numbers per model.
Logs
Where the numbers are.
Both agents write every session as a file on your machine, with the usage of every response.
- Claude Code
~/.claude/projects/<folder>/<session>.jsonl, one line per message, with input, output and cache per model. Subagents write next to it. One response can span several lines and must count only once.- Codex
~/.codex/sessions/<year>/<month>/<day>/rollout-….jsonl, with running totals. The usage of a span is the difference of two readings.
Measuring
How Workban books usage to the task.
The Workban CLI does this through the agent's hooks. You enter nothing.
- 01
Read after every turn
When Claude or Codex has finished a response, the CLI reads the new entries from the session's log.
- 02
Only while the task runs
What counts is what happened while the task was In progress. On hold or Done, nothing more is added.
- 03
Per model
Input, output and cache per model, plus the session's thinking, tools, subagents and web searches.
- 04
At list prices
Workban estimates the cost at Anthropic's and OpenAI's list prices and adds it up per task, per project and per period.
Reading it
What it tells you.
Workban's statistics put every period next to the one before.
- What the done tasks cost, in total and on average per task
- Usage on the day it happened, including tasks still running and work without a task
- Which models and tools the agents used, how much they thought, plus subagents and web searches
- With the project filter, all of it per project
- On every task itself, what it cost, even one that never gets done
Limits
What the number is not.
The usage is measured, the cost is an estimate. These limits are worth knowing.
- Subscriptions, discounts and surcharges are not included. With a subscription, the number shows what the work would have cost at list prices
- Measuring happens on the machine. Workban does not capture sessions in the cloud, such as Codex in the cloud
- Other agents can report a token count when they close a task, but no cost comes from it
Questions
What people often ask.
Does Workban need access to my Anthropic or OpenAI account?
Why does the number differ from my invoice?
Does Workban read our conversations with the agent for this?
Next
Statistics, agents and the way to your first board.
Get started
Try it with your next task.
Workban is free. Your workspace is ready in a minute, and the first task appears as soon as your agent gets going. The app itself speaks German for now.