Cancel fine-tuning

POST /fine_tuning/jobs/{fine_tuning_job_id}/cancel

Immediately cancel a fine-tune job.

Path parameters

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • id string Required

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

    • created_at integer Required

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

    • error object | null Required

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

      Hide error attributes Show error attributes object | null
      • code string Required

        A machine-readable error code.

      • message string Required

        A human-readable error message.

      • param string | null Required

        The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific.

    • fine_tuned_model string | null Required

      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 integer | null Required

      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 object Required

      The hyperparameters used for the fine-tuning job. See the fine-tuning guide for more details.

      Hide hyperparameters attribute Show hyperparameters attribute object
      • n_epochs string | integer Required

        One of:

        The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. "auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.

        Value is auto. Default value is auto.

        The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. "auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.

        Minimum value is 1, maximum value is 50. Default value is auto.

    • model string Required

      The base model that is being fine-tuned.

    • object string Required

      The object type, which is always "fine_tuning.job".

      Value is fine_tuning.job.

    • organization_id string Required

      The organization that owns the fine-tuning job.

    • result_files array[string] Required

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

    • status string Required

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

      Values are validating_files, queued, running, succeeded, failed, or cancelled.

    • trained_tokens integer | null Required

      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 string Required

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

    • validation_file string | null Required

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

    • integrations array[object] | null

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

      Not more than 5 elements.

      Hide integrations attributes Show integrations attributes object
      • type string Required

        The type of the integration being enabled for the fine-tuning job

        Value is wandb.

      • wandb object Required

        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.

        Hide wandb attributes Show wandb attributes object
        • project string Required

          The name of the project that the new run will be created under.

        • name string | null

          A display name to set for the run. If not set, we will use the Job ID as the name.

        • entity string | null

          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.

        • tags array[string]

          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}".

    • seed integer Required

      The seed used for the fine-tuning job.

    • estimated_finish integer | null

      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.

POST /fine_tuning/jobs/{fine_tuning_job_id}/cancel
curl \
 -X POST https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F/cancel \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "id": "string",
  "created_at": 42,
  "error": {
    "code": "string",
    "message": "string",
    "param": "string"
  },
  "fine_tuned_model": "string",
  "finished_at": 42,
  "hyperparameters": {
    "n_epochs": "auto"
  },
  "model": "string",
  "object": "fine_tuning.job",
  "organization_id": "string",
  "result_files": [
    "file-abc123"
  ],
  "status": "validating_files",
  "trained_tokens": 42,
  "training_file": "string",
  "validation_file": "string",
  "integrations": [
    {
      "type": "wandb",
      "wandb": {
        "project": "my-wandb-project",
        "name": "string",
        "entity": "string",
        "tags": [
          "custom-tag"
        ]
      }
    }
  ],
  "seed": 42,
  "estimated_finish": 42
}