> ## 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 Realtime Cost Sessions

> Per-session cost for one bot.



## OpenAPI

````yaml https://api.gbase.ai/openapi-redoc.json get /v1/robots/{ai_id}/realtime-cost/sessions
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/robots/{ai_id}/realtime-cost/sessions:
    get:
      tags:
        - Question
      summary: Get Realtime Cost Sessions
      description: Per-session cost for one bot.
      operationId: get_realtime_cost_sessions_v1_robots__ai_id__realtime_cost_sessions_get
      parameters:
        - required: true
          schema:
            type: string
            title: Ai Id
          name: ai_id
          in: path
        - 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: string
            title: Model
            default: auto
          name: model
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeSessionsCostOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    RealtimeSessionsCostOut:
      properties:
        bot_id:
          type: string
          title: Bot Id
        start_time:
          type: string
          format: date-time
          title: Start Time
        end_time:
          type: string
          format: date-time
          title: End Time
        model:
          type: string
          title: Model
        session_count:
          type: integer
          title: Session Count
        total_cost:
          type: number
          title: Total Cost
        sessions:
          items:
            $ref: '#/components/schemas/RealtimeSessionCostOut'
          type: array
          title: Sessions
      type: object
      required:
        - bot_id
        - model
        - session_count
        - total_cost
        - sessions
      title: RealtimeSessionsCostOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RealtimeSessionCostOut:
      properties:
        session_id:
          type: string
          title: Session Id
        created_at:
          type: string
          format: date-time
          title: Created At
        bot_id:
          type: string
          title: Bot Id
        bot_name:
          type: string
          title: Bot Name
        provider:
          type: string
          title: Provider
        user_identifier:
          type: string
          title: User Identifier
        language:
          type: string
          title: Language
        turn_count:
          type: integer
          title: Turn Count
          default: 0
        duration_ms:
          type: integer
          title: Duration Ms
          default: 0
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
        input_text_tokens:
          type: integer
          title: Input Text Tokens
          default: 0
        input_audio_tokens:
          type: integer
          title: Input Audio Tokens
          default: 0
        cached_tokens:
          type: integer
          title: Cached Tokens
          default: 0
        output_text_tokens:
          type: integer
          title: Output Text Tokens
          default: 0
        output_audio_tokens:
          type: integer
          title: Output Audio Tokens
          default: 0
        total_cost:
          type: number
          title: Total Cost
          default: 0
      type: object
      required:
        - session_id
        - created_at
        - bot_id
        - provider
      title: RealtimeSessionCostOut
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````