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

# Tail Run Trace

> Live-tail (plan A6): projected trace steps appended since ``cursor``.
Cheap polling — one ranged R2 read per call against the mid-run mirrored
trace object; ``done`` flips when the run row is terminal (keep polling
until done AND an empty batch, so the final flush is never missed).



## OpenAPI

````yaml https://www.datalab.to/openapi.json get /api/v1/agent-studio/runs/{run_id}/tail
openapi: 3.1.0
info:
  title: Datalab API
  version: 0.0.1
servers:
  - url: https://www.datalab.to
    description: Datalab API
security: []
paths:
  /api/v1/agent-studio/runs/{run_id}/tail:
    get:
      tags:
        - agent-studio
      summary: Tail Run Trace
      description: |-
        Live-tail (plan A6): projected trace steps appended since ``cursor``.
        Cheap polling — one ranged R2 read per call against the mid-run mirrored
        trace object; ``done`` flips when the run row is terminal (keep polling
        until done AND an empty batch, so the final flush is never missed).
      operationId: tail_run_trace_api_v1_agent_studio_runs__run_id__tail_get
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: integer
            title: Run Id
        - name: cursor
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Byte cursor into the trace.
            default: 0
            title: Cursor
          description: Byte cursor into the trace.
        - name: wos-session
          in: cookie
          required: false
          schema:
            type: string
            title: Wos-Session
        - name: datalab_active_team
          in: cookie
          required: false
          schema:
            type: string
            title: Datalab Active Team
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceTailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    TraceTailResponse:
      properties:
        events:
          items:
            $ref: '#/components/schemas/TraceStepResponse'
          type: array
          title: Events
        cursor:
          type: integer
          minimum: 0
          title: Cursor
          description: >-
            Next byte cursor (pass back on the next poll). Advances only past
            complete trace lines.
        done:
          type: boolean
          title: Done
          description: True when the run row is terminal.
      type: object
      required:
        - cursor
        - done
      title: TraceTailResponse
      description: 'Live-tail batch (plan A6): projected steps since the byte cursor.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TraceStepResponse:
      properties:
        at:
          type: number
          title: At
          description: Seconds from run start.
        kind:
          type: string
          enum:
            - thought
            - tool
            - verify
            - finish
          title: Kind
        label:
          type: string
          title: Label
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        args:
          anyOf:
            - type: string
            - type: 'null'
          title: Args
          description: Tool call arguments, JSON-formatted.
        status:
          anyOf:
            - type: string
              enum:
                - pass
                - fail
                - warn
                - na
            - type: 'null'
          title: Status
      type: object
      required:
        - at
        - kind
        - label
      title: TraceStepResponse
      description: |-
        One projected trace step (types.ts TraceStep) — a PROJECTION, never the
        raw trace.jsonl.
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````