> ## Documentation Index
> Fetch the complete documentation index at: https://openai-hd4n6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve fine-tuning job

> Get info about a fine-tuning job.
[Learn more about fine-tuning](/docs/guides/fine-tuning)



## OpenAPI

````yaml api-definition.yaml get /fine_tuning/jobs/{fine_tuning_job_id}
openapi: 3.0.0
info:
  title: OpenAI API
  description: >-
    The OpenAI REST API. Please see
    https://platform.openai.com/docs/api-reference for more details.
  version: 2.3.0
  termsOfService: https://openai.com/policies/terms-of-use
  contact:
    name: OpenAI Support
    url: https://help.openai.com/
  license:
    name: MIT
    url: https://github.com/openai/openai-openapi/blob/master/LICENSE
servers:
  - url: https://api.openai.com/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Assistants
    description: Build Assistants that can call models and use tools.
  - name: Audio
    description: Turn audio into text or text into audio.
  - name: Chat
    description: >-
      Given a list of messages comprising a conversation, the model will return
      a response.
  - name: Completions
    description: >-
      Given a prompt, the model will return one or more predicted completions,
      and can also return the probabilities of alternative tokens at each
      position.
  - name: Embeddings
    description: >-
      Get a vector representation of a given input that can be easily consumed
      by machine learning models and algorithms.
  - name: Evals
    description: Manage and run evals in the OpenAI platform.
  - name: Fine-tuning
    description: Manage fine-tuning jobs to tailor a model to your specific training data.
  - name: Batch
    description: Create large batches of API requests to run asynchronously.
  - name: Files
    description: >-
      Files are used to upload documents that can be used with features like
      Assistants and Fine-tuning.
  - name: Uploads
    description: Use Uploads to upload large files in multiple parts.
  - name: Images
    description: Given a prompt and/or an input image, the model will generate a new image.
  - name: Models
    description: List and describe the various models available in the API.
  - name: Moderations
    description: >-
      Given text and/or image inputs, classifies if those inputs are potentially
      harmful.
  - name: Audit Logs
    description: List user actions and configuration changes within this organization.
paths:
  /fine_tuning/jobs/{fine_tuning_job_id}:
    get:
      tags:
        - Fine-tuning
      summary: Retrieve fine-tuning job
      description: |-
        Get info about a fine-tuning job.
        [Learn more about fine-tuning](/docs/guides/fine-tuning)
      operationId: retrieveFineTuningJob
      parameters:
        - in: path
          name: fine_tuning_job_id
          required: true
          schema:
            type: string
            example: ft-AF1WoRqd3aJAHsqc9NY7iL8F
          description: |
            The ID of the fine-tuning job.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTuningJob'
components:
  schemas:
    FineTuningJob:
      type: object
      title: FineTuningJob
      description: >
        The `fine_tuning.job` object represents a fine-tuning job that has been
        created through the API.
      properties:
        id:
          type: string
          description: The object identifier, which can be referenced in the API endpoints.
        created_at:
          type: integer
          description: >-
            The Unix timestamp (in seconds) for when the fine-tuning job was
            created.
        error:
          type: object
          nullable: true
          description: >-
            For fine-tuning jobs that have `failed`, this will contain more
            information on the cause of the failure.
          properties:
            code:
              type: string
              description: A machine-readable error code.
            message:
              type: string
              description: A human-readable error message.
            param:
              type: string
              description: >-
                The parameter that was invalid, usually `training_file` or
                `validation_file`. This field will be null if the failure was
                not parameter-specific.
              nullable: true
          required:
            - code
            - message
            - param
        fine_tuned_model:
          type: string
          nullable: true
          description: >-
            The name of the fine-tuned model that is being created. The value
            will be null if the fine-tuning job is still running.
        finished_at:
          type: integer
          nullable: true
          description: >-
            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.
        hyperparameters:
          type: object
          description: >-
            The hyperparameters used for the fine-tuning job. This value will
            only be returned when running `supervised` jobs.
          properties:
            batch_size:
              description: >
                Number of examples in each batch. A larger batch size means that
                model parameters

                are updated less frequently, but with lower variance.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 256
              default: auto
            learning_rate_multiplier:
              description: >
                Scaling factor for the learning rate. A smaller learning rate
                may be useful to avoid

                overfitting.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  exclusiveMinimum: true
              default: auto
            n_epochs:
              description: >
                The number of epochs to train the model for. An epoch refers to
                one full cycle

                through the training dataset.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
        model:
          type: string
          description: The base model that is being fine-tuned.
        object:
          type: string
          description: The object type, which is always "fine_tuning.job".
          enum:
            - fine_tuning.job
          x-stainless-const: true
        organization_id:
          type: string
          description: The organization that owns the fine-tuning job.
        result_files:
          type: array
          description: >-
            The compiled results file ID(s) for the fine-tuning job. You can
            retrieve the results with the [Files
            API](/docs/api-reference/files/retrieve-contents).
          items:
            type: string
            example: file-abc123
        status:
          type: string
          description: >-
            The current status of the fine-tuning job, which can be either
            `validating_files`, `queued`, `running`, `succeeded`, `failed`, or
            `cancelled`.
          enum:
            - validating_files
            - queued
            - running
            - succeeded
            - failed
            - cancelled
        trained_tokens:
          type: integer
          nullable: true
          description: >-
            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.
        training_file:
          type: string
          description: >-
            The file ID used for training. You can retrieve the training data
            with the [Files API](/docs/api-reference/files/retrieve-contents).
        validation_file:
          type: string
          nullable: true
          description: >-
            The file ID used for validation. You can retrieve the validation
            results with the [Files
            API](/docs/api-reference/files/retrieve-contents).
        integrations:
          type: array
          nullable: true
          description: A list of integrations to enable for this fine-tuning job.
          maxItems: 5
          items:
            oneOf:
              - $ref: '#/components/schemas/FineTuningIntegration'
            x-oaiExpandable: true
        seed:
          type: integer
          description: The seed used for the fine-tuning job.
        estimated_finish:
          type: integer
          nullable: true
          description: >-
            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.
        method:
          $ref: '#/components/schemas/FineTuneMethod'
        metadata:
          $ref: '#/components/schemas/Metadata'
      required:
        - created_at
        - error
        - finished_at
        - fine_tuned_model
        - hyperparameters
        - id
        - model
        - object
        - organization_id
        - result_files
        - status
        - trained_tokens
        - training_file
        - validation_file
        - seed
      x-oaiMeta:
        name: The fine-tuning job object
        example: |
          {
            "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
                }
              }
            },
            "metadata": {
              "key": "value"
            }
          }
    FineTuningIntegration:
      type: object
      title: Fine-Tuning Job Integration
      required:
        - type
        - wandb
      properties:
        type:
          type: string
          description: The type of the integration being enabled for the fine-tuning job
          enum:
            - wandb
          x-stainless-const: true
        wandb:
          type: object
          description: >
            The settings for your integration with Weights and Biases. This
            payload specifies the project that

            metrics will be sent to. Optionally, you can set an explicit display
            name for your run, add tags

            to your run, and set a default entity (team, username, etc) to be
            associated with your run.
          required:
            - project
          properties:
            project:
              description: |
                The name of the project that the new run will be created under.
              type: string
              example: my-wandb-project
            name:
              description: >
                A display name to set for the run. If not set, we will use the
                Job ID as the name.
              nullable: true
              type: string
            entity:
              description: >
                The entity to use for the run. This allows you to set the team
                or username of the WandB user that you would

                like associated with the run. If not set, the default entity for
                the registered WandB API key is used.
              nullable: true
              type: string
            tags:
              description: >
                A list of tags to be attached to the newly created run. These
                tags are passed through directly to WandB. Some

                default tags are generated by OpenAI: "openai/finetune",
                "openai/{base-model}", "openai/{ftjob-abcdef}".
              type: array
              items:
                type: string
                example: custom-tag
    FineTuneMethod:
      type: object
      description: The method used for fine-tuning.
      properties:
        type:
          type: string
          description: The type of method. Is either `supervised` or `dpo`.
          enum:
            - supervised
            - dpo
        supervised:
          $ref: '#/components/schemas/FineTuneSupervisedMethod'
        dpo:
          $ref: '#/components/schemas/FineTuneDPOMethod'
    Metadata:
      type: object
      description: >
        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.
      additionalProperties:
        type: string
      x-oaiTypeLabel: map
      nullable: true
    FineTuneSupervisedMethod:
      type: object
      description: Configuration for the supervised fine-tuning method.
      properties:
        hyperparameters:
          type: object
          description: The hyperparameters used for the fine-tuning job.
          properties:
            batch_size:
              description: >
                Number of examples in each batch. A larger batch size means that
                model parameters are updated less frequently, but with lower
                variance.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 256
              default: auto
            learning_rate_multiplier:
              description: >
                Scaling factor for the learning rate. A smaller learning rate
                may be useful to avoid overfitting.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  exclusiveMinimum: true
              default: auto
            n_epochs:
              description: >
                The number of epochs to train the model for. An epoch refers to
                one full cycle through the training dataset.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
    FineTuneDPOMethod:
      type: object
      description: Configuration for the DPO fine-tuning method.
      properties:
        hyperparameters:
          type: object
          description: The hyperparameters used for the fine-tuning job.
          properties:
            beta:
              description: >
                The beta value for the DPO method. A higher beta value will
                increase the weight of the penalty between the policy and
                reference model.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  maximum: 2
                  exclusiveMinimum: true
              default: auto
            batch_size:
              description: >
                Number of examples in each batch. A larger batch size means that
                model parameters are updated less frequently, but with lower
                variance.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 256
              default: auto
            learning_rate_multiplier:
              description: >
                Scaling factor for the learning rate. A smaller learning rate
                may be useful to avoid overfitting.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  exclusiveMinimum: true
              default: auto
            n_epochs:
              description: >
                The number of epochs to train the model for. An epoch refers to
                one full cycle through the training dataset.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````