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

> ## Agent Instructions
> These are the DualMind developer and admin docs. The API base URL is https://api.dualmindlab.tech and the local API runs on http://localhost:5079.
> Never send POST, PUT, PATCH or DELETE requests to the production API while developing; use a local API and a development Supabase project.
> Environment variables are documented by name only. Never ask for or print secret values.
> Admin routes under /api/admin require a Supabase access token for a user whose public.users.role is admin. The PUT routes for users, models, providers and threads write every field, so send the full record; PUT /api/admin/keys/{keyId} writes only the fields you send (sending api_key replaces the key).

# Add a model

> Registers a model. `provider_name` is lowercased and must be one the API can route: `groq`, `google` or `cloudflare`. Models with any other provider are ignored by the arena. New models can take up to five minutes to appear in battles (model list cache).

<Badge color="purple" icon="shield-check" stroke>AdminOnly</Badge> <Badge color="surface" icon="key-round">Bearer token, role admin</Badge>


## OpenAPI

````yaml api-reference/openapi-admin.json POST /api/admin/models
openapi: 3.1.0
info:
  title: DualMind Admin API
  version: 1.0.0
  description: >-
    Admin routes of the DualMind API (`/api/admin/*`). Every route requires a
    Supabase access token for an account whose `public.users.role` is `admin`
    (the `AdminOnly` policy). Responses use the `{ success, data, total, page,
    pageSize, message, error }` envelope.
servers:
  - url: https://api.dualmindlab.tech
    description: Production
  - url: http://localhost:5079
    description: Local (dotnet run)
security:
  - bearerAuth: []
tags:
  - name: Dashboard
  - name: Users
  - name: AI models
  - name: Providers
  - name: API keys
  - name: Comparisons
  - name: Votes
  - name: Threads
  - name: Messages
paths:
  /api/admin/models:
    post:
      tags:
        - AI models
      summary: Add a model
      description: >-
        Registers a model. `provider_name` is lowercased and must be one the API
        can route: `groq`, `google` or `cloudflare`. Models with any other
        provider are ignored by the arena. New models can take up to five
        minutes to appear in battles (model list cache).
      operationId: adminCreateModel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model_name:
                  type: string
                  description: Exact provider model ID.
                provider_name:
                  type: string
                  enum:
                    - groq
                    - google
                    - cloudflare
                  description: Provider.
                display_name:
                  type: string
                  description: Optional display name.
                is_free:
                  type: boolean
                  default: true
                  description: Free tier.
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                    - maintenance
                  description: Defaults to `active`.
              required:
                - model_name
                - provider_name
            example:
              model_name: llama-3.3-70b-versatile
              provider_name: groq
              display_name: Llama 3.3 70B Versatile
              is_free: true
              status: active
      responses:
        '200':
          description: Created model
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/AdminModel'
        '400':
          description: Validation failed, or the database rejected the write.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, expired or invalid bearer token.
        '403':
          description: Signed in, but `public.users.role` is not `admin`.
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AdminModel:
      type: object
      properties:
        model_id:
          type: string
          format: uuid
          description: Model ID (primary key).
        model_name:
          type: string
          description: >-
            Provider model identifier. This is what the arena sends as `model`,
            `model1` or `model2`.
          example: llama-3.3-70b-versatile
        display_name:
          type:
            - string
            - 'null'
          description: Human-friendly name.
          example: Llama 3.3 70B Versatile
        provider_name:
          type: string
          description: 'Provider key, lowercased: `groq`, `google` or `cloudflare`.'
          example: groq
        is_free:
          type:
            - boolean
            - 'null'
          description: Whether the model is on a free tier.
          example: true
        status:
          type: string
          enum:
            - active
            - inactive
            - maintenance
          description: Only `active` models are offered to the arena.
          example: active
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Created at.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Updated at.
    Error:
      type: object
      properties:
        success:
          type: boolean
          description: Always `false`.
          example: false
        error:
          type: string
          description: What went wrong.
          example: 'Role must be one of: admin, user'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Supabase access token of an account with `role = 'admin'` in
        `public.users`.

````

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