Sentinel API v1

From your first API call to production

SDKs & examples

Generate clients from OpenAPI

The first release works with any language that can send HTTP + JSON. Official SDK packages are not yet published; until then, generate typed clients from the public OpenAPI or use a small HTTP wrapper.

Download the public contract

curl --fail http://localhost:8000/v1/openapi.json   --output sentinel-openapi.json

# Example generator; pin the generator version in production.
npx @openapitools/openapi-generator-cli generate   -i sentinel-openapi.json   -g typescript-fetch   -o generated/sentinel

Python

import os
import requests

class Sentinel:
    def __init__(self, base_url: str, api_key: str):
        self.base_url = base_url.rstrip("/")
        self.session = requests.Session()
        self.session.headers["Authorization"] = f"Bearer {api_key}"

    def events(self, **params):
        response = self.session.get(f"{self.base_url}/v1/events", params=params)
        response.raise_for_status()
        return response.json()

client = Sentinel("http://localhost:8000", os.environ["SENTINEL_API_KEY"])
print(client.events(limit=10))

JavaScript

export function sentinel(baseUrl, apiKey) {
  return async function request(path, init = {}) {
    const response = await fetch(new URL(path, baseUrl), {
      ...init,
      headers: {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
        ...init.headers,
      },
    });
    if (!response.ok) throw await response.json();
    return response.headers.get("content-type")?.includes("json")
      ? response.json()
      : response;
  };
}

PowerShell

The source kit includes a Python-free System.Net.Http example. It completes Source → Monitor → JPEG → Event and verifies the downloaded evidence SHA-256.

Set-Location "$HOME\Sentinel-Monitor\deploy\api"
& ..\..\docs\api\examples\first_event.ps1 -BaseUrl "http://127.0.0.1:8000" -ApiKey $env:SENTINEL_API_KEY

Retry rules

Automatically retry safe reads, retryable mutations with the same Idempotency-Key, and 408/425/429/transient 5xx responses. Retry 409 only when its error code marks a transient conflict. Use exponential backoff with jitter, honor Retry-After, and never log full requests containing keys or RTSP URLs.

Examples follow the current /v1 OpenAPI. In production, download the schema in CI, check for breaking diffs, and pin a runtime version you have validated.