Back to Blog
Engineering

Getting Started with the Consilium SDK

Saad KadriFebruary 20, 20265 min read

This is a five-minute walkthrough: install the CLI or one of the SDKs, run a debate, see the result. The unusual thing about Consilium's onboarding is that you can skip the API-key step entirely on your first try — the platform-hosted free-tier pool will handle the call. You add your own key when you're ready, not before.

Option 1 — npx (no install)

Fastest path. No global install, no config:

npx @myconsilium/cli debate "Should I use Postgres or DynamoDB for an event store?"

That runs council mode (3 rounds) against the default model lineup. If you have no provider keys configured, the resolver routes the call through the free-tier pool and the CLI prints a yellow notice telling you which model substituted in for which paid model. The debate result is the same; only the upstream API calls differ.

Option 2 — install globally

npm install -g @myconsilium/cli

consilium debate "What causes inflation?" --mode council
consilium debate "Review this architecture" --mode redteam --file diagram.png
consilium debate "Is Rust better than Go for CLIs?" --mode blind

The --file flag attaches local files as context. You can pass code, diagrams, or both — the agent factory will route image inputs through the multimodal-capable models in your council and skip them on text-only models.

Add your own key (when you're ready)

consilium config set openai_key sk-...
consilium config set anthropic_key sk-ant-...
consilium config set google_key AIza...
consilium config set moonshot_key sk-...
consilium config list

Keys are stored in ~/.consilium/config.json on your machine — not on our servers. BYOK always wins over the free-tier pool, so the moment you add a key for a provider, debates stop substituting and start using your key directly. The CLI surfaces this with no fallback notice on the next debate.

Option 3 — TypeScript SDK

npm install @myconsilium/sdk

Same protocol, programmatic API:

import { ConsiliumClient } from '@myconsilium/sdk';

const client = new ConsiliumClient({
  apiUrl: 'https://api.myconsilium.xyz',
  apiKey: process.env.CONSILIUM_API_KEY,
});

const result = await client.deliberate({
  topic: 'Should we migrate to server components?',
  mode: 'jury',
  models: ['gpt-5.4', 'claude-sonnet-4-6', 'gemini-3-flash-preview'],
});

console.log(result.verdict);
console.log(result.votes);

For real-time event handling, stream instead:

for await (const event of client.streamDeliberation({
  topic: 'Evaluate our security posture',
  mode: 'redteam',
})) {
  if (event.type === 'routing:fallback') {
    console.log('Substituted models:', event.data.resolutions);
  }
  if (event.type === 'agent:complete') {
    console.log(`${event.agentId}: ${event.content}`);
  }
}

Option 4 — Python SDK

pip install consilium
from consilium import ConsiliumClient, DeliberationMode

client = ConsiliumClient(
    api_url="https://api.myconsilium.xyz",
    api_key=os.environ["CONSILIUM_API_KEY"],
)

result = client.deliberate(
    topic="What is the most energy-efficient sorting algorithm?",
    mode=DeliberationMode.COUNCIL,
    models=["gpt-5.4", "claude-sonnet-4-6", "gemini-3-flash-preview"],
)

print(result.golden_prompt)
print(result.confidence_scores)
print(result.dissent_report)

Both SDKs expose the same five primary methods: deliberate, stream_deliberation, red_team, blind_eval, and estimate_cost. The estimate_cost call is worth knowing about — it predicts the spend for a debate before you run it, using the same token estimator the web UI uses.

What to expect on your first debate

For a council-mode debate over a moderately complex topic with three models:

  • ~45 seconds median latency — three rounds of generation plus a judge synthesis pass.
  • ~$0.05–0.10 cost if you're on BYOK with mid-tier models. The free-tier fallback path is, as the name suggests, free to the user and runs against open models on Groq or OpenRouter.
  • A structured result object with the verdict, per-model votes, confidence scores, a dissent report when the council didn't fully converge, and the full claim/challenge/rebuttal trace for audit.

Common follow-ups

  • "How do I pick which mode?" Three rules of thumb in the modes post: quick for fact-of-the-matter, council for tradeoffs, specialized modes (jury / market / redteam) when the deliverable is structured.
  • "Can I run it locally?" Yes, but the source repository is private as of April 2026. Self-host bundles ship to source-licensed customers as tarballs. Email support@myconsilium.xyz.
  • "What if a model errors mid-debate?" The orchestrator falls back to a cheaper variant via CHEAP_VARIANTSon context-too-large errors, and the circuit breaker skips a provider entirely if it's flapping. The debate completes with a partial council if one provider is down.