Token usage for refactor jobs

Cloudera Migration Assistant records how many LLM tokens each refactor job uses. The web interface does not display these counts. Get them from the Cloudera Migration Assistant REST API, and check the cost with your LLM provider.

Token counts

For each job, Cloudera Migration Assistant stores these counts with the job and with each of its iterations:

Table 1. Token count fields
Field Where What it counts
totalInputTokens Job The input tokens of all the LLM requests of the job
totalOutputTokens Job The output tokens of all the LLM requests of the job
totalLlmCalls Job The number of LLM requests of the job
iterationInputTokens Iteration The input tokens of the iteration
iterationOutputTokens Iteration The output tokens of the iteration

The counts come from the usage that the LLM endpoint reports with each answer. Cloudera Migration Assistant updates the job totals after each iteration, and again when the job ends.

Reading counts

To read the counts, request the job or its iterations from the REST API of the Cloudera Migration Assistant server:

GET /api/code-migration/jobs/[***JOB-ID***]
GET /api/code-migration/jobs/[***JOB-ID***]/iterations

The Refactor page displays the Duration and the number of Iterations of each job, which also indicate how much work a job did.