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

# Get files



## OpenAPI

````yaml api-reference/openai-v1.yaml get /files
openapi: 3.0.0
info:
  title: Azure AI Foundry Models Service
  license:
    name: MIT
    url: https://github.com/openai/openai-openapi/blob/master/LICENSE
  version: v1
servers:
  - url: '{endpoint}/openai/v1'
    description: Azure AI Foundry Models APIs
    variables:
      endpoint:
        default: ''
        description: >-
          A supported Azure AI Foundry Models APIs endpoint, including protocol
          and hostname.

          For example:

          https://westus.api.cognitive.microsoft.com).
security:
  - ApiKeyAuth: []
  - ApiKeyAuth_: []
  - OAuth2Auth:
      - https://cognitiveservices.azure.com/.default
tags:
  - name: Chat
  - name: Embeddings
  - name: Evals
  - name: Files
  - name: Fine-tuning
  - name: Models
  - name: Responses
  - name: Vector Stores
paths:
  /files:
    get:
      tags:
        - Files
      operationId: listFiles
      parameters:
        - name: api-version
          in: query
          required: false
          description: >-
            The explicit Azure AI Foundry Models API version to use for this
            request.

            `v1` if not otherwise specified.
          schema:
            $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion'
            default: v1
        - name: purpose
          in: query
          required: false
          schema:
            type: string
          explode: false
      responses:
        '200':
          description: The request has succeeded.
          headers:
            apim-request-id:
              required: false
              description: A request ID used for troubleshooting purposes.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AzureListFilesResponse'
        default:
          description: An unexpected error response.
          headers:
            apim-request-id:
              required: false
              description: A request ID used for troubleshooting purposes.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AzureErrorResponse'
components:
  schemas:
    AzureAIFoundryModelsApiVersion:
      type: string
      enum:
        - v1
        - preview
    AzureListFilesResponse:
      type: object
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/AzureOpenAIFile'
        first_id:
          type: string
        last_id:
          type: string
        has_more:
          type: boolean
    AzureErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: The distinct, machine-generated identifier for the error.
            message:
              type: string
              description: A human-readable message associated with the error.
            param:
              type: string
              description: >-
                If applicable, the request input parameter associated with the
                error
            type:
              type: string
              enum:
                - error
              description: The object type, always 'error.'
            inner_error: {}
          description: The error details.
    AzureOpenAIFile:
      type: object
      required:
        - id
        - bytes
        - created_at
        - filename
        - object
        - purpose
        - status
      properties:
        id:
          type: string
          description: The file identifier, which can be referenced in the API endpoints.
        bytes:
          type: integer
          format: int64
          nullable: true
          description: The size of the file, in bytes.
        created_at:
          type: integer
          format: unixtime
          description: The Unix timestamp (in seconds) for when the file was created.
        expires_at:
          type: integer
          format: unixtime
          description: The Unix timestamp (in seconds) for when the file will expire.
        filename:
          type: string
          description: The name of the file.
        object:
          type: string
          enum:
            - file
          description: The object type, which is always `file`.
        status_details:
          type: string
          description: >-
            Deprecated. For details on why a fine-tuning training file failed
            validation, see the `error` field on `fine_tuning.job`.
          deprecated: true
        purpose:
          type: string
          enum:
            - assistants
            - assistants_output
            - batch
            - batch_output
            - fine-tune
            - fine-tune-results
            - evals
          description: >-
            The intended purpose of the file. Supported values are `assistants`,
            `assistants_output`, `batch`, `batch_output`, `fine-tune` and
            `fine-tune-results`.
        status:
          type: string
          enum:
            - uploaded
            - pending
            - running
            - processed
            - error
            - deleting
            - deleted
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key
    ApiKeyAuth_:
      type: apiKey
      in: header
      name: authorization
    OAuth2Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
          scopes:
            https://cognitiveservices.azure.com/.default: ''

````