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

# Retrieve session history

> Returns a list of session history records for the authenticated user



## OpenAPI

````yaml https://api.simli.ai/openapi.yaml get /history/sessions
openapi: 3.1.0
info:
  title: Simli
  version: 1.0.0
servers:
  - url: https://api.simli.ai/
    description: API server
security:
  - ApiKeyAuth: []
paths:
  /history/sessions:
    get:
      summary: Retrieve session history
      description: Returns a list of session history records for the authenticated user
      parameters:
        - name: startTime
          in: query
          description: >-
            Sessions started at or after this Unix timestamp (default a week
            ago)
          required: false
          schema:
            type: integer
            example: 1745750387
        - name: endTime
          in: query
          description: >-
            Sessions started at or before this Unix timestamp (default now);
            requires startTime
          required: false
          schema:
            type: integer
            example: 1745750408
      responses:
        '200':
          description: A list of session history records
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessions:
                    type: array
                    items:
                      $ref: '#/components/schemas/HistoryRecord'
        '400':
          description: >-
            endTime without startTime, a timestamp that isn't a number, or a
            startTime in the future
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    HistoryRecord:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the session
        face_id:
          type: string
          description: face_id used in session
        kind:
          type: string
          description: Interaction Method
        simliModel:
          type: string
          enum:
            - Trinity 2
            - Trinity 1
          description: >-
            The avatar model that served the session; absent on records that
            don't say
        sessionAggregator:
          type: string
          description: >-
            Aggregation identifier provided in request by customer for grouping
            their end-users; the API key's name (apiKeyName) when the request
            gave none
        apiKeyName:
          type: string
          description: (optional) Name of the API key used for this session
        sessionTotalTime:
          type: number
          format: double
          description: Total session duration in seconds
        startTime:
          type: integer
          description: Session start time as Unix timestamp
        endTime:
          type: integer
          description: Session end time as Unix timestamp
        endReason:
          type: string
          description: >-
            (Simli Auto) Why the session ended, e.g. PARTICIPANT_LEFT,
            CLIENT_STOPPED, NOBODY_JOINED
        models:
          type: array
          description: (Simli Auto) Every model the session ran
          items:
            $ref: '#/components/schemas/ModelUse'
        metrics:
          $ref: '#/components/schemas/SessionMetrics'
        meteredUsage:
          type: object
          description: >-
            What the session's meters were billed, by service: the LLM and TTS
            when Simli's keys ran them (llmDelegate is the text model GPT-Live
            hands its reasoning to), and Simli Auto's agent fee on every Auto
            session's seconds (a minute at least)
          properties:
            llm:
              $ref: '#/components/schemas/MeterUsage'
            llmDelegate:
              $ref: '#/components/schemas/MeterUsage'
            tts:
              $ref: '#/components/schemas/MeterUsage'
            agent:
              $ref: '#/components/schemas/MeterUsage'
        estimatedCost:
          $ref: '#/components/schemas/EstimatedCost'
      required:
        - id
        - sessionTotalTime
        - startTime
        - endTime
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
      required:
        - error
    ModelUse:
      type: object
      properties:
        role:
          type: string
          enum:
            - llm
            - tts
            - stt
            - speech_to_speech
            - avatar
        provider:
          type: string
          example: Azure OpenAI
        model:
          type: string
          example: gpt-realtime-2.1-mini
        simliKey:
          type: boolean
          description: >-
            Whether it ran on Simli's key (Simli pays for it) rather than the
            caller's
    SessionMetrics:
      type: object
      description: >-
        (Simli Auto) What the session did. A field is present only where the
        session's services report it.
      properties:
        startup:
          type: object
          description: Milliseconds from the session's start on Simli's server
          properties:
            firstFrameMs:
              type: integer
              description: To the avatar's first frame
            userJoinedMs:
              type: integer
              description: To the user joining
            firstWordsMs:
              type: integer
              description: To the avatar's first words
        speech:
          type: object
          properties:
            userSeconds:
              type: number
              description: Seconds the user spoke
            avatarSeconds:
              type: number
              description: Seconds the avatar spoke
        turns:
          type: object
          properties:
            user:
              type: integer
            typed:
              type: integer
              description: >-
                The user's turns they typed (user-input on the session
                websocket) instead of saying; counted in user too
            avatar:
              type: integer
            interruptions:
              type: integer
              description: Times the user cut the avatar off
            backchannels:
              type: integer
              description: >-
                Short listening sounds ("mhm") the avatar made while the user
                talked; neither its turns nor replies
        replies:
          type: object
          description: >-
            From the end of the user's speech to the avatar's voice, per reply
            (typed turns' replies aren't counted)
          properties:
            count:
              type: integer
            meanMs:
              type: integer
            p50Ms:
              type: integer
            p90Ms:
              type: integer
            maxMs:
              type: integer
        ttfbMs:
          type: object
          description: Mean time to first byte of each kind of service (stt, llm, tts)
          additionalProperties:
            type: integer
        usage:
          type: object
          properties:
            llm:
              type: object
              description: Tokens the LLM or speech-to-speech model reported
              properties:
                inputTokens:
                  type: integer
                outputTokens:
                  type: integer
                totalTokens:
                  type: integer
                cachedInputTokens:
                  type: integer
                cacheWriteInputTokens:
                  type: integer
                reasoningTokens:
                  type: integer
                inputAudioTokens:
                  type: integer
                outputAudioTokens:
                  type: integer
                cachedInputAudioTokens:
                  type: integer
            tts:
              type: object
              properties:
                characters:
                  type: integer
            stt:
              type: object
              properties:
                audioSeconds:
                  type: number
        toolCalls:
          type: integer
          description: Function calls the model made (knowledge base searches among them)
        errors:
          type: integer
    MeterUsage:
      type: object
      description: >-
        What one service's usage meter got. A token meter's value is in its own
        units: the tokens weighted by their list prices over the meter's price,
        so the meter bills what they cost (in whole units).
      properties:
        meter:
          type: string
          example: gpt_6_luna_tokens
        value:
          type: integer
          description: What the meter was given
        connectedSeconds:
          type: integer
          description: Billed by the seconds the session was connected
        speakingSeconds:
          type: number
          description: (TTS) Seconds the avatar spoke
        uncachedInputTokens:
          type: integer
        cachedInputTokens:
          type: integer
        cacheWriteInputTokens:
          type: integer
        outputTokens:
          type: integer
          description: Output tokens, thinking included
        uncachedInputAudioTokens:
          type: integer
          description: >-
            (Speech to speech) Audio tokens, priced apart from the text ones
            above
        cachedInputAudioTokens:
          type: integer
        outputAudioTokens:
          type: integer
        transcribedSeconds:
          type: number
          description: (GPT-Realtime) Seconds of the user's speech transcribed
        transcriptionPricePerMinute:
          type: number
          description: The transcription's list price, dollars per minute
        listPricesPerMillion:
          type: object
          description: >-
            The model's list prices used, dollars per 1M tokens (its text's,
            where it prices audio apart)
          properties:
            input:
              type: number
            cachedInput:
              type: number
            cacheWrite:
              type: number
            output:
              type: number
            audioInput:
              type: number
            cachedAudioInput:
              type: number
            audioOutput:
              type: number
        meterPricePerMillion:
          type: number
          description: The meter's price, dollars per 1M of its units
        costUSD:
          type: number
          description: What the tokens cost at those list prices
    EstimatedCost:
      type: object
      description: >-
        What a billed session came to, approximately, in US dollars: Simli's
        seconds as billed at the account's plan rate, and what its LLM and TTS
        meters charged. It's the same whether credits or the invoice paid for
        it; the invoice rounds its totals, not each session's. Absent on
        sessions that weren't billed and on records from before it was kept.
      properties:
        totalUSD:
          type: number
          example: 0.0453
        byServiceUSD:
          type: object
          description: By service, as in meteredUsage, and simli
          properties:
            simli:
              type: number
            llm:
              type: number
            llmDelegate:
              type: number
            tts:
              type: number
            agent:
              type: number
              description: Simli Auto's agent fee
        simliBilledSeconds:
          type: integer
          description: >-
            Simli's seconds as billed (a Trinity session on a paid plan bills a
            fifth of its seconds, a minute's fifth at least)
        simliPricePerMinute:
          type: number
          description: The plan's rate for Simli's seconds, dollars a minute
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-simli-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.