NAME
OpenAPI::Client::OpenAI::Path::fine_tuning-jobs - Documentation for the /fine_tuning/jobs path.
OPERATIONS
GET /fine_tuning/jobs
listPaginatedFineTuningJobs
$client->list_paginated_fine_tuning_jobs({
body => { ... },
});
List your organization's fine-tuning jobs
Path/query parameters
after(in query, optional, string) - Identifier for the last job from the previous pagination request.limit(in query, optional, integer) - Number of fine-tuning jobs to retrieve.Default: 20
metadata(in query, optional, object) - Optional metadata filter. To filter, use the syntaxmetadata[k]=v. Alternatively, setmetadata=nullto indicate no metadata.
Responses
200 - OK
Content-Type: application/json
Example:
{
"data" : [
"{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n"
],
"has_more" : false,
"object" : "list"
}
POST /fine_tuning/jobs
createFineTuningJob
$client->create_fine_tuning_job({
body => { ... },
});
Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
Request body
Content-Type: application/json
Example:
"{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
Responses
200 - OK
Content-Type: application/json
Example:
"{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
SCHEMAS
CreateFineTuningJobRequest
Properties:
hyperparameters(object) - The hyperparameters used for the fine-tuning job. This value is now deprecated in favor ofmethod, and should be passed in under themethodparameter.integrations(array of object) - A list of integrations to enable for your fine-tuning job.metadata(Metadata)See "Metadata" below for shape.
method(FineTuneMethod)See "FineTuneMethod" below for shape.
model(anyOf, required) - The name of the model to fine-tune. You can select one of the supported models .seed(integer) - The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed is not specified, one will be generated for you.suffix(string) - A string of up to 64 characters that will be added to your fine-tuned model name.For example, a
suffixof "custom-model-name" would produce a model name likeft:gpt-4o-mini:openai:custom-model-name:7p4lURel.Default: null
training_file(string, required) - The ID of an uploaded file that contains training data.See upload file for how to upload a file.
Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose
fine-tune.The contents of the file should differ depending on if the model uses the chat , completions format, or if the fine-tuning method uses the preference format.
See the fine-tuning guide for more details.
validation_file(string) - The ID of an uploaded file that contains validation data.If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the fine-tuning results file. The same data should not be present in both train and validation files.
Your dataset must be formatted as a JSONL file. You must upload your file with the purpose
fine-tune.See the fine-tuning guide for more details.
FineTuneDPOHyperparameters
Properties:
batch_size(oneOf) - Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.Default: auto
beta(oneOf) - The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.Default: auto
learning_rate_multiplier(oneOf) - Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.Default: auto
n_epochs(oneOf) - The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.Default: auto
FineTuneDPOMethod
Properties:
hyperparameters(FineTuneDPOHyperparameters)See "FineTuneDPOHyperparameters" below for shape.
FineTuneMethod
Properties:
dpo(FineTuneDPOMethod)See "FineTuneDPOMethod" below for shape.
reinforcement(FineTuneReinforcementMethod)See "FineTuneReinforcementMethod" below for shape.
supervised(FineTuneSupervisedMethod)See "FineTuneSupervisedMethod" below for shape.
type(string, required) - The type of method. Is eithersupervised,dpo, orreinforcement.Allowed values: supervised, dpo, reinforcement
FineTuneReinforcementHyperparameters
Properties:
batch_size(oneOf) - Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.Default: auto
compute_multiplier(oneOf) - Multiplier on amount of compute used for exploring search space during training.Default: auto
eval_interval(oneOf) - The number of training steps between evaluation runs.Default: auto
eval_samples(oneOf) - Number of evaluation samples to generate per training step.Default: auto
learning_rate_multiplier(oneOf) - Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.Default: auto
n_epochs(oneOf) - The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.Default: auto
reasoning_effort(string) - Level of reasoning effort.Allowed values: default, low, medium, high
Default: default
FineTuneReinforcementMethod
Properties:
grader(object, required) - The grader used for the fine-tuning job.hyperparameters(FineTuneReinforcementHyperparameters)See "FineTuneReinforcementHyperparameters" below for shape.
FineTuneSupervisedHyperparameters
Properties:
batch_size(oneOf) - Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.Default: auto
learning_rate_multiplier(oneOf) - Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.Default: auto
n_epochs(oneOf) - The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.Default: auto
FineTuneSupervisedMethod
Properties:
hyperparameters(FineTuneSupervisedHyperparameters)See "FineTuneSupervisedHyperparameters" below for shape.
FineTuningJob
Properties:
created_at(integer, required) - The Unix timestamp (in seconds) for when the fine-tuning job was created.error(anyOf, required)estimated_finish(anyOf)fine_tuned_model(anyOf, required)finished_at(anyOf, required)hyperparameters(object, required) - The hyperparameters used for the fine-tuning job. This value will only be returned when runningsupervisedjobs.id(string, required) - The object identifier, which can be referenced in the API endpoints.integrations(anyOf)metadata(Metadata)See "Metadata" below for shape.
method(FineTuneMethod)See "FineTuneMethod" below for shape.
model(string, required) - The base model that is being fine-tuned.object(string, required) - The object type, which is always "fine_tuning.job".Allowed values: fine_tuning.job
organization_id(string, required) - The organization that owns the fine-tuning job.result_files(array of string, required) - The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API .seed(integer, required) - The seed used for the fine-tuning job.status(string, required) - The current status of the fine-tuning job, which can be eithervalidating_files,queued,running,succeeded,failed, orcancelled.Allowed values: validating_files, queued, running, succeeded, failed, cancelled
trained_tokens(anyOf, required)training_file(string, required) - The file ID used for training. You can retrieve the training data with the Files API .validation_file(anyOf, required)
ListPaginatedFineTuningJobsResponse
Properties:
data(array of FineTuningJob, required)has_more(boolean, required)object(string, required)Allowed values: list
Metadata
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.