Integration Guide

Integrate Kai into your educational technology stack

Published

November 20, 2025

Overview

This guide provides comprehensive instructions for integrating Kai the AI with various platforms, services, and custom applications. Whether you’re connecting to an LMS, building custom workflows, or creating third-party applications, this guide has you covered.

Learning Management Systems

Canvas Integration

Canvas is one of the most popular LMS platforms. Kai integrates seamlessly via LTI 1.3 or API.

Canvas API Integration

Use when: You need programmatic access or LTI isn’t available

Setup:

  1. Generate Canvas API Token:

    Canvas → Account → Settings → + New Access Token
    Purpose: Kai Integration
    Expires: [Choose appropriate expiration]
  2. Configure in Kai:

    Kai Dashboard → Settings → Integrations → Canvas
    Canvas URL: https://your-institution.instructure.com
    API Token: [paste token]
    Test Connection → Save

Example API Usage:

import requests

# Fetch Canvas courses
canvas_response = requests.get(
    "https://your-institution.instructure.com/api/v1/courses",
    headers={"Authorization": f"Bearer {CANVAS_TOKEN}"}
)

# Create courses in Kai
for course in canvas_response.json():
    kai_response = requests.post(
        "https://chi2api.com/v1/courses",
        headers={"Authorization": f"Bearer {KAI_API_KEY}"},
        json={
            "name": course["name"],
            "code": course["course_code"],
            "lms_integration": {
                "platform": "canvas",
                "course_id": str(course["id"])
            }
        }
    )
# Get grades from Kai
kai_grades = requests.get(
    f"https://chi2api.com/v1/courses/{course_id}/grades",
    headers={"Authorization": f"Bearer {KAI_API_KEY}"}
).json()

# Submit to Canvas
for grade in kai_grades["grades"]:
    canvas_response = requests.put(
        f"https://your-institution.instructure.com/api/v1/courses/{canvas_course_id}"
        f"/assignments/{assignment_id}/submissions/{student_id}",
        headers={"Authorization": f"Bearer {CANVAS_TOKEN}"},
        json={
            "submission": {
                "posted_grade": grade["score"]
            }
        }
    )

Blackboard Integration

Blackboard integration uses the Building Block architecture.

Installation:

  1. Download Building Block:

    Kai Dashboard → Settings → Integrations → Blackboard
    → Download Building Block
  2. Install in Blackboard:

    System Admin → Building Blocks → Installed Tools
    → Upload Building Blocks → Choose File
    → Select Kai .war file → Submit
  3. Configure:

    Find "Kai the AI" in list → Settings
    API Endpoint: https://chi2api.com/v1
    Institution Code: [from Kai dashboard]
    API Key: [from Kai dashboard]
    → Submit
  4. Make Available:

    Set Availability to "Available" → Submit

Adding to Courses:

Course → Content → Build Content → Kai the AI
Select feature: Feedback, Quiz, or Grading
Configure settings → Submit

Moodle Integration

Moodle integration uses a local plugin.

Installation:

  1. Download Plugin:

    Kai Dashboard → Settings → Integrations → Moodle
    → Download Plugin (.zip)
  2. Install via UI:

    Site Administration → Plugins → Install plugins
    → Upload plugin → Choose file → Upload
    → Install plugin from ZIP file
  3. Or Manual Installation:

    cd /path/to/moodle
    unzip kai-moodle-plugin.zip -d local/
  4. Update Database:

    Site Administration → Notifications
    → Upgrade Moodle database now
  5. Configure:

    Site Administration → Plugins → Local plugins → Kai
    API Key: [from Kai dashboard]
    Enable features: [select desired features]
    → Save changes

Google Classroom Integration

OAuth-based integration for seamless Google Workspace integration.

Setup:

  1. In Kai Dashboard:

    Settings → Integrations → Google Classroom → Connect
  2. Authenticate:

    Sign in with Google Workspace admin account
  3. Grant Permissions:

    • View courses and rosters
    • Create and grade assignments
    • Post announcements
  4. Select Classes:

    Choose which Google Classroom classes to sync
    → Save

Features:

  • Automatic roster sync
  • Assignment creation from Kai
  • Grade synchronization
  • Feedback via Google Classroom stream

Custom Integrations

Webhooks

Receive real-time notifications when events occur in Kai.

Setting Up Webhooks

1. Create Webhook Endpoint

Your endpoint must: - Accept POST requests - Return 200 OK within 5 seconds - Verify webhook signature

Example Endpoint (Python/Flask):

from flask import Flask, request, jsonify
import hmac
import hashlib

app = Flask(__name__)
WEBHOOK_SECRET = "your_webhook_secret"

@app.route('/kai-webhook', methods=['POST'])
def kai_webhook():
    # Verify signature
    signature = request.headers.get('X-Kai-Signature')
    payload = request.data

    expected_signature = hmac.new(
        WEBHOOK_SECRET.encode(),
        payload,
        hashlib.sha256
    ).hexdigest()

    if not hmac.compare_digest(signature, expected_signature):
        return jsonify({"error": "Invalid signature"}), 401

    # Process event
    event = request.json
    event_type = event['type']

    if event_type == 'grading.completed':
        handle_grading_completed(event['data'])
    elif event_type == 'feedback.received':
        handle_feedback_received(event['data'])

    return jsonify({"status": "received"}), 200

def handle_grading_completed(data):
    grade_id = data['grade_id']
    score = data['score']
    # Your custom logic here
    print(f"Grade {grade_id} completed with score {score}")

def handle_feedback_received(data):
    request_id = data['request_id']
    response_count = data['response_count']
    # Your custom logic here
    print(f"Feedback request {request_id} received {response_count} responses")

2. Register Webhook

curl -X POST https://chi2api.com/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-domain.com/kai-webhook",
    "events": [
      "grading.completed",
      "feedback.received",
      "quiz.submitted"
    ],
    "secret": "your_webhook_secret"
  }'

Available Events

Event Triggered When Payload Includes
grading.completed Assignment graded grade_id, score, feedback
feedback.received Student submits feedback request_id, student_id, response
feedback.request_closed Feedback window closes request_id, response_count, analysis
quiz.submitted Student submits quiz quiz_id, student_id, score
course.enrollment_added Student enrolls course_id, student_id
course.enrollment_removed Student unenrolls course_id, student_id

Webhook Payload Structure

{
  "id": "evt_abc123",
  "type": "grading.completed",
  "created": "2024-01-15T14:30:00Z",
  "data": {
    "grade_id": "grd_xyz789",
    "assignment_id": "assign_123",
    "student_id": "student_456",
    "score": 87,
    "feedback": "Excellent work...",
    "confidence": 0.92
  },
  "account_id": "acc_abc",
  "api_version": "v1"
}

REST API Integration

Build custom applications using Kai’s REST API.

Complete Integration Example

Scenario: Custom dashboard showing real-time class engagement

import requests
from datetime import datetime, timedelta

class KaiIntegration:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://chi2api.com/v1"
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        }

    def get_courses(self):
        """Fetch all active courses"""
        response = requests.get(
            f"{self.base_url}/courses",
            headers=self.headers,
            params={"status": "active"}
        )
        response.raise_for_status()
        return response.json()["courses"]

    def request_feedback(self, course_id):
        """Request feedback from students"""
        response = requests.post(
            f"{self.base_url}/courses/{course_id}/feedback/request",
            headers=self.headers,
            json={
                "response_window_minutes": 2,
                "anonymous": True
            }
        )
        response.raise_for_status()
        return response.json()

    def get_feedback_results(self, course_id, request_id):
        """Get feedback analysis"""
        response = requests.get(
            f"{self.base_url}/courses/{course_id}/feedback/{request_id}",
            headers=self.headers
        )
        response.raise_for_status()
        return response.json()

    def get_course_analytics(self, course_id, days=7):
        """Get course analytics for past N days"""
        end_date = datetime.now()
        start_date = end_date - timedelta(days=days)

        response = requests.get(
            f"{self.base_url}/analytics/courses/{course_id}",
            headers=self.headers,
            params={
                "start_date": start_date.isoformat(),
                "end_date": end_date.isoformat()
            }
        )
        response.raise_for_status()
        return response.json()

# Usage
kai = KaiIntegration("kai_live_...")

# Get all courses
courses = kai.get_courses()
for course in courses:
    print(f"Course: {course['name']}")

    # Get analytics
    analytics = kai.get_course_analytics(course['course_id'])
    print(f"  Engagement: {analytics['engagement']['avg_feedback_response_rate']:.1%}")
    print(f"  Avg Quiz Score: {analytics['performance']['avg_quiz_score']:.1f}")
const axios = require('axios');

class KaiIntegration {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseURL = 'https://chi2api.com/v1';
    this.client = axios.create({
      baseURL: this.baseURL,
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
      }
    });
  }

  async getCourses() {
    const response = await this.client.get('/courses', {
      params: { status: 'active' }
    });
    return response.data.courses;
  }

  async requestFeedback(courseId) {
    const response = await this.client.post(
      `/courses/${courseId}/feedback/request`,
      {
        response_window_minutes: 2,
        anonymous: true
      }
    );
    return response.data;
  }

  async getFeedbackResults(courseId, requestId) {
    const response = await this.client.get(
      `/courses/${courseId}/feedback/${requestId}`
    );
    return response.data;
  }

  async getCourseAnalytics(courseId, days = 7) {
    const endDate = new Date();
    const startDate = new Date();
    startDate.setDate(startDate.getDate() - days);

    const response = await this.client.get(
      `/analytics/courses/${courseId}`,
      {
        params: {
          start_date: startDate.toISOString(),
          end_date: endDate.toISOString()
        }
      }
    );
    return response.data;
  }
}

// Usage
const kai = new KaiIntegration('kai_live_...');

(async () => {
  const courses = await kai.getCourses();

  for (const course of courses) {
    console.log(`Course: ${course.name}`);

    const analytics = await kai.getCourseAnalytics(course.course_id);
    console.log(`  Engagement: ${(analytics.engagement.avg_feedback_response_rate * 100).toFixed(1)}%`);
    console.log(`  Avg Quiz Score: ${analytics.performance.avg_quiz_score.toFixed(1)}`);
  }
})();

SDK Usage

Official SDKs simplify integration:

from kai import KaiClient

# Initialize client
kai = KaiClient(api_key="kai_live_...")

# List courses
courses = kai.courses.list(status="active")

# Request feedback
feedback_request = kai.feedback.request(
    course_id="course_abc",
    response_window_minutes=2
)

# Get results
results = kai.feedback.get_results(
    course_id="course_abc",
    request_id=feedback_request.request_id
)

# Print analysis
for topic in results.analysis.high_frequency_confusion:
    print(f"Review needed: {topic.topic} ({topic.percentage:.0%} confused)")
const { KaiClient } = require('@kai/sdk');

// Initialize client
const kai = new KaiClient({ apiKey: 'kai_live_...' });

// List courses
const courses = await kai.courses.list({ status: 'active' });

// Request feedback
const feedbackRequest = await kai.feedback.request({
  courseId: 'course_abc',
  responseWindowMinutes: 2
});

// Get results
const results = await kai.feedback.getResults({
  courseId: 'course_abc',
  requestId: feedbackRequest.requestId
});

// Print analysis
results.analysis.highFrequencyConfusion.forEach(topic => {
  console.log(`Review needed: ${topic.topic} (${(topic.percentage * 100).toFixed(0)}% confused)`);
});

See SDK documentation for complete reference: - Python SDK - JavaScript/TypeScript SDK - Java SDK - Ruby SDK

Third-Party Integrations

Slack Integration

Get Kai notifications in Slack channels.

Setup:

  1. In Kai Dashboard:

    Settings → Integrations → Slack → Add to Slack
  2. Authorize:

    Select Slack workspace → Authorize
  3. Configure Channels:

    Course alerts → #course-updates
    Grading complete → #grading-notifications
    System alerts → #kai-system

Example Slack Message:

Kai the AI
Feedback Request Complete - PSYCH 101

📊 Response Rate: 32/45 students (71%)

🔴 High-frequency confusion:
  • Standard Error (70% confused)
  → Recommend: In-class review

🟡 Low-frequency confusion:
  • Z-scores (12% confused)
  → Recommend: Individual resources

View Details → [Link to dashboard]

Microsoft Teams Integration

Similar to Slack, receive notifications in Teams channels.

Setup: Settings → Integrations → Microsoft Teams → Connect

Zapier Integration

Create custom workflows connecting Kai to 5,000+ apps.

Example Zaps:

  1. New Feedback → Google Sheets:

    Trigger: Feedback received (Kai)
    Action: Add row to spreadsheet (Google Sheets)
  2. Low Quiz Score → Email:

    Trigger: Quiz submitted (Kai)
    Filter: Score < 70
    Action: Send email (Gmail)
  3. Grading Complete → Notion:

    Trigger: Grading completed (Kai)
    Action: Create database item (Notion)

Data Export and Reporting

Scheduled Exports

Automate data exports for institutional reporting.

Configuration:

Dashboard → Settings → Data Export
Schedule: Weekly (Monday 6 AM)
Format: CSV
Include: Analytics, grades, engagement
Destination: SFTP, S3, or email

API-Based Export

# Export all course data
response = requests.get(
    f"https://chi2api.com/v1/courses/{course_id}/export",
    headers={"Authorization": f"Bearer {API_KEY}"},
    params={
        "format": "json",
        "include": "grades,feedback,analytics"
    }
)

# Save to file
with open("course_data.json", "w") as f:
    json.dump(response.json(), f, indent=2)

PowerBI/Tableau Integration

Connect BI tools directly to Kai’s API.

PowerBI Setup:

  1. Get DataWeb
  2. Enter URL: https://chi2api.com/v1/analytics/courses/COURSE_ID
  3. Add Header: Authorization: Bearer YOUR_API_KEY
  4. Transform data as needed
  5. Create visualizations

Security Considerations

API Key Management

  • ✅ Use separate keys for each integration
  • ✅ Rotate keys every 90 days
  • ✅ Revoke immediately if compromised
  • ✅ Store in secret management system

Network Security

  • ✅ Always use HTTPS
  • ✅ Verify SSL certificates
  • ✅ Use IP allowlisting when possible
  • ✅ Implement rate limiting on your side

Data Privacy

  • ✅ Comply with FERPA, GDPR, and local regulations
  • ✅ Encrypt data in transit and at rest
  • ✅ Implement proper access controls
  • ✅ Regular security audits

Troubleshooting

Common Integration Issues

LMS Sync Not Working: - Verify API credentials - Check firewall settings - Review integration logs - Test with minimal permissions first

Webhook Not Receiving Events: - Ensure endpoint is publicly accessible - Verify signature validation - Check webhook URL is HTTPS - Review webhook logs in dashboard

Rate Limits Exceeded: - Implement exponential backoff - Cache data when possible - Use batch endpoints - Consider upgrading plan

Support


Have a custom integration need? Contact our integrations team for personalized support.