> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gbase.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get dataset files



## OpenAPI

````yaml https://api.gbase.ai/openapi-redoc.json get /v1/datasets/{dataset_id}/files
openapi: 3.1.0
info:
  title: GBase
  description: >
    # Introduce

    This API document can help you understand GBase more deeply. 

    You can train your own AI directly through the interface of this document.



    ##  Authentication


    Home page: [https://gbase.ai](https://gbase.ai)


    Huggingface:
    [https://huggingface.co/gptbase](https://huggingface.co/gptbase)


    The GBase API uses API keys for authentication. Visit your API Keys page to
    retrieve the API key you'll use in your requests.


    Remember that your API key is a secret! Do not share it with others or
    expose it in any client-side code (browsers, apps). 

    Production requests must be routed through your own backend server where
    your API key can be securely loaded from an environment variable or key
    management service.


    All API requests should include your API key in an Authorization HTTP header
    as follows:


    Parameter name: Authorization


    Value: Bearer [YOUR_API_KEY](https://admin.gbase.ai/keys)


    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    ## Use steps

    1.Fill in your API keys.


    2.You can create an AI by using either the API interface or the
    administrative backend. Once created, the AI will generate an ID which will
    be required for the subsequent steps.


    3.Use the generated ID to call the file upload interface.


    4.After uploading the file, you can use the question interface to inquire
    about it.
  version: 0.0.1
servers:
  - url: https://api.gbase.ai
security: []
paths:
  /v1/datasets/{dataset_id}/files:
    get:
      tags:
        - Datasets
      summary: Get dataset files
      operationId: get_dataset_files_v1_datasets__dataset_id__files_get
      parameters:
        - required: true
          schema:
            type: string
            format: uuid
            title: Dataset Id
          name: dataset_id
          in: path
        - required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/DatasourceType'
              - type: string
            title: File Type
            default: website
          name: file_type
          in: query
        - required: false
          schema:
            type: string
            title: Source Type
          name: source_type
          in: query
        - required: false
          schema:
            $ref: '#/components/schemas/VectorFileStatus'
          name: file_status
          in: query
        - required: false
          schema:
            type: string
            title: Query
          name: query
          in: query
        - required: false
          schema:
            type: integer
            title: Learn Type Filter
            default: 0
          name: learn_type_filter
          in: query
        - required: false
          schema:
            type: string
            format: uuid
            title: Integration Rule Id
          name: integration_rule_id
          in: query
        - description: list of file IDs to retrieve
          required: false
          schema:
            items:
              type: string
            type: array
            title: File Ids
            description: list of file IDs to retrieve
          name: file_ids
          in: query
        - required: false
          schema:
            type: string
            format: date-time
            title: Start Time
          name: start_time
          in: query
        - required: false
          schema:
            type: string
            format: date-time
            title: End Time
          name: end_time
          in: query
        - required: false
          schema:
            type: integer
            minimum: 1
            title: Page
            default: 1
          name: page
          in: query
        - required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            title: Size
            default: 50
          name: size
          in: query
        - required: false
          schema:
            type: string
            title: Order By
          name: order_by
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_VectorFileOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0ImplicitBearer: []
        - Auth0HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    DatasourceType:
      type: string
      enum:
        - file
        - website
        - sitemap
        - gitbook
        - faq
        - api
        - integration
      title: DatasourceType
      description: An enumeration.
    VectorFileStatus:
      type: string
      enum:
        - crawled
        - process
        - complete
        - fail
        - exceeded
        - deleted
        - ready
        - invalid
      title: VectorFileStatus
      description: An enumeration.
    Page_VectorFileOut_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/VectorFileOut'
          type: array
          title: Items
        total:
          type: integer
          minimum: 0
          title: Total
        page:
          type: integer
          minimum: 1
          title: Page
        size:
          type: integer
          minimum: 1
          title: Size
        pages:
          type: integer
          minimum: 0
          title: Pages
      type: object
      required:
        - items
        - total
        - page
        - size
      title: Page[VectorFileOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VectorFileOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        title:
          type: string
          maxLength: 2048
          title: Title
          nullable: true
        filename:
          type: string
          maxLength: 2048
          title: Filename
          description: 对于网页，存储URL；对于本地上传，存储文件名；对于Lark文档，存储file的name字段
          nullable: true
        file_type:
          type: string
          maxLength: 20
          title: File Type
          description: >-
            UPLOAD: upload<br/>CONVERT: convert<br/>HTML: html<br/>INTEGRATION:
            integration<br/>HTML_PDF: html_pdf<br/>SITEMAP: sitemap<br/>GITBOOK:
            gitbook<br/>FAQ: faq<br/>FAQ_QUESTION: faq_question
        file_status:
          type: string
          maxLength: 20
          title: File Status
          description: >-
            CRAWLED: crawled<br/>PROCESS: process<br/>COMPLETE:
            complete<br/>FAIL: fail<br/>Exceeded: exceeded<br/>DELETED:
            deleted<br/>READY: ready<br/>INVALID: invalid
          default: ready
        file_size:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: File Size
          default: 0
        token_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Token Count
          default: 0
        characters_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Characters Count
          default: 0
        failed_reason:
          type: string
          title: Failed Reason
          nullable: true
        index_ids:
          title: Index Ids
        resources:
          title: Resources
        content_hash:
          type: string
          maxLength: 255
          title: Content Hash
          nullable: true
        source_type:
          type: string
          maxLength: 100
          title: Source Type
          description: 文件来源类型
          nullable: true
        learn_type:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Learn Type
          default: 100
        dataset_id:
          type: string
          format: uuid
          title: Dataset Id
          nullable: true
        tokens:
          type: integer
          title: Tokens
        lark_file:
          $ref: '#/components/schemas/LarkFileOut'
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - file_type
        - tokens
      title: VectorFileOutBase
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    LarkFileOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        name:
          type: string
          maxLength: 1024
          title: Name
        type:
          type: string
          maxLength: 100
          title: Type
        token:
          type: string
          maxLength: 255
          title: Token
        parent_token:
          type: string
          maxLength: 255
          title: Parent Token
          nullable: true
        created_time:
          type: string
          maxLength: 255
          title: Created Time
        modified_time:
          type: string
          maxLength: 255
          title: Modified Time
        owner_id:
          type: string
          maxLength: 255
          title: Owner Id
          nullable: true
        url:
          type: string
          maxLength: 2048
          title: Url
        vector_file_id:
          type: string
          format: uuid
          title: Vector File Id
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - type
        - token
        - created_time
        - modified_time
        - url
        - vector_file_id
      title: LarkFileOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````