> ## 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 datasets

> You can obtain all datasets you create through this interface.



## OpenAPI

````yaml https://api.gbase.ai/openapi-redoc.json get /v1/datasets
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:
    get:
      tags:
        - Datasets
      summary: Get datasets
      description: You can obtain all datasets you create through this interface.
      operationId: get_datasets_v1_datasets_get
      parameters:
        - description: >-
            Company ID. If provided, returns company datasets; if not, returns
            personal datasets
          required: false
          schema:
            type: string
            title: Company Id
            description: >-
              Company ID. If provided, returns company datasets; if not, returns
              personal datasets
          name: company_id
          in: query
        - description: Search by dataset name or description
          required: false
          schema:
            type: string
            title: Search
            description: Search by dataset name or description
          name: search
          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_Union_DatasetCloneProgressOut__DatasetCloneProgressOutWithPermission__
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0ImplicitBearer: []
        - Auth0HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    Page_Union_DatasetCloneProgressOut__DatasetCloneProgressOutWithPermission__:
      properties:
        items:
          items:
            anyOf:
              - $ref: '#/components/schemas/DatasetCloneProgressOut'
              - $ref: '#/components/schemas/DatasetCloneProgressOutWithPermission'
          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[Union[DatasetCloneProgressOut,
        DatasetCloneProgressOutWithPermission]]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DatasetCloneProgressOut:
      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
        data_status:
          type: string
          maxLength: 14
          title: Data Status
          description: >-
            INIT: init<br/>READY: ready<br/>CLONING_TARGET:
            cloning_target<br/>CLONING_SOURCE:
            cloning_source<br/>CLONING_FAILED: cloning_failed<br/>FROZEN: frozen
          default: init
        name:
          type: string
          maxLength: 255
          title: Name
        description:
          type: string
          title: Description
          nullable: true
        metadata:
          title: Metadata
        url_rules:
          title: Url Rules
        robots:
          items:
            $ref: '#/components/schemas/mygpt.models.Robot.4baxuf'
          type: array
          title: Robots
        user_id:
          type: string
          maxLength: 100
          title: User Id
        company_id:
          type: string
          title: Company Id
          description: Alias for organization_id for API compatibility
        clone_progress:
          $ref: '#/components/schemas/CloneProgressOut'
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - robots
        - user_id
      title: DatasetOut
    DatasetCloneProgressOutWithPermission:
      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
        data_status:
          type: string
          maxLength: 14
          title: Data Status
          description: >-
            INIT: init<br/>READY: ready<br/>CLONING_TARGET:
            cloning_target<br/>CLONING_SOURCE:
            cloning_source<br/>CLONING_FAILED: cloning_failed<br/>FROZEN: frozen
          default: init
        name:
          type: string
          maxLength: 255
          title: Name
        description:
          type: string
          title: Description
          nullable: true
        metadata:
          title: Metadata
        url_rules:
          title: Url Rules
        robots:
          items:
            $ref: '#/components/schemas/mygpt.models.Robot.4baxuf'
          type: array
          title: Robots
        user_id:
          type: string
          maxLength: 100
          title: User Id
        company_id:
          type: string
          title: Company Id
          description: Alias for organization_id for API compatibility
        clone_progress:
          $ref: '#/components/schemas/CloneProgressOut'
        permission_type:
          type: string
          title: Permission Type
          description: >-
            User's permission type for this dataset in enterprise mode (VIEW,
            EDIT, etc.)
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - robots
        - user_id
      title: DatasetOut
      description: Extended DatasetCloneProgressOut with enterprise permission information
    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
    mygpt.models.Robot.4baxuf:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        name:
          type: string
          maxLength: 100
          title: Name
        discrible:
          type: string
          title: Discrible
          nullable: true
        subject_name:
          type: string
          title: Subject Name
          nullable: true
        prompt:
          type: string
          title: Prompt
          nullable: true
        robot_type:
          type: string
          maxLength: 100
          title: Robot Type
          description: >-
            RAG: rag<br/>DIGITAL_HUMAN: digital_human<br/>AGENT:
            agent<br/>CATALOG_AGENT: catalog_agent<br/>GENERAL_AGENT:
            general_agent<br/>GBASECLAW: gbaseclaw
          default: rag
        ai_type:
          type: string
          maxLength: 20
          title: Ai Type
          description: >-
            DEFAULT: default<br/>DEMO: demo<br/>PUBLIC: public<br/>PRIVATE:
            private<br/>TRENDING: trending
          default: private
        ai_model:
          type: string
          maxLength: 20
          title: Ai Model
          description: >-
            FILE: file<br/>WEBSITE: website<br/>DIGITAL_HUMAN:
            digital_human<br/>AGENT: agent
          default: file
        ai_status:
          type: string
          maxLength: 20
          title: Ai Status
          description: >-
            INIT: init<br/>READY: ready<br/>FROZEN: frozen<br/>CLONING_SOURCE:
            cloning_source<br/>CLONING_TARGET:
            cloning_target<br/>CLONING_FAILED: cloning_failed
          default: ready
        organization_id:
          type: string
          maxLength: 100
          title: Organization Id
          nullable: true
        apis:
          items:
            $ref: '#/components/schemas/mygpt.models.AgentFunctionCallApi.leaf'
          type: array
          title: Apis
        user_id:
          type: string
          maxLength: 100
          title: User Id
      additionalProperties: false
      type: object
      required:
        - created_at
        - name
        - apis
        - user_id
      title: Robot
    CloneProgressOut:
      properties:
        total:
          type: integer
          title: Total
        done:
          type: integer
          title: Done
        remaining:
          type: integer
          title: Remaining
      type: object
      required:
        - total
        - done
        - remaining
      title: CloneProgressOut
    mygpt.models.AgentFunctionCallApi.leaf:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        function_call_name:
          type: string
          maxLength: 255
          title: Function Call Name
          nullable: true
        openapi_url:
          type: string
          maxLength: 255
          title: Openapi Url
          nullable: true
        server_url:
          type: string
          maxLength: 255
          title: Server Url
          nullable: true
        path:
          type: string
          maxLength: 255
          title: Path
          nullable: true
        method:
          type: string
          maxLength: 255
          title: Method
          nullable: true
        header_authorization:
          title: Header Authorization
        function_type:
          type: string
          maxLength: 50
          title: Function Type
          nullable: true
        function_status:
          type: string
          maxLength: 50
          title: Function Status
          nullable: true
        share_status:
          type: string
          maxLength: 50
          title: Share Status
          nullable: true
        user_id:
          type: string
          maxLength: 100
          title: User Id
          nullable: true
        function_call_description:
          type: string
          maxLength: 255
          title: Function Call Description
          nullable: true
        matching_keywords:
          title: Matching Keywords
        llm_sta:
          type: boolean
          title: Llm Sta
          default: true
        body:
          title: Body
        auth_token_curl:
          title: Auth Token Curl
        body_required:
          title: Body Required
        request_explanation:
          type: string
          maxLength: 255
          title: Request Explanation
          nullable: true
      additionalProperties: false
      type: object
      required:
        - created_at
      title: AgentFunctionCallApi
      description: Agent的FunctionCall工具的定义表
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````