Microsoft Azure Open Ai

Microsoft Azure Open AI is a platform that provides access to cutting-edge artificial intelligence technologies for developers and businesses. It offers a wide range of AI services, including natural language processing, computer vision, and machine learning, to help organizations leverage the power of AI in their applications and workflows.

OpenAPI Specification

azure-openai-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  title: Microsoft Azure Azure OpenAI
  version: 2023-11-06-beta
  description: Azure OpenAI APIs for Assistants.
  x-typespec-generated:
    - emitter: '@azure-tools/typespec-autorest'
schemes:
  - https
x-ms-parameterized-host:
  hostTemplate: '{endpoint}'
  useSchemePrefix: false
  parameters:
    - name: endpoint
      in: path
      description: An OpenAI endpoint supporting assistants functionality.
      required: true
      type: string
produces:
  - application/json
consumes:
  - application/json
security:
  - ApiKeyAuth: []
  - OAuth2Auth:
      - https://cognitiveservices.azure.com/.default
securityDefinitions:
  ApiKeyAuth:
    type: apiKey
    name: api-key
    in: header
  OAuth2Auth:
    type: oauth2
    flow: implicit
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
    scopes:
      https://cognitiveservices.azure.com/.default: ''
tags:
  - name: Assistants
  - name: Files
  - name: Threads
paths:
  /assistants:
    get:
      operationId: microsoftAzureListassistants
      description: Gets a list of assistants that were previously created.
      parameters:
        - name: limit
          in: query
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 20.
          required: false
          type: integer
          format: int32
          default: 20
        - name: order
          in: query
          description: >-
            Sort order by the created_at timestamp of the objects. asc for
            ascending order and desc for descending order.
          required: false
          type: string
          default: desc
          enum:
            - asc
            - desc
          x-ms-enum:
            name: ListSortOrder
            modelAsString: true
            values:
              - name: ascending
                value: asc
                description: Specifies an ascending sort order.
              - name: descending
                value: desc
                description: Specifies a descending sort order.
        - name: after
          in: query
          description: >-
            A cursor for use in pagination. after is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include after=obj_foo in order to fetch the next page of the list.
          required: false
          type: string
        - name: before
          in: query
          description: >-
            A cursor for use in pagination. before is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include before=obj_foo in order to fetch the previous page of the
            list.
          required: false
          type: string
      responses:
        '200':
          description: The requested list of assistants.
          schema:
            type: object
            description: The response data for a requested list of items.
            properties:
              object:
                type: string
                description: The object type, which is always list.
                enum:
                  - list
                x-ms-enum:
                  modelAsString: false
              data:
                type: array
                description: The requested list of items.
                items:
                  $ref: '#/definitions/Assistant'
              first_id:
                type: string
                description: The first ID represented in this list.
                x-ms-client-name: firstId
              last_id:
                type: string
                description: The last ID represented in this list.
                x-ms-client-name: lastId
              has_more:
                type: boolean
                description: >-
                  A value indicating whether there are additional values
                  available not captured in this list.
                x-ms-client-name: hasMore
            required:
              - object
              - data
              - first_id
              - last_id
              - has_more
      summary: Microsoft Azure Get Assistants
      tags:
        - Assistants
    post:
      operationId: microsoftAzureCreateassistant
      description: Creates a new assistant.
      parameters:
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/AssistantCreationOptions'
      responses:
        '200':
          description: The new assistant instance.
          schema:
            $ref: '#/definitions/Assistant'
      summary: Microsoft Azure Post Assistants
      tags:
        - Assistants
  /assistants/{assistantId}:
    get:
      operationId: microsoftAzureGetassistant
      description: Retrieves an existing assistant.
      parameters:
        - name: assistantId
          in: path
          description: The ID of the assistant to retrieve.
          required: true
          type: string
      responses:
        '200':
          description: The requested assistant instance.
          schema:
            $ref: '#/definitions/Assistant'
      summary: Microsoft Azure Get Assistants Assistantid
      tags:
        - Assistants
    post:
      operationId: microsoftAzureModifyassistant
      description: Modifies an existing assistant.
      parameters:
        - name: assistantId
          in: path
          description: The ID of the assistant to modify.
          required: true
          type: string
        - name: modificationOptions
          in: body
          description: >-
            The details of the modification to perform on the specified
            assistant.
          required: true
          schema:
            $ref: '#/definitions/AssistantModificationOptions'
      responses:
        '200':
          description: The updated assistant instance.
          schema:
            $ref: '#/definitions/Assistant'
      summary: Microsoft Azure Post Assistants Assistantid
      tags:
        - Assistants
    delete:
      operationId: microsoftAzureDeleteassistant
      description: Deletes an assistant.
      parameters:
        - name: assistantId
          in: path
          description: The ID of the assistant to delete.
          required: true
          type: string
      responses:
        '200':
          description: Status information about the requested deletion operation.
          schema:
            $ref: '#/definitions/AssistantDeletionStatus'
      summary: Microsoft Azure Delete Assistants Assistantid
      tags:
        - Assistants
  /assistants/{assistantId}/files:
    get:
      operationId: microsoftAzureListassistantfiles
      description: >-
        Gets a list of files attached to a specific assistant, as used by tools
        that can read files.
      parameters:
        - name: assistantId
          in: path
          description: The ID of the assistant to retrieve the list of attached files for.
          required: true
          type: string
        - name: limit
          in: query
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 20.
          required: false
          type: integer
          format: int32
          default: 20
        - name: order
          in: query
          description: >-
            Sort order by the created_at timestamp of the objects. asc for
            ascending order and desc for descending order.
          required: false
          type: string
          default: desc
          enum:
            - asc
            - desc
          x-ms-enum:
            name: ListSortOrder
            modelAsString: true
            values:
              - name: ascending
                value: asc
                description: Specifies an ascending sort order.
              - name: descending
                value: desc
                description: Specifies a descending sort order.
        - name: after
          in: query
          description: >-
            A cursor for use in pagination. after is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include after=obj_foo in order to fetch the next page of the list.
          required: false
          type: string
        - name: before
          in: query
          description: >-
            A cursor for use in pagination. before is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include before=obj_foo in order to fetch the previous page of the
            list.
          required: false
          type: string
      responses:
        '200':
          description: The requested list of files attached to the specified assistant.
          schema:
            type: object
            description: The response data for a requested list of items.
            properties:
              object:
                type: string
                description: The object type, which is always list.
                enum:
                  - list
                x-ms-enum:
                  modelAsString: false
              data:
                type: array
                description: The requested list of items.
                items:
                  $ref: '#/definitions/AssistantFile'
              first_id:
                type: string
                description: The first ID represented in this list.
                x-ms-client-name: firstId
              last_id:
                type: string
                description: The last ID represented in this list.
                x-ms-client-name: lastId
              has_more:
                type: boolean
                description: >-
                  A value indicating whether there are additional values
                  available not captured in this list.
                x-ms-client-name: hasMore
            required:
              - object
              - data
              - first_id
              - last_id
              - has_more
      summary: Microsoft Azure Get Assistants Assistantid Files
      tags:
        - Assistants
    post:
      operationId: microsoftAzureCreateassistantfile
      description: >-
        Attaches a previously uploaded file to an assistant for use by tools
        that can read files.
      parameters:
        - name: assistantId
          in: path
          description: The ID of the assistant to attach the file to.
          required: true
          type: string
        - name: body
          in: body
          required: true
          schema:
            type: object
            properties:
              file_id:
                type: string
                description: The ID of the previously uploaded file to attach.
                x-ms-client-name: fileId
            required:
              - file_id
      responses:
        '200':
          description: Information about the attached file.
          schema:
            $ref: '#/definitions/AssistantFile'
      summary: Microsoft Azure Post Assistants Assistantid Files
      tags:
        - Assistants
  /assistants/{assistantId}/files/{fileId}:
    get:
      operationId: microsoftAzureGetassistantfile
      description: Retrieves a file attached to an assistant.
      parameters:
        - name: assistantId
          in: path
          description: The ID of the assistant associated with the attached file.
          required: true
          type: string
        - name: fileId
          in: path
          description: The ID of the file to retrieve.
          required: true
          type: string
      responses:
        '200':
          description: A representation of the attached file.
          schema:
            $ref: '#/definitions/AssistantFile'
      summary: Microsoft Azure Get Assistants Assistantid Files Fileid
      tags:
        - Assistants
    delete:
      operationId: microsoftAzureDeleteassistantfile
      description: >-
        Unlinks a previously attached file from an assistant, rendering it
        unavailable for use by tools that can read<br>files.
      parameters:
        - name: assistantId
          in: path
          description: >-
            The ID of the assistant from which the specified file should be
            unlinked.
          required: true
          type: string
        - name: fileId
          in: path
          description: The ID of the file to unlink from the specified assistant.
          required: true
          type: string
      responses:
        '200':
          description: Status information about the requested file association deletion.
          schema:
            $ref: '#/definitions/AssistantFileDeletionStatus'
      summary: Microsoft Azure Delete Assistants Assistantid Files Fileid
      tags:
        - Assistants
  /files:
    get:
      operationId: microsoftAzureListfiles
      description: Gets a list of previously uploaded files.
      parameters:
        - name: purpose
          in: query
          description: >-
            A value that, when provided, limits list results to files matching
            the corresponding purpose.
          required: false
          type: string
          enum:
            - fine-tune
            - fine-tune-results
            - assistants
            - assistants_output
          x-ms-enum:
            name: FilePurpose
            modelAsString: true
            values:
              - name: fineTune
                value: fine-tune
                description: Indicates a file is used for fine tuning input.
              - name: fineTuneResults
                value: fine-tune-results
                description: Indicates a file is used for fine tuning results.
              - name: assistants
                value: assistants
                description: Indicates a file is used as input to assistants.
              - name: assistantsOutput
                value: assistants_output
                description: Indicates a file is used as output by assistants.
      responses:
        '200':
          description: The requested list of files.
          schema:
            $ref: '#/definitions/FileListResponse'
      summary: Microsoft Azure Get Files
      tags:
        - Files
    post:
      operationId: microsoftAzureCreatefile
      description: Uploads a file for use by other operations.
      consumes:
        - multipart/form-data
      parameters:
        - name: file
          in: formData
          description: The file data (not filename) to upload.
          required: true
          type: file
        - name: purpose
          in: formData
          description: The intended purpose of the file.
          required: true
          type: string
          enum:
            - fine-tune
            - fine-tune-results
            - assistants
            - assistants_output
          x-ms-enum:
            name: FilePurpose
            modelAsString: true
            values:
              - name: fineTune
                value: fine-tune
                description: Indicates a file is used for fine tuning input.
              - name: fineTuneResults
                value: fine-tune-results
                description: Indicates a file is used for fine tuning results.
              - name: assistants
                value: assistants
                description: Indicates a file is used as input to assistants.
              - name: assistantsOutput
                value: assistants_output
                description: Indicates a file is used as output by assistants.
        - name: filename
          in: formData
          description: A filename to associate with the uploaded data.
          required: false
          type: string
      responses:
        '200':
          description: A representation of the uploaded file.
          schema:
            $ref: '#/definitions/OpenAIFile'
      summary: Microsoft Azure Post Files
      tags:
        - Files
  /files/{fileId}:
    get:
      operationId: microsoftAzureRetrievefile
      description: >-
        Returns information about a specific file. Does not retrieve file
        content.
      parameters:
        - name: fileId
          in: path
          description: The ID of the file to retrieve.
          required: true
          type: string
      responses:
        '200':
          description: The request has succeeded.
          schema:
            $ref: '#/definitions/OpenAIFile'
      summary: Microsoft Azure Get Files Fileid
      tags:
        - Files
    delete:
      operationId: microsoftAzureDeletefile
      description: Delete a previously uploaded file.
      parameters:
        - name: fileId
          in: path
          description: The ID of the file to delete.
          required: true
          type: string
      responses:
        '200':
          description: The request has succeeded.
          schema:
            $ref: '#/definitions/FileDeletionStatus'
      summary: Microsoft Azure Delete Files Fileid
      tags:
        - Files
  /threads:
    post:
      operationId: microsoftAzureCreatethread
      description: >-
        Creates a new thread. Threads contain messages and can be run by
        assistants.
      parameters:
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/AssistantThreadCreationOptions'
      responses:
        '200':
          description: Information about the newly created thread.
          schema:
            $ref: '#/definitions/AssistantThread'
      summary: Microsoft Azure Post Threads
      tags:
        - Threads
  /threads/{threadId}:
    get:
      operationId: microsoftAzureGetthread
      description: Gets information about an existing thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread to retrieve information about.
          required: true
          type: string
      responses:
        '200':
          description: Information about the requested thread.
          schema:
            $ref: '#/definitions/AssistantThread'
      summary: Microsoft Azure Get Threads Threadid
      tags:
        - Threads
    post:
      operationId: microsoftAzureModifythread
      description: Modifies an existing thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread to modify.
          required: true
          type: string
        - name: body
          in: body
          required: true
          schema:
            type: object
            properties:
              metadata:
                type: object
                description: >-
                  A set of up to 16 key/value pairs that can be attached to an
                  object, used for storing additional information about that
                  object in a structured format. Keys may be up to 64 characters
                  in length and values may be up to 512 characters in length.
                x-nullable: true
                additionalProperties:
                  type: string
      responses:
        '200':
          description: Information about the modified thread.
          schema:
            $ref: '#/definitions/AssistantThread'
      summary: Microsoft Azure Post Threads Threadid
      tags:
        - Threads
    delete:
      operationId: microsoftAzureDeletethread
      description: Deletes an existing thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread to delete.
          required: true
          type: string
      responses:
        '200':
          description: Status information about the requested thread deletion operation.
          schema:
            $ref: '#/definitions/ThreadDeletionStatus'
      summary: Microsoft Azure Delete Threads Threadid
      tags:
        - Threads
  /threads/{threadId}/messages:
    get:
      operationId: microsoftAzureListmessages
      description: Gets a list of messages that exist on a thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread to list messages from.
          required: true
          type: string
        - name: limit
          in: query
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 20.
          required: false
          type: integer
          format: int32
          default: 20
        - name: order
          in: query
          description: >-
            Sort order by the created_at timestamp of the objects. asc for
            ascending order and desc for descending order.
          required: false
          type: string
          default: desc
          enum:
            - asc
            - desc
          x-ms-enum:
            name: ListSortOrder
            modelAsString: true
            values:
              - name: ascending
                value: asc
                description: Specifies an ascending sort order.
              - name: descending
                value: desc
                description: Specifies a descending sort order.
        - name: after
          in: query
          description: >-
            A cursor for use in pagination. after is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include after=obj_foo in order to fetch the next page of the list.
          required: false
          type: string
        - name: before
          in: query
          description: >-
            A cursor for use in pagination. before is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include before=obj_foo in order to fetch the previous page of the
            list.
          required: false
          type: string
      responses:
        '200':
          description: The requested list of messages.
          schema:
            type: object
            description: The response data for a requested list of items.
            properties:
              object:
                type: string
                description: The object type, which is always list.
                enum:
                  - list
                x-ms-enum:
                  modelAsString: false
              data:
                type: array
                description: The requested list of items.
                items:
                  $ref: '#/definitions/ThreadMessage'
              first_id:
                type: string
                description: The first ID represented in this list.
                x-ms-client-name: firstId
              last_id:
                type: string
                description: The last ID represented in this list.
                x-ms-client-name: lastId
              has_more:
                type: boolean
                description: >-
                  A value indicating whether there are additional values
                  available not captured in this list.
                x-ms-client-name: hasMore
            required:
              - object
              - data
              - first_id
              - last_id
              - has_more
      summary: Microsoft Azure Get Threads Threadid Messages
      tags:
        - Threads
    post:
      operationId: microsoftAzureCreatemessage
      description: Creates a new message on a specified thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread to create the new message on.
          required: true
          type: string
        - name: body
          in: body
          required: true
          schema:
            type: object
            properties:
              role:
                $ref: '#/definitions/MessageRole'
                description: The role to associate with the new message.
              content:
                type: string
                description: The textual content for the new message.
              file_ids:
                type: array
                description: >-
                  A list of up to 10 file IDs to associate with the message, as
                  used by tools like 'code_interpreter' or 'retrieval' that can
                  read files.
                items:
                  type: string
                x-ms-client-name: fileIds
              metadata:
                type: object
                description: >-
                  A set of up to 16 key/value pairs that can be attached to an
                  object, used for storing additional information about that
                  object in a structured format. Keys may be up to 64 characters
                  in length and values may be up to 512 characters in length.
                x-nullable: true
                additionalProperties:
                  type: string
            required:
              - role
              - content
      responses:
        '200':
          description: A representation of the new message.
          schema:
            $ref: '#/definitions/ThreadMessage'
      summary: Microsoft Azure Post Threads Threadid Messages
      tags:
        - Threads
  /threads/{threadId}/messages/{messageId}:
    get:
      operationId: microsoftAzureGetmessage
      description: Gets an existing message from an existing thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread to retrieve the specified message from.
          required: true
          type: string
        - name: messageId
          in: path
          description: The ID of the message to retrieve from the specified thread.
          required: true
          type: string
      responses:
        '200':
          description: A representation of the requested message.
          schema:
            $ref: '#/definitions/ThreadMessage'
      summary: Microsoft Azure Get Threads Threadid Messages Messageid
      tags:
        - Threads
    post:
      operationId: microsoftAzureModifymessage
      description: Modifies an existing message on an existing thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread containing the specified message to modify.
          required: true
          type: string
        - name: messageId
          in: path
          description: The ID of the message to modify on the specified thread.
          required: true
          type: string
        - name: body
          in: body
          required: true
          schema:
            type: object
            properties:
              metadata:
                type: object
                description: >-
                  A set of up to 16 key/value pairs that can be attached to an
                  object, used for storing additional information about that
                  object in a structured format. Keys may be up to 64 characters
                  in length and values may be up to 512 characters in length.
                x-nullable: true
                additionalProperties:
                  type: string
      responses:
        '200':
          description: A representation of the modified message.
          schema:
            $ref: '#/definitions/ThreadMessage'
      summary: Microsoft Azure Post Threads Threadid Messages Messageid
      tags:
        - Threads
  /threads/{threadId}/messages/{messageId}/files:
    get:
      operationId: microsoftAzureListmessagefiles
      description: >-
        Gets a list of previously uploaded files associated with a message from
        a thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread containing the message to list files from.
          required: true
          type: string
        - name: messageId
          in: path
          description: The ID of the message to list files from.
          required: true
          type: string
        - name: limit
          in: query
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 20.
          required: false
          type: integer
          format: int32
          default: 20
        - name: order
          in: query
          description: >-
            Sort order by the created_at timestamp of the objects. asc for
            ascending order and desc for descending order.
          required: false
          type: string
          default: desc
          enum:
            - asc
            - desc
          x-ms-enum:
            name: ListSortOrder
            modelAsString: true
            values:
              - name: ascending
                value: asc
                description: Specifies an ascending sort order.
              - name: descending
                value: desc
                description: Specifies a descending sort order.
        - name: after
          in: query
          description: >-
            A cursor for use in pagination. after is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include after=obj_foo in order to fetch the next page of the list.
          required: false
          type: string
        - name: before
          in: query
          description: >-
            A cursor for use in pagination. before is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with obj_foo, your subsequent call can
            include before=obj_foo in order to fetch the previous page of the
            list.
          required: false
          type: string
      responses:
        '200':
          description: The requested list of files associated with the specified message.
          schema:
            type: object
            description: The response data for a requested list of items.
            properties:
              object:
                type: string
                description: The object type, which is always list.
                enum:
                  - list
                x-ms-enum:
                  modelAsString: false
              data:
                type: array
                description: The requested list of items.
                items:
                  $ref: '#/definitions/MessageFile'
              first_id:
                type: string
                description: The first ID represented in this list.
                x-ms-client-name: firstId
              last_id:
                type: string
                description: The last ID represented in this list.
                x-ms-client-name: lastId
              has_more:
                type: boolean
                description: >-
                  A value indicating whether there are additional values
                  available not captured in this list.
                x-ms-client-name: hasMore
            required:
              - object
              - data
              - first_id
              - last_id
              - has_more
      summary: Microsoft Azure Get Threads Threadid Messages Messageid Files
      tags:
        - Threads
  /threads/{threadId}/messages/{messageId}/files/{fileId}:
    get:
      operationId: microsoftAzureGetmessagefile
      description: Gets information about a file attachment to a message within a thread.
      parameters:
        - name: threadId
          in: path
          description: The ID of the thread containing the message to get information from.
          required: true
          type: string
        - name: messageId
          in: path
          description: The ID of the message to get information from.
          required: true
          type: string
        - name: fileId
          in: path
          description: The ID of the file to get infor

# --- truncated at 32 KB (91 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/microsoft-azure/refs/heads/main/openapi/azure-openai-openapi-original.yml