Skip to main content

DualMind Lab API

The DualMind Lab API provides programmatic access to the blind AI model comparison arena. Send prompts, manage threads, vote on responses, and access model statistics.
Base URL: https://api.dualmindlab.techAll endpoints are prefixed with /api/.

Authentication

Most endpoints require a in the Authorization header:
Authorization: Bearer <your_jwt_token>
Tokens are issued by Supabase Auth and expire after 1 hour. Use supabase.auth.refreshSession() to renew.

Quick start

1

Get your JWT token

Sign in via the DualMind frontend or use Supabase Auth directly:
import { createClient } from '@supabase/supabase-js';

const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
const { data } = await supabase.auth.signInWithPassword({
  email: 'user@example.com',
  password: 'your-password'
});
const token = data.session.access_token;
2

Create a thread

curl -X POST https://api.dualmindlab.tech/api/arena/thread/new \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "My first comparison"}'
3

Send a message

curl -X POST https://api.dualmindlab.tech/api/arena/send \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Explain quantum computing in simple terms",
    "threadId": "your-thread-id"
  }'
You’ll receive two anonymized model responses for blind comparison.
4

Vote on the best response

curl -X POST https://api.dualmindlab.tech/api/arena/vote \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "comparisonId": "comparison-uuid",
    "winner": "model_a"
  }'

Endpoint categories

Chat & Arena

Send messages in single or dual (arena) mode with blind model comparison

Threads

Create, list, update, share, and delete conversation threads

Voting & Stats

Submit votes and retrieve model leaderboard statistics

Models & Users

List available AI models and sync user profiles

Utilities

Health checks, feature flags, and text-to-speech

Admin API

Full CRUD operations for platform management

Response format

All API responses use JSON. Successful responses return the data directly. Errors follow a consistent format:
{
  "responses": [
    {
      "model": "Model A",
      "content": "Quantum computing uses qubits...",
      "latencyMs": 1234
    },
    {
      "model": "Model B",
      "content": "Think of quantum computing as...",
      "latencyMs": 987
    }
  ],
  "threadId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "isArena": true
}

Error codes

HTTP StatusError CodeDescription
400INVALID_REQUESTMissing or invalid request parameters
401UNAUTHORIZEDMissing, invalid, or expired JWT token
403FORBIDDENInsufficient permissions (admin endpoints)
404NOT_FOUNDResource does not exist
429RATE_LIMITEDToo many requests
500API_ERRORInternal server or AI provider error

Rate limits

Rate limits vary by endpoint and authentication status. Authenticated users receive higher limits than anonymous requests.
Endpoint CategoryAuthenticatedAnonymous
Chat & Arena60 req/minN/A
Threads120 req/min30 req/min (read-only)
Voting30 req/minN/A
Admin120 req/minN/A

Interactive playground

Every API endpoint page includes an interactive playground where you can test requests directly in the browser. Enter your JWT token and try the API without writing any code.

SDKs and tools

OpenAPI Spec

Download the OpenAPI 3.0 specification for code generation

MCP Server

Connect AI agents to DualMind via Model Context Protocol