Estimate a run's cost
Goal: know what a translation run will cost before you start it. kapi counts what there actually is to translate (blocks, words, characters, off the extracted content, so boilerplate, keys, and markup are excluded), and you multiply by a model's or vendor's per-word rate. In a project, kapi up --plan goes further and prices the pending work per language. Try the counter in your browser:
- Desktop
- Agent (Claude)
- CLI
Open the project: each content collection lists its matched files with per-file and collection totals, so the volume of a job is visible before you run anything. Plan… beside Bring up to date shows the pending work per language, the leverage available from content memory, and a token estimate before anything runs. For a loose file, the stats tool runs as a quick tool from the Toolbox.
Ask the sizing question directly:
How big is translating
docs/into French and Japanese: words, and a rough cost at $0.08/word?
The assistant runs kapi stats --json over the content, multiplies out the rate you gave, and can subtract what the content memory already covers (leverage first) so the estimate reflects only the work that remains. In a project it runs kapi up --plan --json instead, which already nets out the memory and reports a token estimate per language.
Point at a file or a glob; per-file rows plus a grand total:
kapi stats messages.json
kapi stats --json ./locales/*.json
kapi stats --json docs/*.md # blocks, words, characters, segments, by-role breakdown
For every flag and the field-by-field JSON output, see kapi stats.
In a project, kapi up --plan is the estimate that matters: a dry run of the loop that names, per language, the units missing, stale and unanswered, how many the content memory answers exactly, how many the project store already holds a draft for, how many the flow would draft, and a token estimate for those, with no writes, no provider calls and no keys:
kapi up --plan
# scope missing stale unanswered content memory exact stored drafts drafted by flow out of reach ~tokens
# fr 96 0 0 18 0 78 0 20k
# de 96 1 0 18 0 79 0 21k
--json emits the same table for a script or a pull-request comment (the loop in CI); the columns are explained under the kapi loop.
Next
- Reuse what you've translated: shrink the job before pricing it.
- Hand off to translators: extract, translate, merge back.