> ## 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.

# List episode traces

> Summaries of the traces in an episode, cursor-paginated.

An episode that does not exist returns `404`, so an empty page always means an existing episode with no matching traces.



## OpenAPI

````yaml https://prime-traces.pintel.dev/openapi.json get /api/v1/episodes/{episode_id}/traces
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://prime-traces.pintel.dev
security: []
paths:
  /api/v1/episodes/{episode_id}/traces:
    get:
      tags:
        - Episodes
      summary: List episode traces
      description: >-
        Summaries of the traces in an episode, cursor-paginated.


        An episode that does not exist returns `404`, so an empty page always
        means an existing episode with no matching traces.
      operationId: list_episode_traces_api_v1_episodes__episode_id__traces_get
      parameters:
        - name: episode_id
          in: path
          required: true
          schema:
            type: string
            title: Episode Id
        - name: run_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Run Id
        - name: environment_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Environment Id
        - name: model_provider
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Model Provider
        - name: model_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Model Id
        - name: task_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Task Id
        - name: task_key
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Task Key
        - name: task_hash
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Task Hash
        - name: outcome
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Outcome
        - name: run_step
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: integer
              - type: 'null'
            title: Run Step
        - name: step_min
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Step Min
        - name: step_max
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Step Max
        - name: has_error
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Has Error
        - name: is_truncated
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Is Truncated
        - name: reward_min
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: Reward Min
        - name: reward_max
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: Reward Max
        - name: created_after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created After
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created Before
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - 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/TracePage'
        '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 episode with this ID (`episode_not_found`).
          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:
    TracePage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/TraceSummary'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
        - next_cursor
      title: TracePage
    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
    TraceSummary:
      properties:
        trace_id:
          type: string
          title: Trace Id
        upload_id:
          type: string
          title: Upload Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        episode_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Episode Id
        created_at:
          type: string
          format: date-time
          title: Created At
        ingested_at:
          type: string
          format: date-time
          title: Ingested At
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
        run_step:
          anyOf:
            - type: integer
            - type: 'null'
          title: Run Step
        environment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment Id
        model:
          $ref: '#/components/schemas/TraceModelInfo'
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        task_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Key
        task_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Hash
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
        score:
          $ref: '#/components/schemas/TraceScore'
        execution:
          $ref: '#/components/schemas/TraceExecution'
        duration_ms:
          type: integer
          title: Duration Ms
        total_tokens:
          type: integer
          title: Total Tokens
        size_bytes:
          type: integer
          title: Size Bytes
        context:
          additionalProperties:
            type: string
          type: object
          title: Context
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
        activity:
          anyOf:
            - $ref: '#/components/schemas/TraceActivity'
            - type: 'null'
        tool_definitions:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Tool Definitions
      type: object
      required:
        - trace_id
        - upload_id
        - user_id
        - episode_id
        - created_at
        - ingested_at
        - run_id
        - run_step
        - environment_id
        - model
        - task_id
        - task_key
        - task_hash
        - agent_name
        - score
        - execution
        - duration_ms
        - total_tokens
        - size_bytes
        - context
        - metrics
        - activity
        - tool_definitions
      title: TraceSummary
    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
    TraceModelInfo:
      properties:
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
      type: object
      required:
        - provider
        - id
      title: TraceModelInfo
    TraceScore:
      properties:
        reward:
          anyOf:
            - type: number
            - type: 'null'
          title: Reward
        outcome:
          anyOf:
            - type: string
            - type: 'null'
          title: Outcome
      type: object
      required:
        - reward
        - outcome
      title: TraceScore
    TraceExecution:
      properties:
        has_error:
          type: boolean
          title: Has Error
        is_truncated:
          type: boolean
          title: Is Truncated
      type: object
      required:
        - has_error
        - is_truncated
      title: TraceExecution
    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
    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
        - 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
        - internal_error
      title: ErrorCode
  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.