Fine-tuning
Fine-tuning trains a custom model on your own examples, so it responds in your format and tone by default instead of needing that spelled out in every prompt. This page covers preparing a dataset, running a training job, deploying the result, and how it’s billed.
Preparing a dataset
Upload a CSV with a header row — one column of input, one column of the response you want for it. It’s converted into training records automatically; a dataset that’s too small or malformed to produce a usable training set is rejected before a job ever starts, so you find out immediately rather than after paying for a run.
Running a training job
Under AI Gateway → Fine-tuning, validate your dataset, review the quote and choose Accept and start training. The job runs against your data for a fixed number of passes over the whole set — you don’t configure hyperparameters yourself; watch progress from the dashboard the same way you’d watch a deploy.
Status interruptions are retried automatically while your job remains visible. Wait for training and deployment to finish before deleting the model.
Deploying the custom model
When training finishes, the resulting model deploys automatically and shows up in your model catalog as a custom-* id, visible only to your account. Call it exactly like any built-in model, through the same /v1/chat/completions endpoint.
Billing
Review and accept the fixed job quote before starting. It uses the UTF-8 size of the normalized dataset (1 MB = 1,000,000 bytes), covers two training passes, and rounds up to cents. Add enough credits to cover it. Successful training charges that accepted amount once; it is not a measured-token estimate.
Custom model storage bills from successful training until deletion, prorated by time. Inference has its own token charges. The live rate card lists the job-quote and storage rates. Deleting a finished model removes its inference deployment and stored custom model; it cannot cancel a running training job.
Next
- Models — where a fine-tuned model appears once deployed.
- AI Gateway quickstart — call a model before you fine-tune one.