ai.council

Ask several frontier models the same question and get one synthesized answer. Choose a preset council — fast (3 quick models), balanced (3 strong models with a peer-refine round), or deep (5 models plus refine) — or supply your own set of 2–8 models. A chairman model merges the responses into a single consensus with a confidence score and any points of dissent, and each member’s individual answer is returned alongside. Price scales with the council size and answer length, and is quoted up front in the 402. Models auto-resolve to their latest available version; any unavailable model simply drops out (at least 2 are needed).

price
variable — from $0.0120 USDC, computed per request and quoted in the 402 before you pay (see Pricing below)
method
POST/api/ai/council
payment
x402 v2 · USDC on Base (EIP-3009) or Solana (SPL transfer)
auth
None. Sign the payment, retry with PAYMENT-SIGNATURE.

Overview

ai.council asks the same question to several frontier models at once, optionally lets them refine against each other, then has a chairman model synthesize one consensus answer with a confidence score and any points of dissent — and returns each model’s individual answer alongside.

Pick a preset council — fast (3 quick models, single pass), balanced (3 strong models with a peer-refine round), or deep (5 models plus refine) — or pass your own set of 2–8 models. Models route through a single gateway and auto-resolve to their latest available version, so the council stays current; if a model is temporarily unavailable it simply drops out (at least two are required).

Pricing is dynamic: because every model and answer length costs differently, the exact price is computed per request and quoted in the 402 challenge before you pay. For the live council line-ups, the full list of models you can pass, and current example prices, call GET /api/ai/council/menu (free).

Use cases

Parameters

NameTypeDescription
promptrequiredstringThe question to put to the council.
min 1 chars · max 12000 chars
modestringPreset council. Default balanced. Ignored if `models` is given.
one of: fast | balanced | deep
modelsarrayCustom council of 2–8 gateway model ids, e.g. ["openai/gpt-5","anthropic/claude-opus","google/gemini-3-pro"] (overrides `mode`). Full selectable list + live prices: GET /api/ai/council/menu.
maxTokensintegerMax output tokens per model. Default 640.
min 128 · max 4096

Code samples

cURLbash
# 1. Probe the endpoint with no auth — receive 402 with PaymentRequirements
curl -sS -X POST 'https://2s.io/api/ai/council' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"example","mode":"fast","models":["example"],"maxTokens":128}'

# 2. Sign the EIP-3009 transferWithAuthorization for the advertised price +
#    payTo from the 402 envelope, then retry with PAYMENT-SIGNATURE:
curl -sS -X POST 'https://2s.io/api/ai/council' \
  -H 'Content-Type: application/json' \
  -H 'PAYMENT-SIGNATURE: <base64-json-payload>' \
  -d '{"prompt":"example","mode":"fast","models":["example"],"maxTokens":128}'

# Or just use the canonical runner — it handles the whole loop:
#   EVM_PRIVATE_KEY=0x... node --env-file=.env.local \
#     --experimental-strip-types scripts/x402-pay.ts \
#     'https://2s.io/api/ai/council'
TypeScript / Node — @2sio/sdktypescript
import { TwoS } from '@2sio/sdk'

const client = new TwoS({
  privateKey: process.env.EVM_PRIVATE_KEY as `0x${string}`,
})

const result = await client.ai.council({
  "prompt": "example",
  "mode": "fast",
  "models": [
    "example"
  ],
  "maxTokens": 128
})

console.log('endpoint:', result.endpoint)
console.log('cost:', result.costUsd, 'USDC')
console.log('tx:', result.settlement?.txHash)
console.log('data:', result.data)
Python — 2siopython
import os
from twosio import TwoS

client = TwoS(private_key=os.environ["EVM_PRIVATE_KEY"])

result = client.ai.council(prompt="example", mode="fast", models=["example"], maxTokens=128)

print("endpoint:", result.endpoint)
print("cost:", result.cost_usd, "USDC")
print("tx:", (result.settlement or {}).get("tx_hash"))
print("data:", result.data)
MCP — Claude Desktop / AgentKit / any MCP hostjson
// 1. Add @2sio/mcp to your MCP host config (Claude Desktop example below).
//    EVM_PRIVATE_KEY funds x402 payments per call.

// claude_desktop_config.json
{
  "mcpServers": {
    "2sio": {
      "command": "npx",
      "args": ["-y", "@2sio/mcp"],
      "env": { "EVM_PRIVATE_KEY": "0x..." }
    }
  }
}

// 2. Once the server is running, agents call this tool via standard MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ai.council",
    "arguments": {
      "prompt": "example",
      "mode": "fast",
      "models": [
        "example"
      ],
      "maxTokens": 128
    }
  }
}

Response

FieldTypeDescription
okboolean
one of: true
itemsarray
totalintegerTotal matching rows upstream; null when unknown.
sourceobject
metaobject
Example response datajson
{
  "ok": true,
  "items": [
    {
      "consensus": "example",
      "confidence": 1,
      "agreement": "example",
      "dissent": [
        "example"
      ],
      "models": [
        {
          "model": "example",
          "answered": false,
          "answer": "example"
        }
      ]
    }
  ],
  "total": 1,
  "source": {
    "provider": "example",
    "url": "example",
    "license": "example"
  },
  "meta": {
    "mode": "example",
    "chairman": "example",
    "modelCount": 1,
    "answered": 1
  }
}

FAQ

How much does ai.council cost?
Pricing is dynamic — it scales with the size of the council and the max output tokens, and the exact amount is quoted in the 402 challenge before you pay. As a rough guide at the default answer length, fast ≈ $0.09, balanced ≈ $0.26, and deep ≈ $0.36 per call; raising maxTokens or building a large custom council costs more (e.g. deep at 2048 tokens ≈ $1.00). For live, current prices across modes and token sizes, call GET /api/ai/council/menu.
Which models can I use, and how do I pass them?
Use a preset via "mode" (fast, balanced, or deep), or pass your own council in "models" — an array of 2–8 gateway model ids (for example anthropic/claude-opus, openai/gpt-5, google/gemini-3-pro, xai/grok, deepseek, mistral). Presets resolve to each provider’s latest available version automatically. The complete, current list of selectable model ids and the resolved preset line-ups are returned by GET /api/ai/council/menu.
What does ai.council return?
A single synthesized consensus answer, a 0–1 confidence score (high when the council agrees), a one-line note on the agreement, an array of dissenting points, and each council member with its own individual answer.
Do I need an API key to use the council API?
No. ai.council is x402-native — there is no signup and no API key. Your client makes the call, receives a 402 with payment requirements, signs a USDC payment, and retries. Funds come from a wallet you control.
How much does the council API cost?
Pricing is dynamic: the exact amount is computed per request and quoted in the 402 challenge before you pay (from $0.0120 USDC). There are no monthly fees, seats, or minimums — you pay only for the calls you make.
Which networks and tokens are supported?
USDC on Base (via EIP-3009 transferWithAuthorization) or Solana (SPL transfer), using the open x402 payment protocol.
How do I call ai.council from an AI agent or MCP host?
Use @2sio/sdk (TypeScript), 2sio (Python), or the @2sio/mcp server for any MCP host — each handles the probe → sign → retry loop for you. See the code samples on this page.

Discovery

Related: llm consensus api · multi model ai api · ai council api · mixture of agents api · model ensemble api · multi-llm consensus · x402 ai api · frontier model consensus · council api · council api for ai agents · council api no api key · pay per call council api · ai api