swagger: "2.0"
info:
  title: Azure OpenAI API version 2024-12-01-preview
  description: APIs for fine-tuning and managing deployments of OpenAI models.
  version: 2024-12-01-preview
paths:
  /batches:
    get:
      tags:
        - "Batch:"
      summary: Gets a list of all batches owned by the Azure OpenAI resource.
      operationId: Batch_List
      produces:
        - application/json
      parameters:
        - in: query
          name: after
          description: Identifier for the last event from the previous pagination request.
          type: string
        - in: query
          name: limit
          description: Number of batches to retrieve. Defaults to 20.
          type: integer
          format: int32
          default: 20
        - in: query
          name: $filter
          description: The OData expression to describe the filtering conditions.
          type: string
        - in: query
          name: $orderby
          description: The OData expression to describe the sorting order.
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/BatchesList"
          headers:
            deployment-enqueued-tokens:
              description: Sum of enqueued tokens of all jobs that target to the deployment.
              type: integer
              format: int64
            deployment-maximum-enqueued-tokens:
              description: Maximum enqueued tokens of the deployment.
              type: integer
              format: int64
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting all batches owned by this account.:
          $ref: ./examples/get_batches.json
    post:
      tags:
        - "Batch:"
      summary: "Creates and executes a batch from an uploaded file of requests.\r\nResponse includes details of the enqueued job including job status.\r\nThe ID of the result file is added to the response once complete."
      operationId: Batch_Create
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: body
          name: createBatchRequest
          description: The specification of the batch to create and execute.
          required: true
          schema:
            $ref: "#/definitions/BatchCreateRequest"
      responses:
        "201":
          description: The batch has been successfully created.
          schema:
            $ref: "#/definitions/Batch"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Creating a batch.:
          $ref: ./examples/post_batch.json
  /batches/{batch-id}:
    get:
      tags:
        - "Batch:"
      summary: Gets details for a single batch specified by the given batch-id.
      operationId: Batch_Get
      produces:
        - application/json
      parameters:
        - in: path
          name: batch-id
          description: The identifier of the batch.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/Batch"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting a batch.:
          $ref: ./examples/get_batch.json
  /batches/{batch-id}/cancel:
    post:
      tags:
        - "Batch:"
      summary: Cancels the processing of the batch specified by the given batch-id.
      operationId: Batch_Cancel
      produces:
        - application/json
      parameters:
        - in: path
          name: batch-id
          description: The identifier of the batch.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: The batch has been successfully canceled.
          schema:
            $ref: "#/definitions/Batch"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Canceling a batch.:
          $ref: ./examples/cancel_batch.json
  /files:
    get:
      tags:
        - "Files:"
      summary: "Gets a list of all files owned by the Azure OpenAI resource.\r\nThese include user uploaded content like files with purpose \"fine-tune\" for training or validation of fine-tunes models\r\nas well as files that are generated by the service such as \"fine-tune-results\" which contains various metrics for the corresponding fine-tune job."
      operationId: Files_List
      produces:
        - application/json
      parameters:
        - in: query
          name: purpose
          description: Only return files with the given purpose.
          type: string
          enum:
            - fine-tune
            - fine-tune-results
            - assistants
            - assistants_output
            - batch
            - batch_output
          x-ms-enum:
            name: Purpose
            modelAsString: true
            values:
              - value: fine-tune
                description: This file contains training data for a fine tune job.
              - value: fine-tune-results
                description: This file contains the results of a fine tune job.
              - value: assistants
                description: This file contains data to be used in assistants.
              - value: assistants_output
                description: This file contains the results of an assistant.
              - value: batch
                description: This file contains the input data for a batch.
              - value: batch_output
                description: This file contains the results of a batch.
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/FileList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting all files owned by this account.:
          $ref: ./examples/get_files.yaml
    post:
      tags:
        - "Files:"
      summary: Creates a new file entity by uploading data from a local machine. Uploaded files can, for example, be used for training or evaluating fine-tuned models.
      operationId: Files_Upload
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: formData
          name: purpose
          description: The intended purpose of the uploaded documents. Use "fine-tune" for fine-tuning. This allows us to validate the format of the uploaded file.
          required: true
          type: string
          enum:
            - fine-tune
            - fine-tune-results
            - assistants
            - assistants_output
            - batch
          x-ms-enum:
            name: Purpose
            modelAsString: true
            values:
              - value: fine-tune
                description: This file contains training data for a fine tune job.
              - value: fine-tune-results
                description: This file contains the results of a fine tune job.
              - value: assistants
                description: This file contains data to be used in assistants.
              - value: assistants_output
                description: This file contains the results of an assistant.
              - value: batch
                description: This file contains the input data for a batch.
        - in: formData
          name: file
          description: Gets or sets the file to upload into Azure OpenAI.
          required: true
          type: file
      responses:
        "201":
          description: The file has been successfully created.
          schema:
            $ref: "#/definitions/File"
          headers:
            Location:
              description: The location of the newly created item.
              type: string
              format: url
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Upload a file.:
          $ref: ./examples/upload_file.yaml
  /files/import:
    post:
      tags:
        - "Files:"
      summary: Creates a new file entity by importing data from a provided url. Uploaded files can, for example, be used for training or evaluating fine-tuned models.
      operationId: Files_Import
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: body
          name: fileImport
          description: The definition of the file to create including its purpose, the file name and the url of the file location.
          required: true
          schema:
            $ref: "#/definitions/FileImport"
      responses:
        "201":
          description: The file has been successfully created.
          schema:
            $ref: "#/definitions/File"
          headers:
            Location:
              description: The location of the newly created item.
              type: string
              format: url
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Importing a file with a blob url as source.:
          $ref: ./examples/import_file.yaml
  /files/{file-id}:
    get:
      tags:
        - "Files:"
      summary: Gets details for a single file specified by the given file-id including status, size, purpose, etc.
      operationId: Files_Get
      produces:
        - application/json
      parameters:
        - in: path
          name: file-id
          description: The identifier of the file.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/File"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting a file.:
          $ref: ./examples/get_file.yaml
    delete:
      tags:
        - "Files:"
      summary: "Deletes the file with the given file-id.\r\nDeletion is also allowed if a file was used, e.g., as training file in a fine-tune job."
      operationId: Files_Delete
      produces:
        - application/json
      parameters:
        - in: path
          name: file-id
          description: The identifier of the file.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: The file was successfully deleted.
          schema:
            $ref: '#/definitions/FileDelete'
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Deleting a file.:
          $ref: ./examples/delete_file.yaml
  /files/{file-id}/content:
    get:
      tags:
        - "Files:"
      summary: "Gets the content of the file specified by the given file-id.\r\nFiles can be user uploaded content or generated by the service like result metrics of a fine-tune job."
      operationId: Files_GetContent
      produces:
        - application/octet-stream
        - application/json
      parameters:
        - in: path
          name: file-id
          description: The identifier of the file.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            type: file
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting the file content.:
          $ref: ./examples/get_file_content.yaml
  /fine_tuning/jobs:
    get:
      tags:
        - "Fine-tuning:"
      summary: "Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.\r\nThe details that are returned for each fine-tune job contain besides its identifier\r\nthe base model, training and validation files, hyper parameters, time stamps, status and events.\r\nEvents are created when the job status changes, e.g. running or complete, and when results are uploaded."
      operationId: FineTuning_List
      produces:
        - application/json
      parameters:
        - in: query
          name: after
          description: Identifier for the last event from the previous pagination request.
          type: string
        - in: query
          name: limit
          description: Number of events to retrieve. Defaults to 20.
          type: integer
          format: int32
          default: 20
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/FineTuningJobList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting all fine tuning jobs owned by this account.:
          $ref: ./examples/get_finetuning_jobs.yaml
    post:
      tags:
        - "Fine-tuning:"
      summary: "Creates a job that fine-tunes a specified model from a given training file.\r\nResponse includes details of the enqueued job including job status and hyper parameters.\r\nThe name of the fine-tuned model is added to the response once complete."
      operationId: FineTuning_Create
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: body
          name: fineTuningJob
          description: "The specification of the fine-tuned model to create.\r\nRequired parameters are the base model and the training file to use.\r\nOptionally a validation file can be specified to compute validation metrics during training.\r\nHyper parameters will be set to default values or can be optionally specified.\r\nThese include batch size, learning rate multiplier, number of epochs and others."
          required: true
          schema:
            $ref: "#/definitions/FineTuningJobCreation"
      responses:
        "201":
          description: The fine tune has been successfully created.
          schema:
            $ref: "#/definitions/FineTuningJob"
          headers:
            Location:
              description: The location of the newly created item.
              type: string
              format: url
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Creating a fine tuning job.:
          $ref: ./examples/post_finetuning_job.yaml
  /fine_tuning/jobs/{fine-tuning-job-id}:
    get:
      tags:
        - "Fine-tuning:"
      summary: "Gets details for a single fine-tune job specified by the given fine-tune-id.\r\nThe details contain the base model, training and validation files, hyper parameters, time stamps, status and events.\r\nEvents are created when the job status changes, e.g. running or complete, and when results are uploaded."
      operationId: FineTuning_Get
      produces:
        - application/json
      parameters:
        - in: path
          name: fine-tuning-job-id
          description: The identifier of the fine-tune job.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/FineTuningJob"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting a fine tuning job.:
          $ref: ./examples/get_finetuning_job.yaml
    delete:
      tags:
        - "Fine-tuning:"
      summary: Deletes the fine-tune job specified by the given fine-tune-id.
      operationId: FineTuning_Delete
      produces:
        - application/json
      parameters:
        - in: path
          name: fine-tuning-job-id
          description: The identifier of the fine-tune job.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "204":
          description: The fine tune was successfully deleted.
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Deleting a fine tuning job.:
          $ref: ./examples/delete_finetuning_job.yaml
  /fine_tuning/jobs/{fine-tuning-job-id}/cancel:
    post:
      tags:
        - "Fine-tuning:"
      summary: Cancels the processing of the fine-tune job specified by the given fine-tune-id.
      operationId: FineTuning_Cancel
      produces:
        - application/json
      parameters:
        - in: path
          name: fine-tuning-job-id
          description: The identifier of the fine-tune job.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: The fine tune has been successfully canceled
          schema:
            $ref: "#/definitions/FineTuningJob"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Canceling a fine tuning job.:
          $ref: ./examples/cancel_finetuning_job.yaml
  /fine_tuning/jobs/{fine-tuning-job-id}/checkpoints:
    get:
      tags:
        - "Fine-tuning:"
      summary: "Gets the checkpoints for the fine-tune job specified by the given fine-tune-id.\r\nCheckpoints are created at the end of successful epochs during training."
      operationId: FineTuning_GetCheckpoints
      produces:
        - application/json
      parameters:
        - in: path
          name: fine-tuning-job-id
          description: The identifier of the fine-tune job.
          required: true
          type: string
        - in: query
          name: after
          description: Identifier for the last checkpoint ID from the previous pagination request.
          type: string
        - in: query
          name: limit
          description: Number of checkpoints to retrieve. Defaults to 10.
          type: integer
          format: int32
          default: 10
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/FineTuningJobCheckpointList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting checkpoints of a fine tuning job.:
          $ref: ./examples/get_finetuning_job_checkpoints.yaml
  /fine_tuning/jobs/{fine-tuning-job-id}/events:
    get:
      tags:
        - "Fine-tuning:"
      summary: "Gets the events for the fine-tune job specified by the given fine-tune-id.\r\nEvents are created when the job status changes, e.g. running or complete, and when results are uploaded."
      operationId: FineTuning_GetEvents
      produces:
        - application/json
      parameters:
        - in: path
          name: fine-tuning-job-id
          description: The identifier of the fine-tune job.
          required: true
          type: string
        - in: query
          name: after
          description: Identifier for the last event from the previous pagination request.
          type: string
        - in: query
          name: limit
          description: Number of events to retrieve. Defaults to 20.
          type: integer
          format: int32
          default: 20
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/FineTuningJobEventList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting events of a fine tuning job.:
          $ref: ./examples/get_finetuning_job_events.yaml
  /ingestion/jobs:
    get:
      tags:
        - "Ingestion:"
      summary: Lists the ingestion jobs.
      operationId: IngestionJobs_List
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: header
          name: mgmt-user-token
          type: string
          description: The token used to access the workspace (needed only for user compute jobs).
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/IngestionJobList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List all ingestion jobs:
          $ref: ./examples/list_ingestion_jobs.json
  /ingestion/jobs/{job-id}:
    put:
      tags:
        - "Ingestion:"
      summary: Creates an ingestion job with the specified job id.
      operationId: IngestionJobs_Create
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: path
          name: job-id
          required: true
          type: string
          description: The id of the job that will be created.
        - in: header
          name: mgmt-user-token
          type: string
          description: The token used to access the workspace (needed only for user compute jobs).
        - in: header
          name: aml-user-token
          type: string
          description: The token used to access the resources within the job in the workspace (needed only for user compute jobs).
        - in: body
          name: ingestionJob
          schema:
            $ref: "#/definitions/IngestionJob"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/IngestionJob"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Create a system-compute ingestion job:
          $ref: ./examples/put_ingestion_job_sc.json
        Create a user-compute ingestion job:
          $ref: ./examples/put_ingestion_job_uc.json
    get:
      tags:
        - "Ingestion:"
      summary: Gets the details of the specified job id.
      operationId: IngestionJobs_Get
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: path
          name: job-id
          required: true
          description: The id of the job.
          type: string
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/IngestionJob"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Get ingestion job:
          $ref: ./examples/get_ingestion_job.json
  /ingestion/jobs/{job-id}/runs:
    get:
      tags:
        - "Ingestion:"
      summary: Lists the runs of the specified job id.
      operationId: IngestionJobRuns_List
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: path
          name: job-id
          required: true
          description: The id of the job.
          type: string
        - in: header
          name: mgmt-user-token
          type: string
          description: The token used to access the workspace (needed only for user compute jobs).
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/IngestionJobRunList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        List ingestion job runs:
          $ref: ./examples/list_ingestion_job_runs.json
  /ingestion/jobs/{job-id}/runs/{run-id}:
    get:
      tags:
        - "Ingestion:"
      summary: Gets the details of the specified run id as part of the specified job id.
      operationId: IngestionJobRuns_Get
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: path
          name: job-id
          required: true
          description: The id of the job.
          type: string
        - in: path
          name: run-id
          required: true
          description: The id of the run.
          type: string
        - in: header
          name: mgmt-user-token
          type: string
          description: The token used to access the workspace (needed only for user compute jobs).
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/IngestionJobRun"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Get ingestion job runs:
          $ref: ./examples/get_ingestion_job_run.json
  /models:
    get:
      tags:
        - "Models:"
      summary: "Gets a list of all models that are accessible by the Azure OpenAI resource.\r\nThese include base models as well as all successfully completed fine-tuned models owned by the Azure OpenAI resource."
      operationId: Models_List
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/ModelList"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting all models owned by account.:
          $ref: ./examples/get_models.yaml
  /models/{model-id}:
    get:
      tags:
        - "Models:"
      summary: Gets details for the model specified by the given modelId.
      operationId: Models_Get
      produces:
        - application/json
      parameters:
        - in: path
          name: model-id
          description: The identifier of the model.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/Model"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Getting a base model.:
          $ref: ./examples/get_model_base.yaml
        Getting a fine-tuned model.:
          $ref: ./examples/get_model_finetune.yaml
  /uploads:
    post:
      tags:
        - "UploadFile:"
      summary: "An intermediate Upload object is created, allowing you to add Parts to it. Currently, an Upload size can be a maximum of 9 GB in total and will expire two hours after being created.\r\nAfter the Upload is completed a File object will be generated, containing all the uploaded parts. This File object can then be used across our platform just like any other file."
      operationId: UploadFile_Start
      consumes:
        - application/json
        - text/json
        - application/*+json
      produces:
        - application/json
      parameters:
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: body
          name: requestBody
          description: The definition of the file to create including its purpose and the location on the local machine.
          required: true
          schema:
            $ref: "#/definitions/UploadFileStartBody"
      responses:
        "200":
          description: The upload has been successfully created.
          schema:
            $ref: "#/definitions/UploadResource"
          headers:
            Location:
              description: The location of the newly created item.
              type: string
              format: url
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Start a large file upload operation.:
          $ref: ./examples/upload_file_start.yaml
  /uploads/{upload-id}/cancel:
    post:
      tags:
        - "UploadFile:"
      summary: "Cancels the Upload, and will lead to all uploaded parts to be deleted asynchronously.\r\nNo Parts may be added after an Upload is cancelled."
      operationId: UploadFile_Cancel
      produces:
        - application/json
      parameters:
        - in: path
          name: upload-id
          description: The identifier of the upload.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/UploadResource"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Cancel a large file upload operation.:
          $ref: ./examples/upload_file_cancel.yaml
  /uploads/{upload-id}/complete:
    post:
      tags:
        - "UploadFile:"
      summary: "This completes the Upload, and the returned Upload object contains a nested File object that is ready for use across the platform.\r\nYou can define the order of the Parts by providing an ordered list of Part IDs.\r\nThe total number of bytes uploaded must match the size originally specified when creating the Upload object.\r\nAfter this operation no additional Parts can be added once the Upload is completed."
      operationId: UploadFile_Complete
      consumes:
        - application/json
        - text/json
        - application/*+json
      produces:
        - application/json
      parameters:
        - in: path
          name: upload-id
          description: The identifier of the upload.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: body
          name: requestBody
          description: The definition of the file to create including its purpose and the location on the local machine.
          required: true
          schema:
            $ref: "#/definitions/UploadFileCompleteBody"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/UploadResource"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Complete and validate a large file upload operation.:
          $ref: ./examples/upload_file_complete.yaml
  /uploads/{upload-id}/parts:
    post:
      tags:
        - "UploadFile:"
      summary: "Adds a Part to an Upload object, where each Part represents a segment of the file you are uploading.\r\nEach Part can be up to the standard size limit for file upload, based on the File Purpose. You can continue adding Parts until reaching the Upload size limit of 9 GB."
      operationId: UploadFile_Part
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - in: path
          name: upload-id
          description: The identifier of the upload.
          required: true
          type: string
        - $ref: "#/parameters/apiVersionQueryParameter"
        - in: formData
          name: data
          required: true
          type: file
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/UploadPartResource"
        default:
          description: An error occurred.
          schema:
            $ref: "#/definitions/ErrorResponse"
      x-ms-examples:
        Upload a part of large file upload operation.:
          $ref: ./examples/upload_file_part.yaml
definitions:
  AzureAISearchIndex:
    description: Azure AI Search Index.
    required:
      - connectionId
    allOf:
      - $ref: "#/definitions/TargetIndex"
      - type: object
        properties:
          connectionId:
            type: string
            description: The id of the connection pointing to the Azure AI Search Index.
    x-ms-discriminator-value: AzureAISearch
  BaseConnection:
    title: BaseConnection
    description: A connection to a resource.
    type: object
    required:
      - kind
    properties:
      kind:
        $ref: "#/definitions/ConnectionType"
    discriminator: kind
  Batch:
    title: Batch
    description: Defines the values of a batch.
    required:
      - id
      - input_file_id
    type: object
    properties:
      id:
        description: The identity of this item.
        type: string
      object:
        $ref: "#/definitions/TypeDiscriminator"
      endpoint:
        description: The API endpoint used by the batch.
        type: string
        readOnly: true
      errors:
        $ref: "#/definitions/BatchErrors"
      input_file_id:
        description: The ID of the input file for the batch.
        minLength: 1
        type: string
      completion_window:
        description: The time frame within which the batch should be processed.
        type: string
      status:
        $ref: "#/definitions/BatchStatus"
      output_file_id:
        description: The ID of the file containing outputs of successfully executed requests.
        type: string
      error_file_id:
        description: The ID of the file containing outputs of requests with errors.
        type: string
      created_at:
        format: unixtime
        description: A timestamp when this batch was created (in unix epochs).
        type: integer
        readOnly: true
      in_progress_at:
        format: unixtime
        description: A timestamp when this batch started progressing (in unix epochs).
        type: integer
        readOnly: true
      expires_at:
        format: unixtime
        description: A timestamp when this batch will expire (in unix epochs).
        type: integer
        readOnly: true
      finalizing_at:
        format: unixtime
        description: A timestamp when this batch started finalizing (in unix epochs).
        type: integer
        readOnly: true
      completed_at:
        format: unixtime
        description: A timestamp when this batch was completed (in unix epochs).
        type: integer
        readOnly: true
      failed_at:
        format: unixtime
        description: A timestamp when this batch failed (in unix epochs).
        type: integer
        readOnly: true
      expired_at:
        format: unixtime
        description: A timestamp when this batch expired (in unix epochs).
        type: integer
        readOnly: true
      cancelling_at:
        format: unixtime
        description: A timestamp when this batch started cancelling (in unix epochs).
        type: integer
        readOnly: true
      cancelled_at:
        format: unixtime
        description: A timestamp when this batch was cancelled (in unix epochs).
        type: integer
        readOnly: true
      request_counts:
        $ref: "#/definitions/BatchRequestCounts"
      metadata:
        description: A set of key-value pairs that can be attached to the batch. This can be useful for storing additional infomration about the batch in a structured format.
        type: object
        additionalProperties:
          type: string
  BatchCreateRequest:
    title: BatchCreateRequest
    description: Defines the request to create a batch.
    required:
      - input_file_id
      - endpoint
      - completion_window
    type: object
    properties:
      input_file_id:
        description: The ID if the input file for the batch.
        minLength: 1
        type: string
      endpoint:
        description: The API endpoint used by the batch.
        type: string
      completion_window:
        description: The time frame within which the batch should be processed.
        type: string
      metadata:
        description: A set of key-value pairs that can be attached to the batch. This can be useful for storing additional infomration about the batch in a structured format.
        type: object
        additionalProperties:
          type: string
  BatchErrorData:
    title: BatchErrorData
    description: Error information for a failure in batch.
    type: object
    properties:
      code:
        description: An error code identifying the error type.
        type: string
      message:
        description: A human-readable message providing more details about the error.
        type: string
      param:
        description: The name of the parameter that caused the error, if applicable (can be null).
        type: string
      line:
        description: The line number of the input file where the error occurred, if applicable (can be null).
        type: string
  BatchErrors:
    title: BatchErrors
    description: For batches that have failed, this will contain more information on the cause of the failures.
    type: object
    properties:
      object:
        description: The type of the errors object. This is always 'list'.
        type: string
      data:
        $ref: "#/definitions/BatchErrorData"
  BatchRequestCounts:
    title: BatchRequestCounts
    description: The request counts for different statuses within the batch.
    type: object
    properties:
      total:
        description: The total number of requests in the batch.
        type: integer
      completed:
        description: The number of requests in the batch that have been completed successfully.
        type: integer
      failed:
        description: The number of requests in the batch that have failed.
        type: integer
  BatchStatus:
    title: BatchStatus
    description: The status of a batch.
    enum:
      - validating
      - failed
      - in_progress
      - finalizing
      - completed
      - expired
      - cancelling
      - cancelled
    type: string
    readOnly: true
    x-ms-enum:
      name: BatchStatus
      modelAsString: true
      values:
        - value: validating
          description: The input file is being validated before the batch can begin.
        - value: failed
          description: The input file has failed the validation process.
        - value: in_progress
          description: The input file was successfully validated and the batch is currently being executed.
        - value: finalizing
          description: The batch has completed and the results are being prepared.
        - value: completed
          description: The batch has been completed and the results are ready.
        - value: expired
          description: The batch was not able to complete within the 24-hour time window.
        - value: cancelling
          description: Cancellation of the batch has been initiated.
        - value: cancelled
          description: The batch was cancelled.
  BatchesList:
    title: BatchList
    description: Represents a list of batches.
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      data:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/Batch"
      first_id:
        description: The id of the first batch in the list of batches returned.
        type: string
      last_id:
        description: The id of the last batch in the list of batches returned.
        type: string
      has_more:
        description: A value indicating whether the list contains more elements than returned.
        type: boolean
  Capabilities:
    title: Capabilities
    description: The capabilities of a base or fine tune model.
    required:
      - chat_completion
      - completion
      - embeddings
      - fine_tune
      - inference
    type: object
    properties:
      fine_tune:
        description: A value indicating whether a model can be used for fine tuning.
        type: boolean
      inference:
        description: A value indicating whether a model can be deployed.
        type: boolean
      completion:
        description: A value indicating whether a model supports completion.
        type: boolean
      chat_completion:
        description: A value indicating whether a model supports chat completion.
        type: boolean
      embeddings:
        description: A value indicating whether a model supports embeddings.
        type: boolean
  ChunkingSettings:
    type: object
    title: ChunkingSettings
    description: Chunking settings
    properties:
      maxChunkSizeInTokens:
        type: integer
  CompletionAction:
    type: string
    description: The completion action.
    enum:
      - cleanUpTempAssets
      - keepAllAssets
    x-ms-enum:
      name: IngestionJobCompletionAction
      modelAsString: true
      values:
        - name: keepAllAssets
          value: keepAllAssets
          description: Will not clean up any of the intermediate assets created during the ingestion process.
        - name: cleanUpTempAssets
          value: cleanUpTempAssets
          description: Will clean up intermediate assets created during the ingestion process.
  ComputeType:
    type: string
    description: The compute type.
    enum:
      - ServerlessCompute
      - CustomCompute
    x-ms-enum:
      name: ComputeType
      modelAsString: true
      values:
        - name: ServerlessCompute
          value: ServerlessCompute
          description: Serverless user compute.
        - name: CustomCompute
          value: CustomCompute
          description: Custom user compute.
  ConnectionStringConnection:
    description: Connection string connection.
    required:
      - connectionString
    allOf:
      - $ref: "#/definitions/BaseConnection"
      - type: object
        properties:
          connectionString:
            type: string
            description: Connection string
    x-ms-discriminator-value: ConnectionString
  ConnectionType:
    type: string
    description: The connection type.
    enum:
      - EndpointWithKey
      - ConnectionString
      - EndpointWithManagedIdentity
      - WorkspaceConnection
      - RelativeConnection
    x-ms-enum:
      name: ConnectionType
      modelAsString: true
      values:
        - name: EndpointWithKey
          value: EndpointWithKey
          description: Endpoint and key connection.
        - name: ConnectionString
          value: ConnectionString
          description: Connection string.
        - name: EndpointWithManagedIdentity
          value: EndpointWithManagedIdentity
          description: Endpoint and managed identity.
        - name: WorkspaceConnection
          value: WorkspaceConnection
          description: AML Workspace connection.
        - name: RelativeConnection
          value: RelativeConnection
          description: Relative deployment
  CosmosDBIndex:
    description: CosmosDB Index.
    required:
      - connectionId
    allOf:
      - $ref: "#/definitions/TargetIndex"
      - type: object
        properties:
          connectionId:
            type: string
            description: The id of the connection pointing to the cosmos DB.
          collectionName:
            type: string
            description: The name of the cosmos DB collection.
          databaseName:
            type: string
            description: The name of the cosmos DB database.
    x-ms-discriminator-value: CosmosDB
  CrawlingSettings:
    type: object
    title: CrawlingSettings
    description: Crawling settings
    properties:
      maxCrawlDepth:
        type: integer
      maxCrawlTimeInMins:
        type: integer
      maxDownloadTimeInMins:
        type: integer
      maxFileSize:
        type: integer
      maxRedirects:
        type: integer
      maxFiles:
        type: integer
  CustomCompute:
    description: Custom compute.
    required:
      - computeId
    allOf:
      - $ref: "#/definitions/JobCompute"
      - type: object
        properties:
          computeId:
            type: string
            description: Id of the custom compute
    x-ms-discriminator-value: CustomCompute
  DeploymentConnection:
    description: Relative deployment connection.
    allOf:
      - $ref: "#/definitions/BaseConnection"
    x-ms-discriminator-value: RelativeConnection
  Deprecation:
    title: Deprecation
    description: "Defines the dates of deprecation for the different use cases of a model.\r\nUsually base models support 1 year of fine tuning after creation. Inference is typically supported 2 years after creation of base or\r\nfine tuned models. The exact dates are specified in the properties."
    required:
      - inference
    type: object
    properties:
      fine_tune:
        format: unixtime
        description: The end date of fine tune support of this model. Will be `null` for fine tune models.
        type: integer
      inference:
        format: unixtime
        description: The end date of inference support of this model.
        type: integer
  EndpointKeyConnection:
    description: Endpoint key connection.
    required:
      - endpoint
      - key
    allOf:
      - $ref: "#/definitions/BaseConnection"
      - type: object
        properties:
          endpoint:
            type: string
            description: Endpoint
          key:
            type: string
            description: Key
    x-ms-discriminator-value: EndpointWithKey
  EndpointMIConnection:
    description: Endpoint Managed Identity connection.
    required:
      - endpoint
    allOf:
      - $ref: "#/definitions/BaseConnection"
      - type: object
        properties:
          endpoint:
            type: string
            description: Endpoint
          resourceId:
            type: string
            description: Resource Id
    x-ms-discriminator-value: EndpointWithManagedIdentity
  Error:
    title: Error
    description: "Error content as defined in the Microsoft REST guidelines\r\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)."
    required:
      - code
      - message
    type: object
    properties:
      code:
        $ref: "#/definitions/ErrorCode"
      message:
        description: The message of this error.
        minLength: 1
        type: string
      target:
        description: The location where the error happened if available.
        type: string
      details:
        description: The error details if available.
        type: array
        items:
          $ref: "#/definitions/Error"
      innererror:
        $ref: "#/definitions/InnerError"
  ErrorCode:
    title: ErrorCode
    description: "Error codes as defined in the Microsoft REST guidelines\r\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)."
    enum:
      - conflict
      - invalidPayload
      - forbidden
      - notFound
      - unexpectedEntityState
      - itemDoesAlreadyExist
      - serviceUnavailable
      - internalFailure
      - quotaExceeded
      - jsonlValidationFailed
      - fileImportFailed
      - tooManyRequests
      - unauthorized
      - contentFilter
    type: string
    x-ms-enum:
      name: ErrorCode
      modelAsString: true
      values:
        - value: conflict
          description: The requested operation conflicts with the current resource state.
        - value: invalidPayload
          description: The request data is invalid for this operation.
        - value: forbidden
          description: The operation is forbidden for the current user/api key.
        - value: notFound
          description: The resource is not found.
        - value: unexpectedEntityState
          description: The operation cannot be executed in the current resource's state.
        - value: itemDoesAlreadyExist
          description: The item does already exist.
        - value: serviceUnavailable
          description: The service is currently not available.
        - value: internalFailure
          description: Internal error. Please retry.
        - value: quotaExceeded
          description: Quota exceeded.
        - value: jsonlValidationFailed
          description: Validation of jsonl data failed.
        - value: fileImportFailed
          description: Import of file failed.
        - value: tooManyRequests
          description: Too many requests. Please retry later.
        - value: unauthorized
          description: The current user/api key is not authorized for the operation.
        - value: contentFilter
          description: Image generation failed as a result of our safety system.
  ErrorResponse:
    title: ErrorResponse
    description: "Error response as defined in the Microsoft REST guidelines\r\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)."
    required:
      - error
    type: object
    properties:
      error:
        $ref: "#/definitions/Error"
  EventType:
    title: EventType
    description: Defines the severity of a content filter result.
    enum:
      - message
      - metrics
    type: string
    x-ms-enum:
      name: EventType
      modelAsString: true
      values:
        - value: message
          description: Event only contains human readable messages.
        - value: metrics
          description: Event contains metrics.
  File:
    title: File
    description: A file is a document usable for training and validation. It can also be a service generated document with result details.
    required:
      - filename
      - purpose
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      created_at:
        format: unixtime
        description: A timestamp when this job or item was created (in unix epochs).
        type: integer
        readOnly: true
      id:
        description: The identity of this item.
        type: string
        readOnly: true
      status:
        $ref: '#/definitions/FileState'
      bytes:
        format: int64
        description: "The size of this file when available (can be null). File sizes larger than 2^53-1 are not supported to ensure compatibility\r\nwith JavaScript integers."
        type: integer
        readOnly: true
      purpose:
        $ref: "#/definitions/Purpose"
      filename:
        description: The name of the file.
        minLength: 1
        type: string
      status_details:
        description: The error message with details in case processing of this file failed.
        type: string
        readOnly: true
    readOnly: true
  FileCreate:
    title: FileCreate
    description: Defines a document to import from an external content url to be usable with Azure OpenAI.
    required:
      - content_url
      - purpose
    type: object
    properties:
      purpose:
        $ref: "#/definitions/Purpose"
      content_url:
        format: url
        description: The url to download the document from (can be SAS url of a blob or any other external url accessible with a GET request).
        type: string
  FileDetails:
    title: FileDetails
    description: A file detail is a document used by batch service to fetch file blob details.
    required:
      - filename
      - purpose
    type: object
    properties:
      id:
        description: The identity of this item.
        type: string
        readOnly: true
      filename:
        description: The name of the file.
        minLength: 1
        type: string
      path:
        description: The  the relative path to the file within the container.
        type: string
        readOnly: true
      storage_account_uri:
        format: url
        description: The storage account url of this file.
        type: string
        readOnly: true
      storage_container_name:
        description: The Storage Container Name of this file blob.
        type: string
        readOnly: true
      purpose:
        $ref: "#/definitions/Purpose"
  FileDelete:
      title: FileDelete
      required:
        - deleted
        - id
        - object
      type: object
      properties:
        object:
          minLength: 1
          type: string
          description: The file object.
        deleted:
          type: boolean
          description: A value indicating whether the file was deleted.
        id:
          minLength: 1
          type: string
          description: The file-id that was deleted.
      description: Defines the response for File Delete.
  FileImport:
    title: FileImport
    description: Defines a document to import from an external content url to be usable with Azure OpenAI.
    required:
      - content_url
      - filename
      - purpose
    type: object
    properties:
      purpose:
        $ref: "#/definitions/Purpose"
      filename:
        description: "The name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded.\r\nIf the `purpose` is set to \"fine-tune\", each line is a JSON record with \"prompt\" and \"completion\" fields representing your training examples."
        minLength: 1
        type: string
      content_url:
        format: url
        description: The url to download the document from (can be SAS url of a blob or any other external url accessible with a GET request).
        type: string
  FileList:
    title: FileList
    description: Represents a list of files.
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      data:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/File"
  FileState:
    title: FileState
    description: The state of a file.
    enum:
      - uploaded
      - pending
      - running
      - processed
      - error
      - deleting
      - deleted
    type: string
    readOnly: true
    x-ms-enum:
      name: FileState
      modelAsString: true
      values:
        - value: uploaded
          description: >-
            The file has been uploaded but it's not yet processed. This state is
            not returned by Azure OpenAI and exposed only for compatibility. It
            can be categorized as an inactive state.
        - value: pending
          description: >-
            The operation was created and is not queued to be processed in the
            future. It can be categorized as an inactive state.
        - value: running
          description: >-
            The operation has started to be processed. It can be categorized as
            an active state.
        - value: processed
          description: >-
            The operation has successfully be processed and is ready for
            consumption. It can be categorized as a terminal state.
        - value: error
          description: >-
            The operation has completed processing with a failure and cannot be
            further consumed. It can be categorized as a terminal state.
        - value: deleting
          description: >-
            The entity is ni the process to be deleted. This state is not
            returned by Azure OpenAI and exposed only for compatibility. It can
            be categorized as an active state.
        - value: deleted
          description: >-
            The entity has been deleted but may still be referenced by other
            entities predating the deletion. It can be categorized as a terminal
            state.
  FineTuningHyperParameters:
    title: FineTuningHyperParameters
    description: The hyper parameter settings used in a fine tune job.
    type: object
    properties:
      n_epochs:
        format: int32
        description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
        type: integer
      batch_size:
        format: int32
        description: "The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass.\r\nIn general, we've found that larger batch sizes tend to work better for larger datasets.\r\nThe default value as well as the maximum value for this property are specific to a base model."
        type: integer
      learning_rate_multiplier:
        format: double
        description: "The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pre-training multiplied by this value.\r\nLarger learning rates tend to perform better with larger batch sizes.\r\nWe recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results."
        type: number
  FineTuningJob:
    title: FineTuningJob
    description: Defines the values of a fine tune job.
    required:
      - model
      - training_file
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      created_at:
        format: unixtime
        description: A timestamp when this job or item was created (in unix epochs).
        type: integer
        readOnly: true
      id:
        description: The identity of this item.
        type: string
        readOnly: true
      status:
        $ref: "#/definitions/FineTuningState"
      model:
        description: The identifier (model-id) of the base model used for the fine-tune.
        minLength: 1
        type: string
      fine_tuned_model:
        description: "The identifier (model-id) of the resulting fine tuned model. This property is only populated for successfully completed fine-tune runs.\r\nUse this identifier to create a deployment for inferencing."
        type: string
      training_file:
        description: The file which is used for training.
        minLength: 1
        type: string
      validation_file:
        description: The file which is used to evaluate the fine tuned model during training.
        type: string
      result_files:
        description: "The result file identities (file-id) containing training and evaluation metrics in csv format.\r\nThe file is only available for successfully completed fine-tune runs."
        type: array
        items:
          type: string
      finished_at:
        format: int32
        description: A timestamp when this job or item has finished successfully (in unix epochs).
        type: integer
      organisation_id:
        description: The organisation id of this fine tune job. Unused on Azure OpenAI; compatibility for OpenAI only.
        type: string
      trained_tokens:
        format: int32
        description: The total number of billable tokens processed by this fine tuning job.
        type: integer
        readOnly: true
      error:
        $ref: "#/definitions/FineTuningJobError"
      estimated_finish:
        format: int32
        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.
        type: integer
      hyperparameters:
        $ref: "#/definitions/FineTuningHyperParameters"
      suffix:
        description: The suffix used to identify the fine-tuned model. The suffix can contain up to 40 characters (a-z, A-Z, 0-9,- and _) that will be added to your fine-tuned model name.
        type: string
      seed:
        format: int32
        description: The seed used for the finetuning job.
        type: integer
      integrations:
        type: array
        items:
          $ref: "#/definitions/WandBIntegrationRequestWrapper"
          description: "A list configurations for integrations supporting the fine-tuning job.\r\nThere are many integrations planned, so make sure to check and act on the integration type."
  FineTuningJobCheckpoint:
    title: FineTuningJobCheckpoint
    required:
      - created_at
      - fine_tuned_model_checkpoint
      - fine_tuning_job_id
      - metrics
      - step_number
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      id:
        description: The identity of this checkpoint.
        type: string
        readOnly: true
      created_at:
        format: unixtime
        description: The Unix timestamp (in seconds) for when the checkpoint was created.
        type: integer
      fine_tuned_model_checkpoint:
        description: The name of the fine-tuned checkpoint model that is created.
        minLength: 1
        type: string
      step_number:
        format: int32
        description: The step number that the checkpoint was created at.
        type: integer
      metrics:
        title: Dictionary`2
        description: The metrics at the step number during the fine-tuning job.
        type: object
        additionalProperties:
          format: double
          type: number
      fine_tuning_job_id:
        description: The name of the fine-tuning job that this checkpoint was created from..
        minLength: 1
        type: string
  FineTuningJobCheckpointList:
    title: FineTuningJobCheckpointList
    description: Represents a list of checkpoints.
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      data:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/FineTuningJobCheckpoint"
      has_more:
        description: A value indicating whether the list contains more elements than returned.
        type: boolean
  FineTuningJobCreation:
    title: FineTuningJobCreation
    description: Defines the values of a fine tune job.
    required:
      - model
      - training_file
    type: object
    properties:
      model:
        description: The identifier (model-id) of the base model used for this fine-tune.
        minLength: 1
        type: string
      training_file:
        description: The file identity (file-id) that is used for training this fine tuned model.
        minLength: 1
        type: string
      validation_file:
        description: The file identity (file-id) that is used to evaluate the fine tuned model during training.
        type: string
      hyperparameters:
        $ref: "#/definitions/FineTuningHyperParameters"
      suffix:
        description: The suffix used to identify the fine-tuned model. The suffix can contain up to 40 characters (a-z, A-Z, 0-9,- and _) that will be added to your fine-tuned model name.
        type: string
      seed:
        format: int32
        description: The seed used for the finetuning 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.
        type: integer
      integrations:
        type: array
        items:
          $ref: "#/definitions/WandBIntegrationRequestWrapper"
          description: "A list configurations for integrations supporting the fine-tuning job.\r\nThere are many integrations planned, so make sure to check and act on the integration type."
  FineTuningJobError:
    title: FineTuningJobError
    description: For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.
    type: object
    properties:
      code:
        description: The machine-readable error code..
        type: string
      message:
        description: The human-readable error message.
        type: string
      param:
        description: The parameter that was invalid, usually training_file or validation_file. This field will be null if the failure was not parameter-specific.
        type: string
  FineTuningJobEvent:
    title: FineTuningJobEvent
    required:
      - created_at
      - level
      - message
      - type
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      id:
        description: The identity of this event.
        type: string
        readOnly: true
      created_at:
        format: unixtime
        description: A timestamp when this event was created (in unix epochs).
        type: integer
      level:
        $ref: "#/definitions/LogLevel"
      message:
        description: The message describing the event. This can be a change of state, e.g., enqueued, started, failed or completed, or other events like uploaded results.
        minLength: 1
        type: string
      type:
        $ref: "#/definitions/EventType"
      data:
        description: Machine readable data of this event.
  FineTuningJobEventList:
    title: FineTuningJobEventList
    description: Represents a list of events.
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      data:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/FineTuningJobEvent"
      has_more:
        description: A value indicating whether the list contains more elements than returned.
        type: boolean
  FineTuningJobList:
    title: FineTuningJobList
    description: Represents a list of fine tunes.
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      data:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/FineTuningJob"
      has_more:
        description: A value indicating whether the list contains more elements than returned.
        type: boolean
  FineTuningState:
    title: FineTuningState
    description: The state of a finetunes object or fine tuning job.
    enum:
      - created
      - pending
      - running
      - succeeded
      - cancelled
      - failed
    type: string
    readOnly: true
    x-ms-enum:
      name: FineTuningState
      modelAsString: true
      values:
        - value: created
          description: The operation was created. This state is not returned by Azure OpenAI and exposed only for compatibility. It can be categorized as an inactive state.
        - value: pending
          description: The operation is not yet queued to be processed in the future. It can be categorized as an inactive state.
        - value: running
          description: The operation has started to be processed. It can be categorized as an active state.
        - value: succeeded
          description: The operation has successfully be processed and is ready for consumption. It can be categorized as a terminal state.
        - value: cancelled
          description: The operation has been cancelled and is incomplete. It can be categorized as a terminal state.
        - value: failed
          description: The operation has completed processing with a failure and cannot be further consumed. It can be categorized as a terminal state.
  GenericEmbeddingSettings:
    title: ConnectionEmbeddingSettings
    description: Connection Embedding Settings
    type: object
    properties:
      connection:
        $ref: "#/definitions/BaseConnection"
      deploymentName:
        type: string
      modelName:
        type: string
  IngestionError:
    title: IngestionError
    description: The details of the ingestion error
    type: object
    properties:
      message:
        type: string
      innerErrors:
        type: array
        items:
          type: string
  IngestionJob:
    title: IngestionJob
    description: Represents the details of a job.
    type: object
    required:
      - kind
    discriminator: kind
    properties:
      kind:
        $ref: "#/definitions/IngestionJobType"
      jobId:
        type: string
  IngestionJobList:
    title: IngestionJobList
    description: Represents a list of ingestion jobs.
    type: object
    properties:
      nextLink:
        description: The link to the next page.
        type: string
      value:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/IngestionJob"
  IngestionJobProgress:
    title: IngestionJobProgress
    type: object
    required:
      - stageProgress
    properties:
      stageProgress:
        type: array
        items:
          $ref: "#/definitions/IngestionJobStageProgress"
  IngestionJobRun:
    title: IngestionJobRun
    description: The details of a job run
    type: object
    properties:
      jobId:
        type: string
      runId:
        type: string
      status:
        $ref: "#/definitions/OperationState"
      error:
        $ref: "#/definitions/IngestionError"
      warnings:
        type: array
        items:
          type: string
      progress:
        $ref: "#/definitions/IngestionJobProgress"
  IngestionJobRunList:
    title: IngestionJobRunList
    description: Represents a list of ingestion job runs.
    type: object
    properties:
      nextLink:
        description: The link to the next page.
        type: string
      value:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/IngestionJobRun"
  IngestionJobStageProgress:
    title: IngestionJobStageProgress
    type: object
    properties:
      name:
        type: string
      totalItems:
        type: integer
        format: int32
      processedItems:
        type: integer
        format: int32
      state:
        $ref: "#/definitions/OperationState"
      subStageProgress:
        type: array
        items:
          $ref: "#/definitions/IngestionJobStageProgress"
  IngestionJobSystemCompute:
    type: object
    allOf:
      - $ref: "#/definitions/IngestionJob"
      - type: object
        properties:
          searchServiceConnection:
            $ref: "#/definitions/BaseConnection"
          datasource:
            $ref: "#/definitions/SystemComputeDatasource"
          completionAction:
            $ref: "#/definitions/CompletionAction"
          dataRefreshIntervalInHours:
            type: integer
    x-ms-discriminator-value: SystemCompute
  IngestionJobType:
    title: IngestionJobType
    type: string
    description: The job type.
    enum:
      - SystemCompute
      - UserCompute
    x-ms-enum:
      name: IngestionJobType
      modelAsString: true
      values:
        - name: SystemCompute
          value: SystemCompute
          description: Jobs that run on service owned resources.
        - name: UserCompute
          value: UserCompute
          description: Jobs that run on user owned workspace.
  IngestionJobUserCompute:
    type: object
    required:
      - workspaceId
    allOf:
      - $ref: "#/definitions/IngestionJob"
      - type: object
        properties:
          workspaceId:
            type: string
          compute:
            $ref: "#/definitions/JobCompute"
          target:
            $ref: "#/definitions/TargetIndex"
          datasource:
            $ref: "#/definitions/UserComputeDatasource"
          dataRefreshIntervalInHours:
            type: integer
    x-ms-discriminator-value: UserCompute
  InnerError:
    title: InnerError
    description: "Inner error as defined in the Microsoft REST guidelines\r\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)."
    type: object
    properties:
      code:
        $ref: "#/definitions/InnerErrorCode"
      innererror:
        $ref: "#/definitions/InnerError"
  InnerErrorCode:
    title: InnerErrorCode
    description: "Inner error codes as defined in the Microsoft REST guidelines\r\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)."
    enum:
      - invalidPayload
    type: string
    x-ms-enum:
      name: InnerErrorCode
      modelAsString: true
      values:
        - value: invalidPayload
          description: The request data is invalid for this operation.
  IntegrationTypes:
    title: IntegrationTypes
    enum:
      - wandb
    type: string
    description: List of Fine Tune integrations available.
  JobCompute:
    title: JobCompute
    description: The compute settings of the job.
    type: object
    discriminator: kind
    required:
      - kind
    properties:
      kind:
        $ref: "#/definitions/ComputeType"
  LifeCycleStatus:
    title: LifeCycleStatus
    description: "The life cycle status of a model.\r\nNote: A model can be promoted from \"preview\" to \"generally-available\", but never from \"generally-available\" to \"preview\"."
    enum:
      - preview
      - generally-available
    type: string
    x-ms-enum:
      name: LifeCycleStatus
      modelAsString: true
      values:
        - value: preview
          description: Model is in preview and covered by the service preview terms.
        - value: generally-available
          description: Model is generally available.
  LogLevel:
    title: LogLevel
    description: The verbosity level of an event.
    enum:
      - info
      - warning
      - error
    type: string
    x-ms-enum:
      name: LogLevel
      modelAsString: true
      values:
        - value: info
          description: This event is for information only.
        - value: warning
          description: This event represents a mitigated issue.
        - value: error
          description: This message represents a non recoverable issue.
  Model:
    title: Model
    description: A model is either a base model or the result of a successful fine tune job.
    required:
      - capabilities
      - deprecation
      - lifecycle_status
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      created_at:
        format: unixtime
        description: A timestamp when this job or item was created (in unix epochs).
        type: integer
        readOnly: true
      id:
        description: The identity of this item.
        type: string
        readOnly: true
      status:
        $ref: "#/definitions/FineTuningState"
      model:
        description: The base model identity (model-id) if this is a fine tune model; otherwise `null`.
        type: string
      fine_tune:
        description: The fine tune job identity (fine-tune-id) if this is a fine tune model; otherwise `null`.
        type: string
      capabilities:
        $ref: "#/definitions/Capabilities"
      lifecycle_status:
        $ref: "#/definitions/LifeCycleStatus"
      deprecation:
        $ref: "#/definitions/Deprecation"
  ModelList:
    title: ModelList
    description: Represents a list of models.
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      data:
        description: The list of items.
        type: array
        items:
          $ref: "#/definitions/Model"
  OperationState:
    title: OperationState
    description: The state of a job or item.
    enum:
      - notRunning
      - running
      - succeeded
      - failed
    type: string
    readOnly: true
    x-ms-enum:
      name: OperationState
      modelAsString: true
      values:
        - value: notRunning
          description: The operation is not yet queued to be processed in the future.
        - value: running
          description: The operation has started to be processed.
        - value: succeeded
          description: The operation has successfully be processed and is ready for consumption.
        - value: failed
          description: The operation has completed processing with a failure and cannot be further consumed.
  PineconeIndex:
    description: Pinecone Index.
    required:
      - connectionId
    allOf:
      - $ref: "#/definitions/TargetIndex"
      - type: object
        properties:
          connectionId:
            type: string
            description: The id of the connection pointing to the pinecone.
    x-ms-discriminator-value: Pinecone
  Purpose:
    title: Purpose
    description: The intended purpose of the uploaded documents. Use "fine-tune" for fine-tuning. This allows us to validate the format of the uploaded file.
    enum:
      - fine-tune
      - fine-tune-results
      - assistants
      - assistants_output
      - batch
      - batch_output
    type: string
    readOnly: true
    x-ms-enum:
      name: Purpose
      modelAsString: true
      values:
        - value: fine-tune
          description: This file contains training data for a fine tune job.
        - value: fine-tune-results
          description: This file contains the results of a fine tune job.
        - value: assistants
          description: This file contains data to be used in assistants.
        - value: assistants_output
          description: This file contains the results of an assistant.
        - value: batch
          description: This file contains the input data for a batch.
        - value: batch_output
          description: This file contains the results of a batch.
  ServerlessCompute:
    description: Serverless compute.
    allOf:
      - $ref: "#/definitions/JobCompute"
      - type: object
        properties:
          sku:
            type: string
            description: SKU Level
          instanceCount:
            type: integer
            description: The count of instances to run the job on.
    x-ms-discriminator-value: ServerlessCompute
  SystemComputeDatasource:
    title: SystemComputeDatasource
    type: object
    required:
      - kind
    properties:
      kind:
        $ref: "#/definitions/SystemComputeDatasourceType"
    discriminator: kind
  SystemComputeDatasourceType:
    type: string
    description: The datasource type.
    enum:
      - Storage
      - Urls
    x-ms-enum:
      name: SystemComputeDatasourceType
      modelAsString: true
      values:
        - name: Storage
          value: Storage
          description: Azure Storage Account.
        - name: Urls
          value: Urls
          description: URLs.
  SystemComputeStorage:
    title: SystemComputeStorage
    description: Storage account
    required:
      - connection
      - containerName
      - embeddings
    x-ms-discriminator-value: Storage
    allOf:
      - $ref: "#/definitions/SystemComputeDatasource"
      - type: object
        properties:
          connection:
            $ref: "#/definitions/BaseConnection"
          containerName:
            type: string
            description: container name
          chunking:
            $ref: "#/definitions/ChunkingSettings"
          embeddings:
            type: array
            items:
              $ref: "#/definitions/GenericEmbeddingSettings"
  SystemComputeUrl:
    title: SystemComputeUrl
    description: Urls
    required:
      - urls
      - connection
      - containerName
      - embeddings
    x-ms-discriminator-value: Urls
    allOf:
      - $ref: "#/definitions/SystemComputeDatasource"
      - type: object
        properties:
          urls:
            type: array
            items:
              type: string
          connection:
            $ref: "#/definitions/BaseConnection"
          containerName:
            type: string
            description: container name
          crawling:
            $ref: "#/definitions/CrawlingSettings"
          chunking:
            $ref: "#/definitions/ChunkingSettings"
          embeddings:
            type: array
            items:
              $ref: "#/definitions/GenericEmbeddingSettings"
  TargetIndex:
    title: TargetIndex
    description: Information about the index to be created.
    type: object
    discriminator: kind
    required:
      - kind
    properties:
      kind:
        $ref: "#/definitions/TargetType"
  TargetType:
    type: string
    description: The target type.
    enum:
      - AzureAISearch
      - CosmosDB
      - Pinecone
    x-ms-enum:
      name: TargetType
      modelAsString: true
      values:
        - name: AzureAISearch
          value: AzureAISearch
          description: Azure AI Search Index.
        - name: CosmosDB
          value: CosmosDB
          description: CosmosDB Index.
        - name: Pinecone
          value: Pinecone
          description: Pinecone Index.
  TypeDiscriminator:
    title: TypeDiscriminator
    description: Defines the type of an object.
    enum:
      - list
      - fine_tuning.job
      - file
      - fine_tuning.job.event
      - fine_tuning.job.checkpoint
      - model
      - upload
      - upload.part
      - batch
    type: string
    readOnly: true
    x-ms-enum:
      name: TypeDiscriminator
      modelAsString: true
      values:
        - value: list
          description: This object represents a list of other objects.
        - value: fine_tuning.job
          description: This object represents a fine tune job.
        - value: file
          description: This object represents a file.
        - value: fine_tuning.job.event
          description: This object represents an event of a fine tuning job.
        - value: fine_tuning.job.checkpoint
          description: This object represents a checkpoint of a fine tuning job.
        - value: model
          description: This object represents a model (can be a base model or fine tune job result).
        - value: upload
          description: This object represents a file upload.
        - value: upload.part
          description: This object represents part of a file upload.
        - value: batch
          description: This object represents a batch.
  UploadFileCompleteBody:
    title: UploadFileCompleteBody
    required:
      - part_ids
    type: object
    properties:
      part_ids:
        title: IList`1
        type: array
        items:
          type: string
      md5:
        type: string
  UploadFileStartBody:
    title: UploadFileStartBody
    required:
      - bytes
      - filename
      - mime_type
      - purpose
    type: object
    properties:
      purpose:
        $ref: "#/definitions/Purpose"
      filename:
        minLength: 1
        type: string
      bytes:
        format: int64
        type: integer
      mime_type:
        minLength: 1
        type: string
  UploadPartResource:
    title: UploadPartResource
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      created_at:
        format: unixtime
        description: A timestamp when this job or item was created (in unix epochs).
        type: integer
        readOnly: true
      id:
        description: The identity of this item.
        type: string
        readOnly: true
      upload_id:
        type: string
        readOnly: true
      azure_block_id:
        type: string
        readOnly: true
  UploadResource:
    title: UploadResource
    type: object
    properties:
      object:
        $ref: "#/definitions/TypeDiscriminator"
      created_at:
        format: unixtime
        description: A timestamp when this job or item was created (in unix epochs).
        type: integer
        readOnly: true
      id:
        description: The identity of this item.
        type: string
        readOnly: true
      bytes:
        format: int64
        type: integer
        readOnly: true
      filename:
        type: string
        readOnly: true
      purpose:
        $ref: "#/definitions/Purpose"
      status:
        $ref: "#/definitions/UploadStatus"
      expires_at:
        format: unixtime
        type: integer
        readOnly: true
      file:
        $ref: "#/definitions/File"
  UploadStatus:
    title: UploadStatus
    enum:
      - pending
      - expired
      - completed
      - cancelled
    type: string
    readOnly: true
  UserComputeDataset:
    type: object
    title: UserComputeStorage
    description: Storage account
    required:
      - datasetId
      - datasetType
    x-ms-discriminator-value: Dataset
    allOf:
      - $ref: "#/definitions/UserComputeDatasource"
      - type: object
        properties:
          datasetId:
            type: string
          datasetType:
            type: string
          chunking:
            $ref: "#/definitions/ChunkingSettings"
          embeddings:
            type: array
            items:
              $ref: "#/definitions/WorkspaceConnectionEmbeddingSettings"
  UserComputeDatasource:
    title: UserComputeDatasource
    type: object
    discriminator: kind
    required:
      - kind
    properties:
      kind:
        $ref: "#/definitions/UserComputeDatasourceType"
  UserComputeDatasourceType:
    type: string
    description: The datasource type.
    enum:
      - Dataset
      - Urls
    x-ms-enum:
      name: UserComputeDatasourceType
      modelAsString: true
      values:
        - name: Dataset
          value: Dataset
          description: Workspace Dataset.
        - name: Urls
          value: Urls
          description: URLs.
  UserComputeUrl:
    type: object
    title: UserComputeUrl
    description: Urls
    required:
      - urls
      - embeddings
    x-ms-discriminator-value: Urls
    allOf:
      - $ref: "#/definitions/UserComputeDatasource"
      - type: object
        properties:
          urls:
            type: array
            items:
              type: string
          crawling:
            $ref: "#/definitions/CrawlingSettings"
          chunking:
            $ref: "#/definitions/ChunkingSettings"
          embeddings:
            type: array
            items:
              $ref: "#/definitions/WorkspaceConnectionEmbeddingSettings"
  WandBIntegrationRequest:
    title: WandBIntegrationRequest
    required:
      - project
    type: object
    properties:
      project:
        minLength: 1
        type: string
      name:
        type: string
        readOnly: true
      entity:
        type: string
        readOnly: true
      tags:
        type: array
        items:
          type: string
        readOnly: true
  WandBIntegrationRequestWrapper:
    title: WandBIntegrationRequestWrapper
    required:
      - type
      - wandb
    type: object
    properties:
      type:
        $ref: '#/definitions/IntegrationTypes'
      wandb:
        $ref: "#/definitions/WandBIntegrationRequest"
  WorkspaceConnection:
    description: AML Workspace connection.
    required:
      - connectionId
    allOf:
      - $ref: "#/definitions/BaseConnection"
      - type: object
        properties:
          connectionId:
            type: string
            description: ConnectionId
    x-ms-discriminator-value: WorkspaceConnection
  WorkspaceConnectionEmbeddingSettings:
    title: WorkspaceConnectionEmbeddingSettings
    description: Connection id to the embedding model
    type: object
    properties:
      connectionId:
        type: string
      deploymentName:
        type: string
      modelName:
        type: string
parameters:
  endpoint:
    in: path
    name: endpoint
    description: 'Supported Cognitive Services endpoints (protocol and hostname, for example: https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI account name).'
    required: true
    type: string
    format: url
    x-ms-skip-url-encoding: true
    x-ms-parameter-location: client
  apiVersionQueryParameter:
    in: query
    name: api-version
    description: The requested API version.
    required: true
    type: string
    x-ms-client-default: 2024-12-01-preview
    x-ms-parameter-location: client
security:
  - ApiKeyAuth: []
  - OAuth2Auth:
      - https://cognitiveservices.azure.com/.default
securityDefinitions:
  ApiKeyAuth:
    description: API key authentication
    type: apiKey
    name: api-key
    in: header
  OAuth2Auth:
    description: OAuth2 authentication
    type: oauth2
    flow: implicit
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
    scopes:
      https://cognitiveservices.azure.com/.default: ""
schemes:
  - https
x-ms-parameterized-host:
  hostTemplate: "{endpoint}/openai"
  useSchemePrefix: false
  parameters:
    - $ref: "#/parameters/endpoint"
