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

# RunTournamentAPI mirrors erdo_run_pairwise_tournament: rank an experiment's


> page variants pairwise and persist the comparisons to the ledger. Synchronous — each judged pair is one LLM round-trip, so expect minutes.




## OpenAPI

````yaml /api/openapi.json post /v1/experiments/{experimentSlug}/tournament
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, and experiments. Authenticate with
    a Bearer API key (erdo_api_...) or scoped token (erdo_token_...).
  version: '2026-07-25'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/experiments/{experimentSlug}/tournament:
    post:
      summary: >
        RunTournamentAPI mirrors erdo_run_pairwise_tournament: rank an
        experiment's
      description: >
        page variants pairwise and persist the comparisons to the ledger.
        Synchronous — each judged pair is one LLM round-trip, so expect minutes.
      operationId: POST:mcp.RunTournamentAPI
      parameters:
        - allowEmptyValue: true
          explode: false
          in: path
          name: experimentSlug
          required: true
          schema:
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              properties:
                criteria:
                  type: string
                kind:
                  type: string
                max_comparisons:
                  format: int64
                  type: integer
                variant_keys:
                  items:
                    type: string
                  type: array
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  experiment_slug:
                    type: string
                  missing_variant_keys:
                    items:
                      type: string
                    title: >
                      MissingVariantKeys are requested keys the experiment has
                      no variant for.
                    type: array
                  result:
                    $ref: '#/components/schemas/agents.TournamentResult'
                  variants_without_page:
                    items:
                      type: string
                    title: >
                      VariantsWithoutPage are variants skipped for lack of
                      judgeable page content.
                    type: array
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    agents.TournamentResult:
      description: |
        merges, what persisted).
      properties:
        cluster_method:
          type: string
        comparisons:
          items:
            $ref: '#/components/schemas/agents.TournamentComparisonRecord'
          type: array
        converged:
          type: boolean
        iterations:
          format: int64
          type: integer
        judge_slug:
          type: string
        merges:
          items:
            $ref: '#/components/schemas/agents.TournamentMerge'
          type: array
        persisted:
          format: int64
          type: integer
        ranking:
          items:
            $ref: '#/components/schemas/agents.TournamentRankEntry'
          type: array
        skipped_pairs:
          description: |
            them).
          format: int64
          title: >
            Skipped is how many pairs a judge failure dropped (the fit proceeded
            without
          type: integer
      title: >
        TournamentResult is the fitted ranking plus the audit trail
        (comparisons,
      type: object
    agents.TournamentComparisonRecord:
      description: >
        was actually used (position-bias control is only credible if the order
        is recorded).
      properties:
        confidence:
          type: number
        loser_key:
          type: string
        persisted:
          type: boolean
        reasoning:
          type: string
        shown_as_a:
          description: |
            judge for this pair (randomized per pair).
          title: >
            ShownAsA / ShownAsB are the candidate keys as physically presented
            to the
          type: string
        shown_as_b:
          type: string
        winner_key:
          type: string
      title: >
        TournamentComparisonRecord is one judged pair, with the presentation
        order that
      type: object
    agents.TournamentMerge:
      properties:
        merged_key:
          type: string
        method:
          title: |
            "embedding" | "shingle"
          type: string
        representative_key:
          type: string
        similarity:
          type: number
      title: >
        TournamentMerge records one near-dup candidate folded into a
        representative.
      type: object
    agents.TournamentRankEntry:
      properties:
        comparisons:
          format: int64
          type: integer
        key:
          type: string
        rank:
          format: int64
          type: integer
        represents:
          description: |
            (empty when it wasn't merged with anything).
          items:
            type: string
          title: >
            Represents lists the near-dup candidate keys this survivor stands in
            for
          type: array
        score:
          type: number
        strength:
          type: number
        variant_key:
          type: string
      title: |
        TournamentRankEntry is one survivor's fitted position.
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````