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



## OpenAPI

````yaml https://api.gbase.ai/openapi-redoc.json get /v1/ais/{ai_id}
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/ais/{ai_id}:
    get:
      tags:
        - GBase AI
      summary: Get AI
      operationId: get_ai_v1_ais__ai_id__get
      parameters:
        - required: true
          schema:
            type: string
            format: uuid
            title: Ai Id
          name: ai_id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIDetailOutWithPermission'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0HTTPBearer: []
components:
  schemas:
    AIDetailOutWithPermission:
      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
        user:
          allOf:
            - $ref: '#/components/schemas/mygpt.models.User.leaf'
          title: User
        apis:
          items:
            $ref: '#/components/schemas/mygpt.models.AgentFunctionCallApi.leaf'
          type: array
          title: Apis
        datasets:
          items:
            $ref: '#/components/schemas/mygpt.models.Dataset.leaf'
          type: array
          title: Datasets
        questions:
          items:
            $ref: '#/components/schemas/mygpt.models.Question.leaf'
          type: array
          title: Questions
        file_count:
          type: integer
          title: File Count
        configs:
          type: object
          title: Configs
        company_id:
          type: string
          title: Company Id
          description: Alias for organization_id for API compatibility
        permission_type:
          type: string
          title: Permission Type
          description: User's permission type for this robot (OWNER, EDIT, VIEW).
        clone_task_id:
          type: string
          title: Clone Task Id
          description: Active or most-recent clone task id when ai_status is in CLONING_*
        progress_percent:
          type: integer
          title: Progress Percent
          description: Clone progress percent (0-100) when ai_status is in CLONING_*
      additionalProperties: false
      type: object
      required:
        - created_at
        - name
        - user
        - apis
        - datasets
        - questions
        - file_count
        - configs
      title: AIDetailOut
      description: Extended AIDetailOut with enterprise permission information
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    mygpt.models.User.leaf:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        user_id:
          type: string
          maxLength: 100
          title: User Id
        email:
          type: string
          maxLength: 100
          title: Email
        name:
          type: string
          maxLength: 100
          title: Name
        picture:
          type: string
          maxLength: 1500
          title: Picture
          nullable: true
        locale:
          type: string
          maxLength: 10
          title: Locale
          nullable: true
        corporate:
          type: boolean
          title: Corporate
          default: false
        is_independent:
          type: boolean
          title: Is Independent
          default: false
        admin_overrides:
          title: Admin Overrides
        dealer_id:
          type: string
          format: uuid
          title: Dealer Id
          description: 所属代理店（仅 DEALER_ADMIN 必填）
          nullable: true
      additionalProperties: false
      type: object
      required:
        - created_at
        - user_id
        - email
        - name
      title: User
    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工具的定义表
    mygpt.models.Dataset.leaf:
      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
        organization_id:
          type: string
          maxLength: 100
          title: Organization Id
          nullable: true
        user_id:
          type: string
          maxLength: 100
          title: User Id
      additionalProperties: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - user_id
      title: Dataset
    mygpt.models.Question.leaf:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        question:
          type: string
          title: Question
        question_type:
          type: string
          maxLength: 40
          title: Question Type
          description: 'Generator: generator'
          default: generator
      additionalProperties: false
      type: object
      required:
        - question
      title: Question
    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

````