:jobId path parameter.
Fine-tuning requires uploading a training file first. Use
POST /v1/files with purpose=fine-tune to prepare your data.Endpoint routing
All fine-tuning requests are handled at/v1/fine_tuning/jobs/:jobId?/:cancel?. The gateway dispatches to the correct operation based on the method and path:
| Method | Path | Operation |
|---|---|---|
GET | /v1/fine_tuning/jobs | List fine-tuning jobs |
POST | /v1/fine_tuning/jobs | Create a fine-tuning job |
GET | /v1/fine_tuning/jobs/:id | Retrieve a fine-tuning job |
POST | /v1/fine_tuning/jobs/:id/cancel | Cancel a fine-tuning job |
List fine-tuning jobs
GET /v1/fine_tuning/jobs
Returns a list of fine-tuning jobs for the configured provider.
Request
The provider to route the request to.
Your Portkey API key or provider API key.
Maximum number of jobs to return.
Cursor for pagination. Pass the
id of the last job from the previous page.Response
Always
list.Array of fine-tuning job objects.
Whether additional jobs are available.
Create a fine-tuning job
POST /v1/fine_tuning/jobs
Creates a new fine-tuning job. The request body is forwarded directly to the provider.
Request
The provider to route the request to.
Your Portkey API key or provider API key.
The ID of the uploaded training file (must have
purpose=fine-tune).The base model to fine-tune. For example,
gpt-4o-mini-2024-07-18.The ID of an optional validation file.
A string of up to 18 characters appended to the fine-tuned model name.
Optional key-value metadata to attach to the job.
Response
Unique identifier for the fine-tuning job.
Always
fine_tuning.job.The base model being fine-tuned.
The name of the fine-tuned model once training completes.
null while in progress.Current job status. Values:
validating_files, queued, running, succeeded, failed, cancelled.Unix timestamp when the job was created.
Number of tokens used in training, or
null if not yet available.Retrieve a fine-tuning job
GET /v1/fine_tuning/jobs/:id
Retrieves details for a specific fine-tuning job. Use this to poll the status of an in-progress job.
Request
The ID of the fine-tuning job to retrieve.
The provider to route the request to.
Your Portkey API key or provider API key.
Response
Returns a single fine-tuning job object. See Create a fine-tuning job for the full field list.Cancel a fine-tuning job
POST /v1/fine_tuning/jobs/:id/cancel
Cancels a fine-tuning job that is queued or running.
Request
The ID of the fine-tuning job to cancel.
The provider to route the request to.
Your Portkey API key or provider API key.
Response
Returns the updated fine-tuning job object withstatus: cancelled.