POST /fine_tuning/jobs
Provider capabilities
The table below summarizes gateway support for this endpoint by provider.Legend:
- ✅ Supported by provider and TrueFoundry
- Provided by provider, but not by TrueFoundry
- Provider does not support this feature
For every gateway endpoint and provider, see Supported APIs.
This guide explains how to fine-tune models using TrueFoundry’s AI Gateway with OpenAI or Vertex AI providers.
Client Setup
All providers use the OpenAI SDK with provider-specific headers. Choose your provider to get started:Training File Format
Create a JSONL file with one JSON object per line. Each line represents a conversation pair for training:Workflow Steps
The finetuning process follows these steps for all providers:- Upload: Upload training file → Get file ID
- Create: Create finetune job → Get job ID
- Monitor: Check status until complete
- Use: Use the fine-tuned model for inference
Step-by-Step Examples
1. Upload Training File
1. Upload Training File
2. Create Finetune Job
2. Create Finetune Job
3. Monitor Job Status
3. Monitor Job Status
4. Use the Fine-tuned Model
4. Use the Fine-tuned Model
Once the job status is To call the fine-tuned model through the AI Gateway, it must be available in your provider account. Open AI Gateway > Models and check the account’s model list — if the fine-tuned model does not appear there after the job succeeds, click Add Model > To Existing Provider Account and add it manually with the exact fine-tuned model ID from the job (for OpenAI, the
succeeded, read the fine-tuned model identifier from the job:ft:... identifier). Then call it like any other gateway model:Fine-tuned models usually have no public pricing, so cost is not tracked for them automatically. Set a private cost on the model if you want spend recorded — see Set model pricing.
Status Reference
queued: Job is queued and waiting to startrunning: Fine-tuning is in progresssucceeded: Fine-tuning completed successfullyfailed: Fine-tuning failed
Hyperparameters
You can configure the following hyperparameters in thehyperparameters object:
n_epochs: Number of training epochsbatch_size: Batch sizelearning_rate_multiplier: Learning rate multiplier