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

# Retrieve an eval run trace

> Returns a finite page of sanitized execution events for one eval run. Use `next_after_id` as `after_id` to retrieve the next page. Use the monitor operation instead when following a run live.



## OpenAPI

````yaml /openapi.json get /v2/eval-runs/{run_id}/trace
openapi: 3.1.0
info:
  title: Lightsage Public API
  description: Public API for Lightsage CLI and external integrations.
  version: 1.0.0
servers:
  - url: https://api.lightsage.com
    description: Production
security: []
tags:
  - name: Status
    description: Check API availability and validate the calling API key.
  - name: Visibility
    description: >-
      Measure visibility, citations, competitors, and prompt performance across
      answer platforms.
  - name: Prompts
    description: Manage tracked prompts and topics, and inspect their stored runs.
  - name: Opportunities
    description: Review ranked opportunities computed from prompt visibility results.
  - name: Tasks
    description: Manage the persisted action queue and task lifecycle.
  - name: Site Audits
    description: Review website audit results and page-level findings.
  - name: Evals
    description: Define eval tasks, judges, subjects, and saved configurations.
  - name: Eval Templates
    description: >-
      Select reusable judges, targets, schedules, metadata, and runtime settings
      with `POST /v2/eval-templates`, then copy only those settings into
      prompt-specific evals with `POST /v2/evals/batch`. Templates never contain
      prompts and remain independent from evals created from them.
  - name: Eval Runs
    description: Start eval runs and inspect their lifecycle state.
  - name: Eval Results
    description: Review completed eval outcomes and diagnostic details.
  - name: Agent Preference
    description: >-
      Compare your company head-to-head with a tracked competitor. Create a
      comparison with `POST /v2/agent-preference/evals`, run it with `POST
      /v2/eval-runs`, then read which company agents recommended.
  - name: Agents
    description: List runnable coding-agent harness and model combinations.
  - name: Repositories
    description: Manage reusable Git repository workspaces.
  - name: Environments
    description: List reusable runtime environments without exposing secret values.
  - name: MCP Servers
    description: List reusable MCP server integrations without exposing credentials.
  - name: CLIs
    description: List reusable command-line interfaces without exposing setup commands.
  - name: Skills
    description: List reusable skills available to workflows and evals.
paths:
  /v2/eval-runs/{run_id}/trace:
    get:
      tags:
        - Eval Runs
      summary: Retrieve an eval run trace
      description: >-
        Returns a finite page of sanitized execution events for one eval run.
        Use `next_after_id` as `after_id` to retrieve the next page. Use the
        monitor operation instead when following a run live.
      operationId: v2_eval_runs_trace
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
        - name: after_id
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: After Id
          description: Return events with IDs greater than this cursor.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 500
            title: Limit
          description: Maximum number of trace events to return.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2EvalRunTraceResponse'
        '404':
          description: >-
            Eval run not found. Use the run ID returned when you started the
            eval.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                required:
                  - detail
              example:
                detail: >-
                  Eval run not found. Use the run ID returned when you started
                  the eval.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - LightsageApiKeyAuth: []
components:
  schemas:
    V2EvalRunTraceResponse:
      properties:
        run_id:
          type: string
          title: Run Id
        status:
          type: string
          title: Status
        progress:
          $ref: '#/components/schemas/PublicEvalRunProgress'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        data:
          items:
            $ref: '#/components/schemas/V2EvalRunTraceEvent'
          type: array
          title: Data
        next_after_id:
          type: integer
          minimum: 0
          title: Next After Id
          description: Cursor to pass as `after_id` when requesting the next page.
        has_more:
          type: boolean
          title: Has More
      type: object
      required:
        - run_id
        - status
        - next_after_id
        - has_more
      title: V2EvalRunTraceResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PublicEvalRunProgress:
      properties:
        total:
          type: integer
          title: Total
          default: 0
        queued:
          type: integer
          title: Queued
          default: 0
        running:
          type: integer
          title: Running
          default: 0
        completed:
          type: integer
          title: Completed
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
        cancelled:
          type: integer
          title: Cancelled
          default: 0
        retrying:
          type: integer
          title: Retrying
          description: >-
            Recoverable child jobs waiting to be retried. These remain active
            and are excluded from `percent`.
          default: 0
        interrupted:
          type: integer
          title: Interrupted
          description: Deprecated compatibility alias for `retrying`; use `retrying`.
          default: 0
          deprecated: true
        percent:
          type: number
          title: Percent
          description: >-
            The percentage of child jobs in a final state (`completed`,
            `failed`, or `cancelled`). It can reach `100` while the parent job
            is still summarizing, so use `status` to detect completion.
          default: 0
      type: object
      title: PublicEvalRunProgress
    V2EvalRunTraceEvent:
      properties:
        run_id:
          type: string
          title: Run Id
        eval_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Id
        eval_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Eval Name
        configuration_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Configuration Id
        agent:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent
        prompt_index:
          type: integer
          minimum: 0
          title: Prompt Index
          default: 0
        repeat_index:
          type: integer
          minimum: 0
          title: Repeat Index
          default: 0
        child_job_id:
          type: string
          title: Child Job Id
          description: Child eval-attempt ID associated with the event.
        event_id:
          type: integer
          title: Event Id
        timestamp:
          anyOf:
            - type: string
            - type: 'null'
          title: Timestamp
        category:
          type: string
          title: Category
        type:
          type: string
          title: Type
          description: >-
            Event type. Events are not tool invocations: one invocation usually
            emits a `tool_call` event and a `tool_result` event, and can emit
            extra `tool_call` updates as its arguments stream. Count invocations
            with the result's `tool_calls`, not with trace events.
        message:
          type: string
          title: Message
        data:
          additionalProperties: true
          type: object
          title: Data
          description: Sanitized event payload.
      type: object
      required:
        - run_id
        - child_job_id
        - event_id
        - category
        - type
        - message
      title: V2EvalRunTraceEvent
    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:
    LightsageApiKeyAuth:
      type: apiKey
      in: header
      name: X-Lightsage-Api-Key

````

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