How tokens are counted
The total tokens for a job is:client.fine_tuning.retrieve(id=<JOB_ID>).
If you disable packing, training tokens are computed as dataset_length × max_seq_length instead.
Estimate a job cost
To approximate the cost of a fine-tuning job before launching:- Estimate training tokens:
context_length × batch_size × steps × epochs. - Add validation tokens:
validation_dataset_size × n_evals. - Multiply by the per-token rate for your model size, method, and implementation.
context_length=8192, batch_size=8, steps=1000, and 1 epoch processes roughly 65.5M training tokens. A validation file of 1M tokens with n_evals=10 adds another 10M. Multiply the total by the LoRA SFT rate for the 16B bracket.