← All guides
Integration

Building an AI monitoring app

How to ship a Public-API-driven AI integration in a weekend.

12 min read

Building an AI monitoring app

This guide walks you through the shape of an AI-verification app on CHeKT: a third-party service that listens to alarm events, fetches snapshots, runs them through a vision model, and writes back a verdict.

The shape of the integration

  • Pattern: CHeKT Apps
  • Auth: API key
  • Direction: AI app → CHeKT (your service calls our API)
  • Time to first response: 45 minutes for a working prototype.

1. Create the app

Sign in to dealer.chekt.comSettingsCHeKT AppsNew app.

Permissions you need:

  • events:read — to confirm alarm context
  • snapshots:read — to fetch images for analysis
  • alarms:write — to acknowledge or annotate

Subscribe to the alarm.created and snapshot.created events.

2. Stand up a webhook receiver

import express from "express";
import crypto from "crypto";

const app = express();
app.use(express.json({ verify: (req, _res, buf) => (req.rawBody = buf) }));

app.post("/webhooks/chekt", (req, res) => {
  const sig = req.headers["x-chekt-signature"] as string;
  const expected = crypto
    .createHmac("sha256", process.env.CHEKT_WEBHOOK_SECRET!)
    .update(req.rawBody)
    .digest("hex");

  if (sig !== expected) return res.status(401).end();

  if (req.body.type === "alarm.created") {
    queue.publish("analyze", req.body.data);
  }
  res.sendStatus(200);
});

The 200 is the only thing CHeKT cares about. Do real work in a queue.

3. Fetch the snapshot

const snap = await chekt.snapshots.get(alarm.snapshot_id);
const verdict = await vision.classify(snap.url);

4. Write the verdict back

await chekt.alarms.annotate(alarm.id, {
  source: "ai-verifier",
  verdict: verdict.label,        // "intruder" | "false-positive" | "uncertain"
  confidence: verdict.confidence,
});

A central station operator now sees the AI annotation alongside the alarm in real time.

5. Handle retries safely

Use idempotency keys on every write. CHeKT retries webhooks with exponential backoff for 24 hours — your side might receive duplicates. See Idempotency.

What to ship next

  • Acknowledge low-confidence false positives — reduce operator load.
  • Dispatch on high-confidence intruder events — auto-escalate.
  • Surface metrics in your dashboard — AI catch rate, false-positive rate.

That's it — a real AI integration in a single afternoon.