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

# List Traces

> Traces (grouped spans) in the window, newest first, keyset-paginated.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/workspaces/{workspace_id}/traces
openapi: 3.1.0
info:
  title: Visceral Backend
  version: 0.2.0
  description: >-
    The Visceral backend HTTP API. SDK and ingestion endpoints authenticate with
    a workspace API key; dashboard and CLI endpoints authenticate with a user
    session token. Both are sent as `Authorization: Bearer <token>`.
servers:
  - url: https://api.visceralai.dev
security: []
paths:
  /v1/workspaces/{workspace_id}/traces:
    get:
      tags:
        - stats
      summary: List Traces
      description: Traces (grouped spans) in the window, newest first, keyset-paginated.
      operationId: list_traces_v1_workspaces__workspace_id__traces_get
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Agent Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TracesPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - sessionToken: []
components:
  schemas:
    TracesPage:
      properties:
        traces:
          items:
            $ref: '#/components/schemas/TraceSummary'
          type: array
          title: Traces
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - traces
        - next_cursor
      title: TracesPage
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TraceSummary:
      properties:
        trace_id:
          type: string
          title: Trace Id
        root_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Name
        start_time:
          type: string
          format: date-time
          title: Start Time
        end_time:
          type: string
          format: date-time
          title: End Time
        duration_ms:
          type: number
          title: Duration Ms
        spans:
          type: integer
          title: Spans
        llm_calls:
          type: integer
          title: Llm Calls
        error:
          type: boolean
          title: Error
        input_tokens:
          type: integer
          title: Input Tokens
        output_tokens:
          type: integer
          title: Output Tokens
        cost_usd:
          type: number
          title: Cost Usd
      type: object
      required:
        - trace_id
        - root_name
        - start_time
        - end_time
        - duration_ms
        - spans
        - llm_calls
        - error
        - input_tokens
        - output_tokens
        - cost_usd
      title: TraceSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    sessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Short-lived user access token (ES256 JWT) issued by `POST
        /v1/auth/login` or the CLI device flow.

````