API Documentation

Integrate adversarial and cooperative symposium AI task forces directly into your applications, pipelines, and workflows with our REST API.

Overview

The Task Force AI API allows you to programmatically deploy AI task forces and retrieve their full reports. Trigger Strike (fast, smaller models) or Titan (deep, largest models) sessions in either Adversarial (red-team debate) or Symposium (cooperative) mode via simple REST calls. Usage is metered at per-model token rates — see Pricing for details.

REST

JSON-based API

API Key

Header authentication

v1

Current version

Authentication

All API requests require an API key passed in the X-API-Key header. Generate your API key from the Settings page after signing in.

# Include your API key in every request
X-API-Key: your_api_key_here

Quick Start

Copy and run this example to start a Task Force session. Replace your_api_key with your key from the Settings page.

STEP 1Start a session
curl -X POST https://taskforceai.net/api/v1/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{"prompt": "Your question here", "mode": "STRIKE", "structure": "ADVERSARIAL"}'
STEP 2Poll for the completed report
curl https://taskforceai.net/api/v1/report/SESSION_ID \
  -H "X-API-Key: your_api_key"
info

Sessions run asynchronously. Step 1 returns a session_id immediately. Poll Step 2 every few seconds until status is "completed". The API does not support streaming.

Base URL

https://taskforceai.net/api/v1
POST

/api/v1/run

Trigger a new Task Force session. The debate runs asynchronously in the background. Poll the report endpoint to retrieve results when complete. Rate limit: 10 requests per minute.

Request Body

{
  "prompt": "Your complex question or problem statement",
  "mode": "STRIKE",
  "structure": "ADVERSARIAL"
}

Parameters

FieldTypeRequiredDescription
promptstringYesThe problem statement or question for the task force.
modestringYes"STRIKE" (fast, smaller models) or "TITAN" (deep, largest models). Both modes consume Units based on actual token usage at per-model rates (see Pricing).
structurestringNo"ADVERSARIAL" (default, red-team debate) or "SYMPOSIUM" (cooperative execution).

Response

{
  "session_id": "uuid-of-the-session",
  "status": "initialized",
  "mode": "STRIKE",
  "units_remaining": 99
}
GET

/api/v1/report/{session_id}

Retrieve the full debate report for a completed session, including the consensus verdict and all agent outputs from every round. Rate limit: 30 requests per minute.

Path Parameters

ParameterTypeDescription
session_idstring (UUID)The session ID returned from the /run endpoint.

Response

{
  "session_id": "uuid-of-the-session",
  "status": "completed",
  "mode": "STRIKE",
  "prompt": "Your original question",
  "created_at": "2025-01-15T10:30:00Z",
  "error_message": null,
  "verdict": {
    "role": "Director",
    "content": "Final consensus verdict...",
    "model": "google/gemini-2.5-flash-lite"
  },
  "logs": [
    {
      "role": "Agent-1",
      "content": "Opening argument...",
      "model": "google/gemini-2.5-flash-lite",
      "round": 1,
      "created_at": "2025-01-15T10:30:05Z"
    }
  ]
}

Code Samples

terminalcurl

# 1. Start an Adversarial Task Force session
curl -X POST https://taskforceai.net/api/v1/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{"prompt": "Analyze the pros and cons of microservices vs monolith architecture", "mode": "TITAN", "structure": "ADVERSARIAL"}'

# 2. Or start a Cooperative Symposium session
curl -X POST https://taskforceai.net/api/v1/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{"prompt": "Execute our migration plan for microservices", "mode": "TITAN", "structure": "SYMPOSIUM"}'

# 3. Poll for the report (use the session_id from step 1 or 2)
curl https://taskforceai.net/api/v1/report/SESSION_ID \
  -H "X-API-Key: your_api_key"

codePython

import requests
import time

API_KEY = "your_api_key"
BASE_URL = "https://taskforceai.net/api/v1"
HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"}

# Start a Titan Adversarial session (red-team debate)
response = requests.post(f"{BASE_URL}/run", headers=HEADERS, json={
    "prompt": "What are the key risks of deploying LLMs in healthcare?",
    "mode": "TITAN",
    "structure": "ADVERSARIAL"
})
session_id = response.json()["session_id"]
print(f"Adversarial session started: {session_id}")

# Or start a Symposium session (cooperative execution)
# response = requests.post(f"{BASE_URL}/run", headers=HEADERS, json={
#     "prompt": "Build an implementation plan for safe LLM deployment",
#     "mode": "TITAN",
#     "structure": "SYMPOSIUM"
# })

# Poll until complete
while True:
    report = requests.get(f"{BASE_URL}/report/{session_id}", headers=HEADERS).json()
    if report["status"] == "completed":
        print("Verdict:", report["verdict"]["content"])
        break
    time.sleep(5)

javascriptJavaScript / Node.js

const API_KEY = "your_api_key";
const BASE_URL = "https://taskforceai.net/api/v1";

// Start a Strike Symposium session (cooperative mode)
const runRes = await fetch(`${BASE_URL}/run`, {
  method: "POST",
  headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    prompt: "Compare React, Vue, and Svelte for enterprise applications",
    mode: "STRIKE",
    structure: "SYMPOSIUM"  // or "ADVERSARIAL" for red-team debate
  })
});
const { session_id } = await runRes.json();

// Poll for report
const poll = async () => {
  while (true) {
    const res = await fetch(`${BASE_URL}/report/${session_id}`, {
      headers: { "X-API-Key": API_KEY }
    });
    const report = await res.json();
    if (report.status === "completed") {
      console.log("Verdict:", report.verdict.content);
      return report;
    }
    await new Promise(r => setTimeout(r, 5000));
  }
};
await poll();

Status Codes

CodeMeaningDescription
200OKRequest succeeded.
401UnauthorizedMissing or invalid API key.
402Payment RequiredInsufficient units for the requested operation.
403ForbiddenAccess denied to the requested resource.
404Not FoundSession ID does not exist.
422UnprocessableInvalid mode or structure value.
429Too Many RequestsRate limit exceeded or too many concurrent sessions.

Error Response Format

All error responses return a JSON object with a detail field describing the error.

{
  "detail": "Insufficient units."
}

Ready to Integrate?

Sign in to generate your API key and start deploying adversarial and cooperative symposium AI task forces programmatically.