GroupTink Documentation

Build on the GroupTink API, SDKs, and Codex workflows. 22 models across 10 providers, 10 consensus methods, and a native Codex plugin install flow.

Getting Started

GroupTink is a platform for multi-model AI consensus pipelines. Submit a prompt, select models and a consensus method, and get a synthesized result with confidence scoring.

Quick Start

1. Create an account and get your API key:

Authenticationbash
# Register and get a JWT token
curl -X POST https://api.consensus.unschackle.com/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "your-password"}'

# Or create an API key (after login)
curl -X POST https://api.consensus.unschackle.com/api/v1/api-keys \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-key", "scopes": ["pipelines:read", "pipelines:write"]}'

2. Create and run a pipeline:

Create Pipelinebash
curl -X POST https://api.consensus.unschackle.com/api/v1/pipelines/v1 \
  -H "Authorization: Bearer ce_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Code Review",
    "prompt": "Review this code for security issues",
    "method": "fan_out_fan_in",
    "models": ["openai/gpt-4o", "anthropic/claude-3.5-sonnet"],
    "context": "function login(user, pass) { ... }"
  }'

3. Stream results via SSE:

Stream Eventsbash
curl -N https://api.consensus.unschackle.com/api/v1/pipelines/<id>/events \
  -H "Authorization: Bearer ce_your_api_key"

Codex Plugin

Install the GroupTink Codex plugin with a single command. The installer downloads a release artifact, installs the plugin into your home directory, updates the Codex marketplace file, and preserves unrelated plugins.

Install GroupTink in Codexbash
curl -fsSL https://raw.githubusercontent.com/MisterWonderful/Consensus-Engine-Online/main/scripts/install-grouptink-codex-plugin.sh | bash

Upgrade or remove the plugin with the same installer:

Upgrade or Uninstallbash
# Upgrade
curl -fsSL https://raw.githubusercontent.com/MisterWonderful/Consensus-Engine-Online/main/scripts/install-grouptink-codex-plugin.sh | bash -s -- upgrade

# Uninstall
curl -fsSL https://raw.githubusercontent.com/MisterWonderful/Consensus-Engine-Online/main/scripts/install-grouptink-codex-plugin.sh | bash -s -- uninstall

Compatibility note: the plugin still uses CONSENSUS_ENGINE_API_KEY and CONSENSUS_ENGINE_URL for now, even though the installed plugin name is grouptink.

Authentication

Three authentication methods are supported:

JWT Tokens

Login with email/password to receive a JWT. Include it as a Bearer token. Tokens can be refreshed via POST /auth/refresh.

API Keys

API keys use the ce_ prefix and support scoped access. Create them via the dashboard or API. Use as Bearer tokens.

API Key Usagebash
curl https://api.consensus.unschackle.com/api/v1/pipelines \
  -H "Authorization: Bearer ce_your_api_key_here"

OAuth 2.0 (Machine-to-Machine)

For automated systems, use OAuth 2.0 client credentials flow. Tokens use the ceo_ prefix.

OAuth Token Requestbash
# Get an access token
curl -X POST https://api.consensus.unschackle.com/api/v1/oauth/token \
  -H "Content-Type: application/json" \
  -d '{"grant_type": "client_credentials", "client_id": "cec_...", "client_secret": "ceos_..."}'

Pipelines

Pipelines are the core abstraction. Each pipeline runs a prompt through multiple AI models using a specified consensus method, then synthesizes the results.

Pipeline Lifecycle

Pipelines progress through states: Idle → Configuring → Researching → Indexing → Building → Challenging → Mediating → Complete. Stream events via SSE to track progress in real-time.

TypeScript SDK

TypeScript SDKtypescript
import { ConsensusEngine } from "@consensus-engine/sdk";

const client = new ConsensusEngine({
  apiKey: "ce_your_api_key",
});

const pipeline = await client.createPipeline({
  name: "Security Review",
  prompt: "Review this code for vulnerabilities",
  method: "fan_out_fan_in",
  models: ["openai/gpt-4o", "anthropic/claude-3.5-sonnet"],
});

// Stream events
for await (const event of client.streamEvents(pipeline.pipeline_id)) {
  console.log(event.event, event.data);
}

// Get final result
const result = await client.getPipelineResult(pipeline.pipeline_id);

Python SDK

Python SDKpython
from consensus_engine import ConsensusEngine, PipelineCreateParams

client = ConsensusEngine(api_key="ce_your_api_key")

pipeline = client.create_pipeline(PipelineCreateParams(
    name="Security Review",
    prompt="Review this code for vulnerabilities",
    method="fan_out_fan_in",
    models=["openai/gpt-4o", "anthropic/claude-3.5-sonnet"],
))

# Stream events
for event in client.stream_events(pipeline.pipeline_id):
    print(event.event, event.data)

# Get final result
result = client.get_pipeline_result(pipeline.pipeline_id)

Constraints

Optionally set constraints on cost, duration, agents, tokens, and minimum confidence:

Pipeline Constraintsjson
{
  "constraints": {
    "max_total_cost": 1.50,
    "max_duration_secs": 300,
    "max_agents": 5,
    "max_total_tokens": 100000,
    "min_confidence_floor": 0.7
  }
}

Consensus Methods

10 consensus methods are available, each suited to different use cases:

Fan-Out Fan-In

fan_out_fan_in

Parallel model execution with synthesis. Best for general consensus.

Debate

debate

Models argue opposing positions. Best for decision-making.

Sequential Refinement

sequential_refinement

Each model refines the previous output. Best for iterative improvement.

MoE Routing

moe_routing

Route to specialist models by expertise. Best for multi-domain tasks.

Weighted Voting

weighted_voting

Models vote with confidence weights. Best for classification.

Delphi

delphi

Multiple rounds toward convergence. Best for complex analysis.

Generator-Verifier

generator_verifier

One generates, others verify. Best for code generation.

Tree of Thoughts

tree_of_thoughts

Branching exploration with pruning. Best for creative problems.

Swarm Simulation

swarm_simulation

Agents with personas collaborate. Best for comprehensive review.

Pipeline Template

pipeline_template

Custom multi-step pipelines. Best for complex workflows.

Code Reviews

Submit code for multi-model review via the API or GitHub integration.

Programmatic Review (API)

Submit Code Reviewbash
curl -X POST https://api.consensus.unschackle.com/api/v1/reviews \
  -H "Authorization: Bearer ce_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "fn main() { let x = vec![1,2,3]; println!(\"{:?}\", x); }",
    "language": "rust",
    "method": "fan_out_fan_in",
    "prompt": "Review for idiomatic Rust and performance"
  }'

GitHub Integration

Install the GitHub App to automatically run consensus reviews on PRs. Reviews are triggered on PR open/update and results are posted as PR comments.

Manual reviews can be triggered via POST /api/v1/github/reviews with an installation ID, repo, and PR number.

Models & Providers

22 curated models across 10 providers. Each model includes pricing, context windows, capabilities, and benchmarks.

OpenAI
Anthropic
Google
DeepSeek
Mistral
xAI
Perplexity
Moonshot
MiniMax
Zhipu
Models APIbash
# List all available models
curl https://api.consensus.unschackle.com/api/v1/models \
  -H "Authorization: Bearer ce_your_api_key"

# Get recommendations for your task
curl -X POST https://api.consensus.unschackle.com/api/v1/recommendations \
  -H "Authorization: Bearer ce_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"task": "code_review", "budget": 1.00}'

SDKs

Compatibility note: the published SDK package names still use the existing @consensus-engine/sdk and consensus-engine identifiers while the product brand is GroupTink.

TypeScript / JavaScript

Installbash
npm install @consensus-engine/sdk
TypeScript SDKtypescript
import { ConsensusEngine } from "@consensus-engine/sdk";

const client = new ConsensusEngine({ apiKey: "ce_..." });

// Create pipeline
const pipeline = await client.createPipeline({ ... });

// List pipelines
const pipelines = await client.listPipelines();

// Get result
const result = await client.getPipelineResult(id);

// Stream SSE events
for await (const event of client.streamEvents(id)) { ... }

// Cancel
await client.cancelPipeline(id);

Python

Installbash
pip install consensus-engine
Python SDKpython
from consensus_engine import ConsensusEngine

client = ConsensusEngine(api_key="ce_...")

# Sync client
pipeline = client.create_pipeline(...)
result = client.get_pipeline_result(pipeline.pipeline_id)

# SSE streaming
for event in client.stream_events(pipeline.pipeline_id):
    print(event)

# Async client
from consensus_engine import AsyncConsensusEngine

async with AsyncConsensusEngine(api_key="ce_...") as client:
    pipeline = await client.create_pipeline(...)

Billing & Credits

GroupTink uses a credit-based billing system. Each pipeline run consumes credits based on the models used, token count, and method complexity.

Credit Packages

Starter

100

credits

$9.99

Pro

500

credits

$39.99

Team

2,000

credits

$129.99

Enterprise

10,000

credits

$499.99

Billing APIbash
# Check balance
curl https://api.consensus.unschackle.com/api/v1/credits/balance \
  -H "Authorization: Bearer ce_your_api_key"

# Purchase credits
curl -X POST https://api.consensus.unschackle.com/api/v1/credits/purchase \
  -H "Authorization: Bearer ce_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"package_id": "pro_500"}'

# Export transaction history
curl https://api.consensus.unschackle.com/api/v1/credits/export \
  -H "Authorization: Bearer ce_your_api_key" -o transactions.csv

API Reference

The full API is documented in OpenAPI 3.1 format. All endpoints are under /api/v1/.

Base URLs

Productionhttps://api.consensus.unschackle.com/api/v1
Developmenthttp://localhost:4000/api/v1

Endpoint Groups

Auth

POST /auth/register, /auth/login, /auth/refresh, /auth/logout, GET /auth/me

Pipelines

POST /pipelines/v1, GET /pipelines, /pipelines/:id/status, /pipelines/:id/result, /pipelines/:id/cost, /pipelines/:id/events (SSE)

Reviews

POST /reviews (programmatic), POST /github/reviews (GitHub)

Models

GET /models, POST /recommendations

Credits

GET /credits/balance, /credits/history, /credits/packages, /credits/export, POST /credits/purchase

OAuth

POST /oauth/token, GET /oauth/clients, POST /oauth/clients

API Keys

GET /api-keys, POST /api-keys, DELETE /api-keys/:id

Admin

GET /admin/users, /admin/settings, /admin/providers, /admin/analytics/*

The complete OpenAPI 3.1 specification is available at /contracts/openapi.yaml in the project repository for use with tools like Redoc, Swagger UI, or code generators.