Consensus guide

Use disagreement as product data.

Ask independent models, measure agreement, preserve dissent, and synthesize a traceable result.

01 / Independence

Send one bounded, replay-safe request.

OpenWaya authenticates the caller, resolves the administrator-managed model set, reserves the maximum exposure, and delegates the independent model evaluation to DruxAI. The public request never accepts an organization or billing identity from the caller.

  • Keep OPENWAYA_API_KEY only in a trusted server environment.
  • Use one configured modelSetId or two-to-five explicit models, never both.
  • Reuse the same idempotency key only when retrying the identical request.
cURL · complete request
idempotency_key="consensus-$(openssl rand -hex 16)"

curl https://api.openwaya.africa/v1/consensus \
  --fail-with-body \
  -H "Authorization: Bearer $OPENWAYA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $idempotency_key" \
  -d '{"contractVersion":"1.0","modelSetId":"cset_frontier_balanced","prompt":"Compare the evidence and identify any material disagreement.","deepSynthesis":false,"webGrounding":false}'

02 / Agreement

Read the evidence without guessing the score.

The response keeps every requested model outcome beside agreement, dissent, synthesis, usage, and the settled OpenWaya charge. Drux scores are normalized only when their upstream scale is documented; otherwise score is null and scoreScale is provider_native_unmapped.

Node.js 20+ · request and inspect evidence
const apiKey = process.env.OPENWAYA_API_KEY;
if (!apiKey) throw new Error("OPENWAYA_API_KEY is required");

const idempotencyKey = "consensus-" + crypto.randomUUID();
const response = await fetch("https://api.openwaya.africa/v1/consensus", {
  method: "POST",
  headers: {
    authorization: "Bearer " + apiKey,
    "content-type": "application/json",
    "idempotency-key": idempotencyKey,
  },
  body: JSON.stringify({
    contractVersion: "1.0",
    idempotencyKey,
    modelSetId: "cset_frontier_balanced",
    prompt: "Compare the evidence and identify any material disagreement.",
    deepSynthesis: false,
    webGrounding: false,
  }),
});

const result = await response.json();
if (!response.ok) throw new Error(result.code + " (" + result.requestId + ")");
console.log({
  requestId: result.id,
  status: result.status,
  agreement: result.consensus?.agreement ?? [],
  dissent: result.consensus?.dissent ?? [],
  scoreScale: result.consensus?.scoreScale ?? null,
  models: result.results.map(({ model, status }) => ({ model, status })),
  charge: result.billing.actualCharge,
});

03 / Synthesis

Handle degradation without inventing consensus.

A degraded response still includes one explicit outcome for every requested model. Failed or timed-out children contain a safe error code and no fabricated content. OpenWaya stores metering and route evidence by default, not the prompt, child answers, or synthesis.

  • Treat complete and degraded as distinct operational states.
  • Keep minority positions visible when evidence remains unresolved.
  • Use the returned request ID for safe log and support correlation.
Python 3 · standard library
import json
import os
import uuid
from urllib import error, request

key = os.environ["OPENWAYA_API_KEY"]
idempotency_key = "consensus-" + str(uuid.uuid4())
body = json.dumps({
    "contractVersion": "1.0",
    "idempotencyKey": idempotency_key,
    "modelSetId": "cset_frontier_balanced",
    "prompt": "Compare the evidence and identify any material disagreement.",
    "deepSynthesis": False,
    "webGrounding": False,
}).encode()
call = request.Request(
    "https://api.openwaya.africa/v1/consensus",
    data=body,
    method="POST",
    headers={
        "Authorization": "Bearer " + key,
        "Content-Type": "application/json",
        "Idempotency-Key": idempotency_key,
    },
)

try:
    with request.urlopen(call, timeout=90) as response:
        result = json.load(response)
except error.HTTPError as failure:
    problem = json.load(failure)
    raise RuntimeError(problem["code"] + " (" + problem["requestId"] + ")") from failure

print(json.dumps({
    "requestId": result["id"],
    "status": result["status"],
    "dissent": (result.get("consensus") or {}).get("dissent", []),
    "modelStatuses": [
        {"model": child["model"], "status": child["status"]}
        for child in result["results"]
    ],
    "charge": result["billing"]["actualCharge"],
}, indent=2))

Build against the contract

Move from guidance to implementation.