Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Retrieve fine-tuning job

FineTuningJob fineTuning().jobs().retrieve(JobRetrieveParamsparams = JobRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/fine_tuning/jobs/{fine_tuning_job_id}

Get info about a fine-tuning job.

Learn more about fine-tuning

ParametersExpand Collapse
JobRetrieveParams params
Optional<String> fineTuningJobId
ReturnsExpand Collapse
class FineTuningJob:

The fine_tuning.job object represents a fine-tuning job that has been created through the API.

String id

The object identifier, which can be referenced in the API endpoints.

long createdAt

The Unix timestamp (in seconds) for when the fine-tuning job was created.

formatunixtime
Optional<Error> error

For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.

Optional<String> fineTunedModel

The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.

Optional<Long> finishedAt

The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.

formatunixtime
Hyperparameters hyperparameters

The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.

String model

The base model that is being fine-tuned.

JsonValue; object_ "fine_tuning.job"constant"fine_tuning.job"constant

The object type, which is always “fine_tuning.job”.

String organizationId

The organization that owns the fine-tuning job.

List<String> resultFiles

The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.

long seed

The seed used for the fine-tuning job.

Status status

The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.

Optional<Long> trainedTokens

The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.

String trainingFile

The file ID used for training. You can retrieve the training data with the Files API.

Optional<String> validationFile

The file ID used for validation. You can retrieve the validation results with the Files API.

Optional<Long> estimatedFinish

The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.

formatunixtime
Optional<List<FineTuningJobWandbIntegrationObject>> integrations

A list of integrations to enable for this fine-tuning job.

Optional<Metadata> 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.

Optional<Method> method

The method used for fine-tuning.

Retrieve fine-tuning job

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.finetuning.jobs.FineTuningJob;
import com.openai.models.finetuning.jobs.JobRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        FineTuningJob fineTuningJob = client.fineTuning().jobs().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
    }
}
{
  "object": "fine_tuning.job",
  "id": "ftjob-abc123",
  "model": "davinci-002",
  "created_at": 1692661014,
  "finished_at": 1692661190,
  "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
  "organization_id": "org-123",
  "result_files": [
      "file-abc123"
  ],
  "status": "succeeded",
  "validation_file": null,
  "training_file": "file-abc123",
  "hyperparameters": {
      "n_epochs": 4,
      "batch_size": 1,
      "learning_rate_multiplier": 1.0
  },
  "trained_tokens": 5768,
  "integrations": [],
  "seed": 0,
  "estimated_finish": 0,
  "method": {
    "type": "supervised",
    "supervised": {
      "hyperparameters": {
        "n_epochs": 4,
        "batch_size": 1,
        "learning_rate_multiplier": 1.0
      }
    }
  }
}
Returns Examples
{
  "object": "fine_tuning.job",
  "id": "ftjob-abc123",
  "model": "davinci-002",
  "created_at": 1692661014,
  "finished_at": 1692661190,
  "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
  "organization_id": "org-123",
  "result_files": [
      "file-abc123"
  ],
  "status": "succeeded",
  "validation_file": null,
  "training_file": "file-abc123",
  "hyperparameters": {
      "n_epochs": 4,
      "batch_size": 1,
      "learning_rate_multiplier": 1.0
  },
  "trained_tokens": 5768,
  "integrations": [],
  "seed": 0,
  "estimated_finish": 0,
  "method": {
    "type": "supervised",
    "supervised": {
      "hyperparameters": {
        "n_epochs": 4,
        "batch_size": 1,
        "learning_rate_multiplier": 1.0
      }
    }
  }
}