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

> ## Agent Instructions
> These docs moved from docs.flintai.dev to docs.switchagents.ai. Use docs.switchagents.ai for every link and request.
> To search these docs from an AI tool, connect the MCP server at https://docs.switchagents.ai/mcp. The page index is at https://docs.switchagents.ai/llms.txt.
> The source code for these products is public on GitHub. Switch Rooms: https://github.com/sandbox-quantum/switch. Switch Trust CLI: https://github.com/sandbox-quantum/switch-trust-cli. Switch Trust CodeScan action: https://github.com/sandbox-quantum/switch-trust-codescan-action. Switch Trust MCP server: https://github.com/sandbox-quantum/switch-trust-mcp. Switch Trust Python SDK: https://github.com/sandbox-quantum/switch-trust-sdk-py. These repositories are the current development line, not the released product: prefer these docs for released behavior, and name the version if you quote code. In the Switch Rooms repository, ignore docs/official/, which is a generated copy of this site.

# List ROI source interactions

> List raw LLM interaction rows (with computed cost_usd) for one agent — the source data the ROI analyzers read



## OpenAPI

````yaml /switch-trust/api-reference/openapi.json get /roi/interactions/tenants/{tenant_id}/workspaces/{workspace_id}
openapi: 3.0.3
info:
  contact: {}
  description: Switch Trust API
  license:
    name: Switch AI
    url: https://docs.switchagents.ai/legal/terms
  title: Switch Trust API
  version: 1.0.0
servers:
  - description: Switch Trust API
    url: https://{host}/api/v1
    variables:
      host:
        default: api.switchagents.ai
        description: Your instance's API host
security: []
paths:
  /roi/interactions/tenants/{tenant_id}/workspaces/{workspace_id}:
    get:
      tags:
        - roi
      summary: List ROI source interactions
      description: >-
        List raw LLM interaction rows (with computed cost_usd) for one agent —
        the source data the ROI analyzers read
      operationId: RoiListInteractions
      parameters:
        - description: Tenant ID
          in: path
          name: tenant_id
          required: true
          schema:
            type: string
        - description: Workspace ID
          in: path
          name: workspace_id
          required: true
          schema:
            type: string
        - description: Agent ID
          in: query
          name: agent_id
          required: true
          schema:
            type: string
        - description: Only interactions at or after this RFC3339 timestamp
          in: query
          name: since
          schema:
            type: string
        - description: Only interactions at or before this RFC3339 timestamp
          in: query
          name: until
          schema:
            type: string
        - description: Page number (1-based)
          in: query
          name: page
          schema:
            type: integer
        - description: Page size
          in: query
          name: page_size
          schema:
            type: integer
        - description: Sort order
          in: query
          name: order
          schema:
            enum:
              - ASC
              - DESC
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/roi.ListInteractionsResult'
          description: Paginated interaction rows
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Forbidden
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Internal Server Error
      security:
        - BearerAuth: []
components:
  schemas:
    roi.ListInteractionsResult:
      properties:
        items:
          items:
            $ref: '#/components/schemas/roi.InteractionRecord'
          type: array
        page:
          type: integer
        page_size:
          type: integer
        total_count:
          type: integer
        total_pages:
          type: integer
      type: object
    common.RequestError:
      description: Error responses returned by the API
      properties:
        code:
          example: 400
          type: integer
        message:
          example: Invalid request
          type: string
      required:
        - code
        - message
      type: object
    roi.InteractionRecord:
      properties:
        agent_id:
          type: string
        cache_read_tokens:
          type: integer
        cache_write_tokens:
          type: integer
        cost_usd:
          description: >-
            CostUSD is computed from tokens × effective model pricing (override
            →

            default), the same formula the cost package uses.
          type: number
        guardrail_result_prompt:
          type: string
        guardrail_result_response:
          type: string
        id:
          type: string
        input_tokens:
          type: integer
        interaction_time:
          type: string
        max_tokens:
          description: >-
            MaxTokens (requested output cap) and StopReason (why generation
            stopped)

            drive the verbosity analyzer's max-tokens right-sizing.
            Nullable/empty

            until the producer populates them; the analyzer treats absence as
            unknown.
          type: integer
        model_fingerprint:
          type: string
        model_latency_ms:
          type: integer
        model_name:
          type: string
        model_supplier:
          type: string
        output_tokens:
          type: integer
        prompt_text:
          type: string
        response_text:
          type: string
        session_id:
          type: string
        stop_reason:
          type: string
        tool_definitions:
          items:
            type: object
          type: array
        tool_use:
          items:
            type: object
          type: array
        total_latency_ms:
          type: integer
      type: object
  securitySchemes:
    BearerAuth:
      description: >-
        Send "ApiKey <your_api_key>" to authenticate with an API key, or "Bearer
        <token>" with a user session token.
      in: header
      name: Authorization
      type: apiKey

````