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

> ## Agent Instructions
> DualMind Arena API base URL: https://api.dualmindlab.tech. Public endpoints only; admin routes are not part of this API.
> Authenticate with the access token from an Arena session (a Supabase JWT) as `Authorization: Bearer <token>`. There are no API keys yet; never invent one.
> For battles call POST /api/arena/dualchat, then vote with POST /api/arena/model-vote using the returned comparisonId. Keep model names hidden from voters until they vote.
> GET /api/arena/model-stats (leaderboard) and GET /health need no token.

# Submit a vote

> Vote on a battle. Each signed-in user can vote once per comparison. Voting marks the comparison as revealed.

| `voteChoice` | Meaning |
| :- | :- |
| `left` | `agent1` gave the better answer |
| `right` | `agent2` gave the better answer |
| `tie` | Both were good |
| `both-bad` | Neither was helpful |

<Warning>
  Votes are final: each user can vote once per `comparisonId`. A second vote is rejected with `VOTE_ERROR`.
</Warning>


## OpenAPI

````yaml POST /api/arena/model-vote
openapi: 3.1.0
info:
  title: DualMind Arena API
  version: 1.0.0
  description: >-
    The REST API behind DualMind Arena: blind battles, votes, the leaderboard,
    models and threads.
  contact:
    name: DualMind Labs
    email: support@dualmindlab.tech
    url: https://dualmindlab.tech
servers:
  - url: https://api.dualmindlab.tech
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Arena
    description: Battles and chat.
  - name: Voting
    description: Votes and the leaderboard.
  - name: Models
    description: Available models.
  - name: Threads
    description: Saved conversations and sharing.
  - name: Utilities
    description: Health and feature flags.
paths:
  /api/arena/model-vote:
    post:
      tags:
        - Voting
      summary: Submit a vote
      description: >-
        Vote on a battle. Each signed-in user can vote once per comparison.
        Voting marks the comparison as revealed.
      operationId: submitVote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoteRequest'
            example:
              comparisonId: 3f6c1a2b-9d4e-4f7a-8b1c-0e2d3f4a5b6c
              voteChoice: left
              voteDurationMs: 8200
      responses:
        '200':
          description: Vote recorded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                success: true
                message: Vote recorded successfully
        '400':
          description: Missing `comparisonId` or `voteChoice`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: ComparisonId is required
                code: INVALID_REQUEST
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          description: >-
            The vote could not be recorded, e.g. unknown comparison or you
            already voted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: Comparison not found
                code: VOTE_ERROR
      security:
        - bearerAuth: []
components:
  schemas:
    VoteRequest:
      type: object
      required:
        - comparisonId
        - voteChoice
      properties:
        comparisonId:
          type: string
          format: uuid
          description: The `comparisonId` returned by `POST /api/arena/dualchat`.
        voteChoice:
          type: string
          enum:
            - left
            - right
            - tie
            - both-bad
          description: >-
            `left` = `agent1` wins, `right` = `agent2` wins, `tie` = both good,
            `both-bad` = neither was helpful.
        voteDurationMs:
          type: integer
          minimum: 0
          description: 'Optional: how long the user took to decide, in milliseconds.'
    Success:
      type: object
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
    Error:
      type: object
      description: >-
        Error envelope used by the threads, voting, models and settings
        endpoints.
      properties:
        success:
          type: boolean
          const: false
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: >-
            Machine-readable code, e.g. `INVALID_REQUEST`, `NOT_FOUND`,
            `FORBIDDEN`, `UNAUTHORIZED`, `VOTE_ERROR`.
  responses:
    Unauthorized:
      description: >-
        Missing, invalid or expired token. The body is empty; the
        `WWW-Authenticate` header explains why.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The access token from your DualMind Arena session (a Supabase JWT). See
        Authentication.

````

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