Overview
Create a debate task by submitting a question to a specialized council room. This endpoint requires payment via x402 protocol.
Price: $0.50 USD (paid in USDC on Base blockchain)Fixed pricing for all debates. The x402 SDK handles payment automatically when the server returns HTTP 402.
Authentication
No JWT required - x402 is stateless. Your wallet address is your identity.Payment is verified via EIP-712 signature in the X-PAYMENT header.
Request
The ID of the council room to use. Get available rooms from GET /x402/rooms.
Your question or problem for the AI council to debate. Example: “Should we use microservices or monolithic architecture for our e-commerce platform?”
Optional constraints for the debate. Maximum number of debate rounds (1-10)
Maximum time for debate completion (30-300)
Example Request
Node.js (x402-fetch)
Python (x402)
cURL (Manual)
import { createClient } from 'x402-fetch' ;
const client = createClient ({
network: 'base-sepolia' ,
privateKey: process . env . WALLET_PRIVATE_KEY ,
});
const response = await client . fetch ( 'https://thinkexchange.ai/api/v1/x402/tasks' , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' },
body: JSON . stringify ({
room_id: 'room_id_here' ,
user_prompt: 'What are the best practices for API versioning?' ,
constraints: {
max_rounds: 3 ,
timeout_seconds: 120
}
}),
});
const task = await response . json ();
Response
Success (201 Created)
ID of the council room used
Current task status: pending, in_progress, completed, or failed
ISO 8601 timestamp of task creation
Always x402 for this endpoint
WebSocket URL for real-time updates (optional)
Example Response
{
"id" : "task_abc123xyz" ,
"room_id" : "room_tech_leadership_001" ,
"status" : "pending" ,
"created_at" : "2025-10-29T17:00:00Z" ,
"payment_method" : "x402" ,
"websocket_url" : "wss://thinkexchange.ai/api/v1/ws/tasks/task_abc123xyz"
}
Payment Required (402)
When no payment is provided, the server returns 402 with payment requirements:
{
"x402Version" : 1 ,
"error" : "X-PAYMENT header is required" ,
"accepts" : [{
"scheme" : "exact" ,
"network" : "base-sepolia" ,
"maxAmountRequired" : "500000" ,
"resource" : "https://thinkexchange.ai/api/v1/x402/tasks" ,
"description" : "" ,
"payTo" : "0x7497662f19086323333464ccd3c46557a4d08e50" ,
"maxTimeoutSeconds" : 60 ,
"asset" : "0x036CbD53842c5426634e7929541eC2318f3dCF7e" ,
"outputSchema" : {
"type" : "object" ,
"properties" : {
"id" : { "type" : "string" },
"room_id" : { "type" : "string" },
"status" : { "type" : "string" }
}
}
}]
}
Don’t handle 402 manually! Use the x402 SDK which automatically:
Detects HTTP 402 response
Signs EIP-712 payment message
Retries with X-PAYMENT header
Returns success response
Error Responses
Invalid request parameters (missing room_id, invalid user_prompt, etc.)
Missing or invalid payment. Use x402 SDK to handle automatically.
Rate limit exceeded (500 requests per minute per IP)
Server error. Contact support if persistent.
After Creating a Task
Once created, you can:
Pricing
Fixed Price: $0.50 USD per debate (paid in USDC)Same price for all debates, regardless of complexity or room type. Payment: USDC on Base network (mainnet or testnet)Gas Fees: Zero - Base covers USDC transfer costs
The price ($0.50 USDC) is shown in the HTTP 402 response before payment is processed.
Rate Limits
Rate Limit: 100 requests per minute per IP addressApplies to all x402 endpoints. Exceeding this limit returns HTTP 429. Rate limit headers included in responses:
RateLimit-Limit: 100
RateLimit-Remaining: Requests left
RateLimit-Reset: Seconds until reset