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

> One run's totals over its traces, plus per-value trace counts (`facets`) for the trace listing's filters. A run with no traces returns `404`.



## OpenAPI

````yaml https://prime-traces.pintel.dev/openapi.json get /api/v1/runs/{run_id}
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/runs/{run_id}:
    get:
      tags:
        - Runs
      summary: Get a run
      description: >-
        One run's totals over its traces, plus per-value trace counts (`facets`)
        for the trace listing's filters. A run with no traces returns `404`.
      operationId: get_run_api_v1_runs__run_id__get
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run 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/RunDetail'
        '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: The run holds no traces (`run_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:
    RunDetail:
      properties:
        run_id:
          type: string
          title: Run Id
        first_trace_created_at:
          type: string
          format: date-time
          title: First Trace Created At
        last_trace_created_at:
          type: string
          format: date-time
          title: Last Trace Created At
        last_trace_ingested_at:
          type: string
          format: date-time
          title: Last Trace Ingested At
        trace_count:
          type: integer
          title: Trace Count
        episode_count:
          type: integer
          title: Episode Count
        avg_reward:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Reward
        step_min:
          anyOf:
            - type: integer
            - type: 'null'
          title: Step Min
        step_max:
          anyOf:
            - type: integer
            - type: 'null'
          title: Step Max
        step_count:
          type: integer
          title: Step Count
        has_error:
          type: boolean
          title: Has Error
        first_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: First User Id
        environment_ids:
          items:
            type: string
          type: array
          title: Environment Ids
        model_ids:
          items:
            type: string
          type: array
          title: Model Ids
        context:
          additionalProperties:
            type: string
          type: object
          title: Context
        facets:
          $ref: '#/components/schemas/RunFacets'
      type: object
      required:
        - run_id
        - first_trace_created_at
        - last_trace_created_at
        - last_trace_ingested_at
        - trace_count
        - episode_count
        - avg_reward
        - step_min
        - step_max
        - step_count
        - has_error
        - first_user_id
        - environment_ids
        - model_ids
        - context
        - facets
      title: RunDetail
      description: |-
        A single run's summary plus its facets. The listing stays a
        `RunSummary`: facets are computed only when one run is read.
    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
    RunFacets:
      properties:
        environment_id:
          $ref: '#/components/schemas/ValueFacet'
        outcome:
          $ref: '#/components/schemas/ValueFacet'
        model_id:
          $ref: '#/components/schemas/ValueFacet'
        agent_name:
          $ref: '#/components/schemas/ValueFacet'
        task_id:
          $ref: '#/components/schemas/ValueFacet'
        created_by:
          $ref: '#/components/schemas/ValueFacet'
        has_error:
          $ref: '#/components/schemas/BooleanFacet'
        is_truncated:
          $ref: '#/components/schemas/BooleanFacet'
        reward:
          $ref: '#/components/schemas/RewardFacet'
      type: object
      required:
        - environment_id
        - outcome
        - model_id
        - agent_name
        - task_id
        - created_by
        - has_error
        - is_truncated
        - reward
      title: RunFacets
      description: |-
        Per-value trace counts over the run's current trace versions, for
        filter controls. Keyed by the trace listing's filter parameter names, so
        a value maps to the filter that selects it.
    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
    ValueFacet:
      properties:
        values:
          items:
            $ref: '#/components/schemas/FacetValue'
          type: array
          title: Values
        other_count:
          type: integer
          title: Other Count
        missing_count:
          type: integer
          title: Missing Count
      type: object
      required:
        - values
        - other_count
        - missing_count
      title: ValueFacet
      description: |-
        One column's distinct values in a run, most traces first.

        Every trace lands in exactly one of `values`, `other_count` and
        `missing_count`, so the three always sum to the run's `trace_count`.
    BooleanFacet:
      properties:
        'true':
          type: integer
          title: 'True'
        'false':
          type: integer
          title: 'False'
      type: object
      required:
        - 'true'
        - 'false'
      title: BooleanFacet
    RewardFacet:
      properties:
        unscored:
          type: integer
          title: Unscored
        negative:
          type: integer
          title: Negative
        zero:
          type: integer
          title: Zero
        partial:
          type: integer
          title: Partial
        one:
          type: integer
          title: One
        above_one:
          type: integer
          title: Above One
      type: object
      required:
        - unscored
        - negative
        - zero
        - partial
        - one
        - above_one
      title: RewardFacet
      description: Traces per reward band; the bands partition the run's traces.
    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
    FacetValue:
      properties:
        value:
          type: string
          title: Value
        trace_count:
          type: integer
          title: Trace Count
      type: object
      required:
        - value
        - trace_count
      title: FacetValue
  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.