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

# List coding agent session events

> List a coding-agent session's events (model calls, compactions, rate limits, tool runs, prompts) in time order, keyset-paginated. Pass the previous response's nextCursor to continue; filter with kinds (comma-separated).



## OpenAPI

````yaml GET /api/coding-agent/sessions/{sessionId}/events
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/coding-agent/sessions/{sessionId}/events:
    get:
      summary: List coding agent session events
      description: >-
        List a coding-agent session's events (model calls, compactions, rate
        limits, tool runs, prompts) in time order, keyset-paginated. Pass the
        previous response's nextCursor to continue; filter with kinds
        (comma-separated).
      operationId: getApiCoding-agentSessionsBySessionIdEvents
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: string
          description: The agent's own session id (session.id / conversation id).
        - name: kinds
          in: query
          required: false
          schema:
            type: string
          description: >-
            Comma-separated event kinds to include. Known kinds: model_call,
            compaction, rate_limit, api_error, retries_exhausted, tool_result,
            tool_decision, user_prompt, subagent_completed.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque keyset cursor from the previous response's nextCursor.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            default: 500
        - name: from
          in: query
          required: false
          schema:
            type: integer
          description: >-
            Epoch ms lower bound on event time; with `to`, prunes storage
            partitions for faster reads.
        - name: to
          in: query
          required: false
          schema:
            type: integer
          description: Epoch ms upper bound on event time.
      responses:
        '200':
          description: One page of session events plus the cursor for the next page
          content:
            application/json:
              schema:
                type: object
                properties:
                  events:
                    type: array
                    items:
                      type: object
                      properties:
                        sessionId:
                          type: string
                        timeUnixMs:
                          type: number
                        recordId:
                          type: string
                        eventKind:
                          type: string
                        agent:
                          type: string
                        sessionKeySource:
                          type: string
                        traceId:
                          type: string
                        spanId:
                          type: string
                        promptId:
                          type: string
                        querySource:
                          type: string
                        agentType:
                          type: string
                        eventSequence:
                          type: number
                        requestId:
                          type: string
                        model:
                          type: string
                        inputTokens:
                          type: number
                        outputTokens:
                          type: number
                        cacheReadTokens:
                          type: number
                        cacheCreationTokens:
                          type: number
                        costUsd:
                          type: number
                        durationMs:
                          type: number
                        ttftMs:
                          type: number
                        attempt:
                          type: number
                        speed:
                          type: string
                        stopReason:
                          type: string
                        preTokens:
                          type: number
                        postTokens:
                          type: number
                        compactionTrigger:
                          type: string
                        precomputeReuse:
                          type: string
                        statusCode:
                          type: string
                        errorType:
                          type: string
                        rateLimitCarrier:
                          type: string
                        retryDurationMs:
                          type: number
                        toolName:
                          type: string
                        success:
                          type: string
                        decision:
                          type: string
                        decisionSource:
                          type: string
                        toolInputBytes:
                          type: number
                        toolResultBytes:
                          type: number
                        promptChars:
                          type: number
                        totalTokens:
                          type: number
                      required:
                        - sessionId
                        - timeUnixMs
                        - recordId
                        - eventKind
                        - agent
                        - sessionKeySource
                        - traceId
                        - spanId
                        - promptId
                        - querySource
                        - agentType
                        - eventSequence
                        - requestId
                        - model
                        - inputTokens
                        - outputTokens
                        - cacheReadTokens
                        - cacheCreationTokens
                        - costUsd
                        - durationMs
                        - ttftMs
                        - attempt
                        - speed
                        - stopReason
                        - preTokens
                        - postTokens
                        - compactionTrigger
                        - precomputeReuse
                        - statusCode
                        - errorType
                        - rateLimitCarrier
                        - retryDurationMs
                        - toolName
                        - success
                        - decision
                        - decisionSource
                        - toolInputBytes
                        - toolResultBytes
                        - promptChars
                        - totalTokens
                  nextCursor:
                    type:
                      - string
                      - 'null'
                required:
                  - events
                  - nextCursor
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````