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

# Get a trace's timeline

> Everything a timeline needs in one request: every node's position, parent, timestamp, role, trainability and tool-call ids and names, every model call with its token usage, the trace's activity counts, and its lifecycle: phase timing, outcome flags, stop condition, error count and agent. Message content is not included; read it page by page from the trace's nodes.

`lifecycle`, call `usage` and node `trainable` are read from the trace's stored copy and are null for formats other than Verifiers.

Indexing, `409 trace_not_indexed` and `partial_index` work as for trace nodes. The response is not paginated.

The response carries an `ETag`. Send it back as `If-None-Match` to get `304` when the trace has not changed since.



## OpenAPI

````yaml https://prime-traces.pintel.dev/openapi.json get /api/v1/traces/{trace_id}/timeline
openapi: 3.1.0
info:
  title: Prime Traces
  description: >
    Upload, query and delete training, evaluation and inference traces.


    Authenticate with a Prime Intellect API key that has the **Prime Traces**

    permission, sent as `Authorization: Bearer <api key>`. Send
    `X-Prime-Team-ID`

    to act on a team's traces instead of your personal ones.


    Errors share one envelope, `{"error": {"code", "message", "details?"}}`,
    where

    `code` is stable and safe to branch on.
  version: '0'
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/traces/{trace_id}/timeline:
    get:
      tags:
        - Traces
      summary: Get a trace's timeline
      description: >-
        Everything a timeline needs in one request: every node's position,
        parent, timestamp, role, trainability and tool-call ids and names, every
        model call with its token usage, the trace's activity counts, and its
        lifecycle: phase timing, outcome flags, stop condition, error count and
        agent. Message content is not included; read it page by page from the
        trace's nodes.


        `lifecycle`, call `usage` and node `trainable` are read from the trace's
        stored copy and are null for formats other than Verifiers.


        Indexing, `409 trace_not_indexed` and `partial_index` work as for trace
        nodes. The response is not paginated.


        The response carries an `ETag`. Send it back as `If-None-Match` to get
        `304` when the trace has not changed since.
      operationId: get_trace_timeline_api_v1_traces__trace_id__timeline_get
      parameters:
        - name: trace_id
          in: path
          required: true
          schema:
            type: string
            title: Trace Id
        - name: x-prime-team-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Act on this team's traces instead of your personal ones. You must
              be a member of the team.
            title: X-Prime-Team-Id
          description: >-
            Act on this team's traces instead of your personal ones. You must be
            a member of the team.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceTimeline'
        '304':
          description: The body for this `ETag` is unchanged.
        '400':
          description: >-
            An unknown query parameter or invalid filter value
            (`invalid_filter`), or a cursor issued for different filters
            (`invalid_cursor`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 'Missing or malformed `Authorization: Bearer <api key>` header.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The API key lacks the required `traces` permission (`forbidden`), or
            Prime Traces is not enabled for this account
            (`service_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No stored copy of this trace (`trace_not_found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The trace's node and call index is not built yet
            (`trace_not_indexed`). Retry, or read the trace with `raw=true`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: >-
            Storage or authentication is temporarily unavailable. Retry after
            the `Retry-After` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - PrimeApiKey: []
components:
  schemas:
    TraceTimeline:
      properties:
        trace_id:
          type: string
          title: Trace Id
        revision:
          $ref: '#/components/schemas/TraceRevision'
        nodes:
          items:
            $ref: '#/components/schemas/TimelineNode'
          type: array
          title: Nodes
        calls:
          items:
            $ref: '#/components/schemas/TimelineCall'
          type: array
          title: Calls
        activity:
          anyOf:
            - $ref: '#/components/schemas/TraceActivity'
            - type: 'null'
        lifecycle:
          anyOf:
            - $ref: '#/components/schemas/TimelineLifecycle'
            - type: 'null'
        indexed_count:
          type: integer
          title: Indexed Count
        partial_index:
          type: boolean
          title: Partial Index
      type: object
      required:
        - trace_id
        - revision
        - nodes
        - calls
        - activity
        - lifecycle
        - indexed_count
        - partial_index
      title: TraceTimeline
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TraceRevision:
      properties:
        upload_id:
          type: string
          title: Upload Id
        generation:
          type: string
          title: Generation
      type: object
      required:
        - upload_id
        - generation
      title: TraceRevision
    TimelineNode:
      properties:
        node_idx:
          type: integer
          title: Node Idx
        parent_idx:
          anyOf:
            - type: integer
            - type: 'null'
          title: Parent Idx
        timestamp:
          anyOf:
            - type: number
            - type: 'null'
          title: Timestamp
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
        sampled:
          type: boolean
          title: Sampled
        trainable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Trainable
        tool_calls:
          anyOf:
            - items:
                $ref: '#/components/schemas/TimelineToolCall'
              type: array
            - type: 'null'
          title: Tool Calls
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
      type: object
      required:
        - node_idx
        - parent_idx
        - timestamp
        - role
        - sampled
        - trainable
        - tool_calls
        - tool_call_id
        - name
        - tool_name
      title: TimelineNode
      description: A node's geometry and tool correlation, without its content.
    TimelineCall:
      properties:
        call_idx:
          type: integer
          title: Call Idx
        node_idx:
          anyOf:
            - type: integer
            - type: 'null'
          title: Node Idx
        time_start:
          anyOf:
            - type: number
            - type: 'null'
          title: Time Start
        time_end:
          anyOf:
            - type: number
            - type: 'null'
          title: Time End
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        endpoint:
          anyOf:
            - type: string
            - type: 'null'
          title: Endpoint
        finish_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Finish Reason
        usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage
      type: object
      required:
        - call_idx
        - node_idx
        - time_start
        - time_end
        - model
        - endpoint
        - finish_reason
        - usage
      title: TimelineCall
    TraceActivity:
      properties:
        total_entries:
          type: integer
          title: Total Entries
        user_messages:
          type: integer
          title: User Messages
        model_turns:
          type: integer
          title: Model Turns
        model_calls:
          type: integer
          title: Model Calls
        tool_calls:
          type: integer
          title: Tool Calls
        tool_results:
          type: integer
          title: Tool Results
        steps_per_branch:
          items:
            type: integer
          type: array
          title: Steps Per Branch
      type: object
      required:
        - total_entries
        - user_messages
        - model_turns
        - model_calls
        - tool_calls
        - tool_results
        - steps_per_branch
      title: TraceActivity
    TimelineLifecycle:
      properties:
        timing:
          $ref: '#/components/schemas/TimelineTiming'
        ok:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ok
        is_completed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Completed
        is_timeout:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Timeout
        stop_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Stop Condition
        error_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Error Count
        agent:
          $ref: '#/components/schemas/TimelineAgent'
      type: object
      required:
        - timing
        - ok
        - is_completed
        - is_timeout
        - stop_condition
        - error_count
        - agent
      title: TimelineLifecycle
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      required:
        - code
        - message
      title: ErrorBody
    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
    TimelineToolCall:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - id
        - name
      title: TimelineToolCall
    TimelineTiming:
      properties:
        start:
          anyOf:
            - type: number
            - type: 'null'
          title: Start
        boot:
          $ref: '#/components/schemas/TimelineSpan'
        setup:
          $ref: '#/components/schemas/TimelineSpan'
        agent:
          $ref: '#/components/schemas/TimelineAgentSpan'
        finalize:
          $ref: '#/components/schemas/TimelineSpan'
        scoring:
          $ref: '#/components/schemas/TimelineSpan'
      type: object
      required:
        - start
        - boot
        - setup
        - agent
        - finalize
        - scoring
      title: TimelineTiming
      description: 'Verifiers'' `timing`: back-to-back lifecycle phases, epoch seconds.'
    TimelineAgent:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
      type: object
      required:
        - name
        - model
      title: TimelineAgent
    ErrorCode:
      type: string
      enum:
        - upload_too_large
        - trace_too_large
        - too_many_traces_in_episode
        - episode_id_too_long
        - environment_id_too_long
        - too_many_traces_in_upload
        - duplicate_trace_id
        - duplicate_episode_id
        - digest_mismatch
        - line_format_mismatch
        - malformed_encoding
        - invalid_trace
        - invalid_metadata
        - created_at_out_of_window
        - unsupported_schema_version
        - unknown_episode_reference
        - line_format_conflict
        - source_conflict
        - upload_attribution_conflict
        - billing_intent_required
        - invalid_idempotency_key
        - invalid_cursor
        - invalid_filter
        - search_limit_exceeded
        - unauthenticated
        - forbidden
        - service_not_enabled
        - source_forbidden
        - auth_unavailable
        - trace_not_found
        - trace_not_indexed
        - run_not_found
        - episode_not_found
        - export_job_not_found
        - task_already_running
        - invalid_schedule_time
        - snapshot_not_due
        - statement_production_incomplete
        - statement_production_failed
        - rate_limited
        - writer_pool_saturated
        - ingest_capacity_exceeded
        - ingest_unavailable
        - storage_unavailable
        - index_task_queue_unavailable
        - index_capacity_exceeded
        - internal_error
      title: ErrorCode
    TimelineSpan:
      properties:
        start:
          anyOf:
            - type: number
            - type: 'null'
          title: Start
        end:
          anyOf:
            - type: number
            - type: 'null'
          title: End
      type: object
      required:
        - start
        - end
      title: TimelineSpan
    TimelineAgentSpan:
      properties:
        start:
          anyOf:
            - type: number
            - type: 'null'
          title: Start
        end:
          anyOf:
            - type: number
            - type: 'null'
          title: End
        model:
          $ref: '#/components/schemas/TimelineSplit'
        harness:
          $ref: '#/components/schemas/TimelineSplit'
      type: object
      required:
        - start
        - end
        - model
        - harness
      title: TimelineAgentSpan
    TimelineSplit:
      properties:
        duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration
      type: object
      required:
        - duration
      title: TimelineSplit
  securitySchemes:
    PrimeApiKey:
      type: http
      description: A Prime Intellect API key with the Prime Traces permission.
      scheme: bearer

````

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