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

# List agent sessions

> Turn-by-turn analytics for your agent's sessions: transcripts, per-stage latency and usage, tool calls and knowledge-base hits.

Optionally filter by `roomId`, `agentId`, or both; without either, returns all your sessions. Newest first.




## OpenAPI

````yaml /api-reference/rest/openapi.yaml get /v1/agents/sessions
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v1/agents/sessions:
    get:
      tags:
        - Agents
      summary: List agent sessions
      description: >
        Turn-by-turn analytics for your agent's sessions: transcripts, per-stage
        latency and usage, tool calls and knowledge-base hits.


        Optionally filter by `roomId`, `agentId`, or both; without either,
        returns all your sessions. Newest first.
      parameters:
        - name: roomId
          in: query
          description: Only sessions in this room.
          schema:
            type: string
          example: kq1v-wa7n-p75u
        - name: agentId
          in: query
          description: Only sessions of this agent.
          schema:
            type: string
          example: ag_c0i8m6
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: perPage
          in: query
          description: At most 100.
          schema:
            type: integer
            default: 20
            maximum: 100
      responses:
        '200':
          description: A page of sessions. Empty `data` when nothing matches.
          content:
            application/json:
              schema:
                type: object
                properties:
                  pageInfo:
                    $ref: '#/components/schemas/PageInfo'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AgentSession'
              example:
                pageInfo:
                  currentPage: 1
                  perPage: 20
                  lastPage: 1
                  total: 1
                data:
                  - sessionId: 6accd7b37825310b96d559e4
                    roomId: kq1v-wa7n-p75u
                    agentId: ag_c0i8m6
                    region: in1
                    createdAt: '2026-10-12T12:51:17.021Z'
                    startedAt: '2026-10-12T12:51:14.239Z'
                    endedAt: '2026-10-12T12:52:44.861Z'
                    durationMs: 90622
                    systemPrompt: >-
                      You are a support agent for an online store. Keep replies
                      to one or two sentences.
                    turns:
                      - turnId: 146d22b2773c0357
                        user: null
                        agent:
                          transcript: Hi! How can I help you today?
                          speechStartTime: 1791809474239
                          speechEndTime: 1791809476941
                        interrupted: false
                        e2eLatencyMs: null
                        toolCalls: []
                        kbRetrievals: []
                        kbRetrievalLatencyMs: null
                        stt: null
                        llm: null
                        tts:
                          provider: CartesiaTTS
                          model: sonic-3
                          latencyMs: 107.73
                          usage:
                            characters: 28
                            inputTokens: null
                            outputTokens: null
                        realtime: null
                        eou: null
                        denoise: null
                        handOff: null
                        callTransfer: null
                      - turnId: d40d7034293996c4
                        user:
                          transcript: Who are you?
                          speechStartTime: 1791809480137
                          speechEndTime: 1791809480877
                        agent:
                          transcript: >-
                            I am a support agent for this online store. How can
                            I assist you with your order or any questions today?
                          speechStartTime: 1791809485616
                          speechEndTime: 1791809486117
                        interrupted: true
                        e2eLatencyMs: 5047.2
                        toolCalls: []
                        kbRetrievals: []
                        kbRetrievalLatencyMs: null
                        stt:
                          provider: DeepgramSTT
                          model: nova-3-general
                          latencyMs: 2075.79
                          confidence: 0.96777344
                          usage:
                            durationSec: 1.74
                            inputTokens: 0
                            outputTokens: 0
                        llm:
                          provider: GoogleLLM
                          model: gemini-3.5-flash
                          latencyMs: 2697.2
                          usage:
                            promptTokens: 91
                            completionTokens: 23
                            totalTokens: 114
                            promptCachedTokens: 0
                        tts:
                          provider: CartesiaTTS
                          model: sonic-3
                          latencyMs: 85.46
                          usage:
                            characters: 103
                            inputTokens: null
                            outputTokens: null
                        realtime: null
                        eou:
                          provider: TurnV2
                          model: echo-large
                          latencyMs: 272.79
                        denoise: null
                        handOff: null
                        callTransfer: null
                      - turnId: 39676df29d719c55
                        user:
                          transcript: Writing executes.
                          speechStartTime: 1791809555377
                          speechEndTime: null
                        agent: null
                        interrupted: false
                        e2eLatencyMs: 6249.77
                        toolCalls:
                          - type: function
                            name: end_call
                            arguments:
                              message: Goodbye! Have a great day.
                            result:
                              status: ending_call
                        kbRetrievals: []
                        kbRetrievalLatencyMs: null
                        stt:
                          provider: DeepgramSTT
                          model: nova-3-general
                          latencyMs: null
                          confidence: 0
                          usage:
                            durationSec: 0
                            inputTokens: 0
                            outputTokens: 0
                        llm: null
                        tts: null
                        realtime: null
                        eou: null
                        denoise: null
                        handOff: null
                        callTransfer: null
        '400':
          description: '`Unable to get sessions.`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                error: Unable to get sessions.
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    PageInfo:
      type: object
      properties:
        currentPage:
          type: integer
          example: 1
        perPage:
          type: integer
          example: 20
        lastPage:
          type: integer
          example: 1
        total:
          type: integer
          example: 2
    AgentSession:
      type: object
      properties:
        sessionId:
          type: string
          example: 6accd7b37825310b96d559e4
        roomId:
          type: string
          example: kq1v-wa7n-p75u
        agentId:
          type:
            - string
            - 'null'
          example: ag_c0i8m6
        region:
          type:
            - string
            - 'null'
          description: Data-residency region the session ran in.
          example: in1
        createdAt:
          type: string
          format: date-time
        startedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Start of the first speech in the session.
        endedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: End of the last speech in the session.
        durationMs:
          type:
            - integer
            - 'null'
          description: '`endedAt` minus `startedAt`.'
        systemPrompt:
          type:
            - string
            - 'null'
          description: The agent's instructions for this session.
        turns:
          type: array
          items:
            $ref: '#/components/schemas/AgentSessionTurn'
    Error:
      type: object
      properties:
        error:
          type: string
    AgentSessionTurn:
      type: object
      description: >-
        One exchange. A stage that didn't run in this turn is `null`, not a
        block of zeros.
      properties:
        turnId:
          type: string
          example: d40d7034293996c4
        user:
          oneOf:
            - $ref: '#/components/schemas/AgentSessionSpeech'
            - type: 'null'
          description: '`null` when the user didn''t speak, e.g. the greeting.'
        agent:
          oneOf:
            - $ref: '#/components/schemas/AgentSessionSpeech'
            - type: 'null'
        interrupted:
          type: boolean
          description: The user cut the agent off.
        e2eLatencyMs:
          type:
            - number
            - 'null'
          description: >-
            From the end of the user's speech to the agent's first audio. `null`
            when there's no user transcript.
        toolCalls:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - function
                  - mcp
              name:
                type: string
                example: end_call
              arguments:
                description: Always `null` for `mcp`.
              result:
                description: Always `null` for `mcp`.
        kbRetrievals:
          type: array
          items:
            type: object
            properties:
              documentId:
                type:
                  - string
                  - 'null'
              name:
                type:
                  - string
                  - 'null'
              heading:
                type:
                  - string
                  - 'null'
              contentType:
                type:
                  - string
                  - 'null'
              content:
                type:
                  - string
                  - 'null'
              score:
                type:
                  - number
                  - 'null'
        kbRetrievalLatencyMs:
          type:
            - number
            - 'null'
        stt:
          oneOf:
            - type: object
              properties:
                provider:
                  type: string
                  example: DeepgramSTT
                model:
                  type:
                    - string
                    - 'null'
                  example: nova-3-general
                latencyMs:
                  type:
                    - number
                    - 'null'
                confidence:
                  type:
                    - number
                    - 'null'
                  description: Transcription confidence from the provider, 0 to 1.
                usage:
                  type: object
                  properties:
                    durationSec:
                      type:
                        - number
                        - 'null'
                      description: Audio transcribed.
                    inputTokens:
                      type: integer
                      description: Token-billed providers only, else `0`.
                    outputTokens:
                      type: integer
            - type: 'null'
        llm:
          oneOf:
            - type: object
              properties:
                provider:
                  type: string
                  example: GoogleLLM
                model:
                  type:
                    - string
                    - 'null'
                  example: gemini-3.5-flash
                latencyMs:
                  type:
                    - number
                    - 'null'
                  description: Time to first token.
                usage:
                  type: object
                  properties:
                    promptTokens:
                      type: integer
                    completionTokens:
                      type: integer
                    totalTokens:
                      type: integer
                    promptCachedTokens:
                      type: integer
            - type: 'null'
        tts:
          oneOf:
            - type: object
              properties:
                provider:
                  type: string
                  example: CartesiaTTS
                model:
                  type:
                    - string
                    - 'null'
                  example: sonic-3
                latencyMs:
                  type:
                    - number
                    - 'null'
                  description: Time to first byte of audio.
                usage:
                  type: object
                  properties:
                    characters:
                      type: integer
                    inputTokens:
                      type: 'null'
                      description: Not reported yet.
                    outputTokens:
                      type: 'null'
                      description: Not reported yet.
            - type: 'null'
        realtime:
          description: >-
            Set instead of `stt`, `llm` and `tts` when the agent runs a realtime
            (speech-to-speech) model.
          oneOf:
            - type: object
              properties:
                provider:
                  type: string
                model:
                  type:
                    - string
                    - 'null'
                latencyMs:
                  type:
                    - number
                    - 'null'
                  description: Time to first byte of audio.
                usage:
                  type: object
                  properties:
                    inputTokens:
                      type: integer
                    outputTokens:
                      type: integer
                    totalTokens:
                      type: integer
                    inputTextTokens:
                      type: integer
                    inputAudioTokens:
                      type: integer
                    inputImageTokens:
                      type: integer
                    inputCachedTokens:
                      type: integer
                    thoughtsTokens:
                      type: integer
                    cachedTextTokens:
                      type: integer
                    cachedAudioTokens:
                      type: integer
                    cachedImageTokens:
                      type: integer
                    outputTextTokens:
                      type: integer
                    outputAudioTokens:
                      type: integer
                    outputImageTokens:
                      type: integer
            - type: 'null'
        eou:
          description: End-of-utterance (turn) detection.
          oneOf:
            - $ref: '#/components/schemas/AgentSessionStage'
            - type: 'null'
        denoise:
          description: Noise cancellation. `latencyMs` is the average per audio frame.
          oneOf:
            - $ref: '#/components/schemas/AgentSessionStage'
            - type: 'null'
        handOff:
          type:
            - object
            - 'null'
          description: The agent handed the call to another agent.
          properties:
            to:
              type:
                - string
                - 'null'
        callTransfer:
          type:
            - object
            - 'null'
          description: The call was transferred over SIP.
          properties:
            to:
              type:
                - string
                - 'null'
    AgentSessionSpeech:
      type: object
      properties:
        transcript:
          type:
            - string
            - 'null'
          description: >-
            Agent: the full text it generated, which can be longer than what was
            heard if it was interrupted.
        speechStartTime:
          type:
            - integer
            - 'null'
          description: Unix epoch milliseconds.
          example: 1791809480137
        speechEndTime:
          type:
            - integer
            - 'null'
          description: Unix epoch milliseconds. `null` when the speech was cut off.
          example: 1791809480877
    AgentSessionStage:
      type: object
      properties:
        provider:
          type:
            - string
            - 'null'
          example: TurnV2
        model:
          type:
            - string
            - 'null'
          example: echo-large
        latencyMs:
          type: number
  responses:
    Unauthorized:
      description: Missing or invalid `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

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