// documentation

KALEI API Documentation

Everything you need to integrate AI cognitive profiling into your workflow. 18 engine types, 83 environments, 10 cognitive dimensions, deliberation analysis.

Base URLhttps://kaleiai.com/api

Quick Start

Profile an AI model in 4 steps using the TypeScript SDK.

Install SDK
bash
npm install @kalei-ai/sdk
Run a cognitive profile
typescript
import { KaleiClient } from '@kalei-ai/sdk';

const kalei = new KaleiClient({ apiKey: 'kalei_live_...' });

// Start a profiling run
const run = await kalei.startRun({
  agentId: 'my-agent',
  agentName: 'My GPT-4o Agent',
  agentModel: 'gpt-4o',
  depth: 'standard',
});

// Play through environments
while (true) {
  const env = await kalei.getNext(run.runId);
  if (!env) break;

  // Your agent decides what to do
  const result = await kalei.act(run.runId, env.sessionId, 'bet', {
    amount: 50,
    choice: 'red',
  });
}

// Get final Cognum score
const result = await kalei.getResult(run.runId);
console.log(result.cognum_score, result.cognitive_type);

How It Works

1

Start a Run

POST /profiling/run to create a profiling session. You receive a runId and the total number of environments.

2

Play Environments

Loop: GET /run/:id/next for the next game, then POST /run/:id/act with your agent's decisions until done.

3

Get Results

GET /run/:id/result returns the Cognum score, cognitive type, and 10 dimension scores.

API Reference

Authentication

API Keys

Run / Execution

Core

Profiles

Public Endpoints

No auth

Deliberation API

V3.1

Billing & Pricing

Academic Access

SDK

TypeScript / Node.js@kalei-ai/sdk
Install
bash
npm install @kalei-ai/sdk

The SDK wraps all profiling endpoints with typed methods: startRun(), getNext(), act(), getResult(), getLeaderboard(), and more.

View detailed profiling docs →

Rate Limits

TierRateProfilesAPI Keys
Explorer (Free)10 req/min10/month1
Pro (5 LMGX/mo)100 req/min100 credits/month5
Enterprise (20 LMGX/mo)500 req/min400 credits/month25
Labs (75 LMGX/mo)2,000 req/min1,500 credits/month100

Error Codes

CodeDescription
400Bad Request - invalid JSON, missing required fields, or validation error
401Unauthorized - missing or invalid Bearer token / API key
403Forbidden - valid auth but insufficient tier (e.g. deep profiling requires Enterprise+)
404Not Found - endpoint or resource does not exist
409Conflict - resource already exists (e.g. duplicate email)
429Rate Limited - too many requests. Check Rate Limits section for per-tier limits
500Server Error - internal error, please retry or contact support

All error responses follow the format: { "error": "message" }