Quickstart

Install one SDK, score one interaction, and see a JIS in under 10 minutes.

Five-minute integration. Python and TypeScript side by side. cURL last, for wire-level verification.

What this is

The fastest path from zero to your first Judgment Independence Score. You will install an SDK, set one environment variable, and wrap one AI-assisted decision.

When to use

Any time you integrate a new service, or when onboarding a new engineer to COHESION.

1. Get an API key

Create an organization and generate a key at the dashboard. Keys look like ck_live_<26-char-Crockford-base32>. Store in COHESION_API_KEY. Do not commit.

See authentication for rotation and key-handling details.

2. Install the SDK

Python

pip install cohesion-sdk

Requires Python 3.11 or newer.

TypeScript / Node

npm install @cohesionauth/sdk

Requires Node.js 20 or newer.

3. Score one interaction

Python

from cohesion import Client

client = Client(api_key="ck_live_...your_key...")

response = client.score(
    session_id="sess-001",
    operator_id="analyst-42",
    domain="financial",
    interaction={
        "ai_recommendation_presented": True,
        "time_to_decision_ms": 1800,
        "decision": "modified",
        "modification_extent": 0.3,
        "ai_available": True,
        "scenario_type": "standard",
        "outcome_correct": None,
        "hover_events": 2,
        "scroll_depth": 0.7,
        "alternative_views_checked": 1,
    },
)

print(response.jis, response.band)

TypeScript

import { Cohesion } from "@cohesionauth/sdk";

const client = new Cohesion({ apiKey: process.env.COHESION_API_KEY! });

const result = await client.score({
  session_id: "sess-001",
  operator_id: "analyst-42",
  domain: "financial",
  interaction: {
    ai_recommendation_presented: true,
    time_to_decision_ms: 1800,
    decision: "modified",
    modification_extent: 0.3,
    ai_available: true,
    scenario_type: "standard",
    outcome_correct: null,
    hover_events: 2,
    scroll_depth: 0.7,
    alternative_views_checked: 1,
  },
});

console.log(`JIS ${result.jis} (${result.band})`);

cURL

curl -X POST https://api.cohesionauth.com/v1/score \
  -H "X-API-Key: $COHESION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "sess-001",
    "operator_id": "analyst-42",
    "domain": "financial",
    "interaction": {
      "ai_recommendation_presented": true,
      "time_to_decision_ms": 1800,
      "decision": "modified",
      "modification_extent": 0.3,
      "ai_available": true,
      "scenario_type": "standard",
      "outcome_correct": null,
      "hover_events": 2,
      "scroll_depth": 0.7,
      "alternative_views_checked": 1
    }
  }'

4. Try it in the browser

Paste the same payload into the interactive playground to explore responses without writing code.

Errors you might see

StatusMeaningFix
401Bad or missing X-API-KeyCheck env var, confirm key is active in dashboard
422Validation error (bad enum, out-of-range number)Check error catalog
429Rate limited (per-IP or per-key)Read rate limits, apply exponential backoff

Next step

Pick a guide based on what you want to measure: