specification/cognitiveservices/data-plane/AzureOpenAI/authoring/preview/2024-03-01-preview/azureopenai.yaml [6:1056]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
paths:
  /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
          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.          
        - $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.json
    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
          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 that can be attached to an assistant.
        - 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.json
  /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.json
    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:
        '204':
          description: The file was successfully deleted.
        default:
          description: An error occurred.
          schema:
            $ref: '#/definitions/ErrorResponse'
      x-ms-examples:
        Deleting a file.:
          $ref: ./examples/delete_file.json
  /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.json
  /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.json
  /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 tune jobs owned by this account.:
          $ref: ./examples/get_finetuning_jobs.json
    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 by 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 tune job.:
          $ref: ./examples/post_finetuning_job.json
  /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 tune job.:
          $ref: ./examples/get_finetuning_job.json
    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 tune job.:
          $ref: ./examples/delete_finetuning_job.json
  /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 tune job.:
          $ref: ./examples/get_finetuning_job_events.json
  /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 tune job.:
          $ref: ./examples/cancel_finetuning_job.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.json
  /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.json
        Getting a fine-tuned model.:
          $ref: ./examples/get_model_finetune.json  
definitions:
  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
  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
  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
  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
        readOnly: true
      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
      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
  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
  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 of events 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 of events 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.
  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.
  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.
  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
    type: string
    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.          
  TypeDiscriminator:
    title: TypeDiscriminator
    description: Defines the type of an object.
    enum:
      - list
      - fine_tuning.job
      - file
      - fine_tuning.job.event
      - model
    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: model
          description: This object represents a model (can be a base model or fine tune job result).
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



specification/cognitiveservices/data-plane/AzureOpenAI/authoring/preview/2024-04-01-preview/azureopenai.yaml [6:1056]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
paths:
  /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
          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.          
        - $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.json
    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
          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 that can be attached to an assistant.
        - 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.json
  /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.json
    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:
        '204':
          description: The file was successfully deleted.
        default:
          description: An error occurred.
          schema:
            $ref: '#/definitions/ErrorResponse'
      x-ms-examples:
        Deleting a file.:
          $ref: ./examples/delete_file.json
  /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.json
  /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.json
  /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 tune jobs owned by this account.:
          $ref: ./examples/get_finetuning_jobs.json
    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 by 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 tune job.:
          $ref: ./examples/post_finetuning_job.json
  /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 tune job.:
          $ref: ./examples/get_finetuning_job.json
    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 tune job.:
          $ref: ./examples/delete_finetuning_job.json
  /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 tune job.:
          $ref: ./examples/get_finetuning_job_events.json
  /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 tune job.:
          $ref: ./examples/cancel_finetuning_job.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.json
  /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.json
        Getting a fine-tuned model.:
          $ref: ./examples/get_model_finetune.json  
definitions:
  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
  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
  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
  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
        readOnly: true
      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
      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
  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
  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 of events 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 of events 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.
  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.
  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.
  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
    type: string
    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.          
  TypeDiscriminator:
    title: TypeDiscriminator
    description: Defines the type of an object.
    enum:
      - list
      - fine_tuning.job
      - file
      - fine_tuning.job.event
      - model
    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: model
          description: This object represents a model (can be a base model or fine tune job result).
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



