App Ecosystem SDK

TypeScript and Python SDKs for connecting external applications to OpenSentinel's AI capabilities, memory system, notification channels, and 123 tools.

Any app can connect. Register your application, get an API key, and leverage OpenSentinel's full AI stack — chat, memory, tools, sub-agents, and notifications — from any codebase.

Overview

OpenSentinel provides TypeScript and Python SDKs for connecting external applications. Any app can leverage OpenSentinel's AI capabilities, memory system, notification channels, and 123 tools.

The SDK handles authentication, request signing, connection pooling, and graceful fallback. Your app registers once, receives an API key, and can immediately use all OpenSentinel features.

  • Chat & AI — send messages to Claude with full tool access
  • Memory — store and search memories via pgvector RAG
  • Notifications — push alerts to Telegram, Discord, Slack, email, etc.
  • Tools — execute any of OpenSentinel's 123 tools programmatically
  • Sub-Agents — spawn Research, Coding, Writing, Analysis, and OSINT agents

Quick Start (TypeScript)

Install the SDK
Terminal
$ npm install opensentinel
Register and chat
TypeScript
import { OpenSentinelClient } from "opensentinel/sdk";

const client = new OpenSentinelClient({
  url: "https://app.opensentinel.ai",
  appName: "MyApp",
  appType: "ecommerce",
});

await client.register();
const response = await client.chat("Analyze my sales data");
console.log(response.content);
That's it. Your app is now connected to OpenSentinel. The client handles registration, API key management, and automatic reconnection.

Quick Start (Python)

Install the SDK
Terminal
$ pip install opensentinel-sdk
Register and chat
Python
from opensentinel_sdk import OpenSentinelClient

client = OpenSentinelClient(
    url="https://app.opensentinel.ai",
    app_name="MyApp",
    app_type="legal-documents",
)

client.register()
response = client.chat("Summarize this contract")
print(response.content)

Environment Variables

The SDK can be configured via environment variables or constructor parameters. Environment variables take precedence when set.

VariableDescriptionDefault
OPENSENTINEL_URLOpenSentinel server URLhttp://localhost:8030
OPENSENTINEL_API_KEYPre-registered API key(auto-registered)
OPENSENTINEL_ENABLEDEnable integrationfalse
.env
# Point to your OpenSentinel instance
OPENSENTINEL_URL=https://app.opensentinel.ai
OPENSENTINEL_ENABLED=true

# Optional: pre-registered API key (skip auto-registration)
OPENSENTINEL_API_KEY=osk_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
💡
Auto-registration. If no API key is provided, the SDK will automatically call /api/sdk/register on first use and cache the key locally. For production, pre-register and set OPENSENTINEL_API_KEY.

API Endpoints

The SDK abstracts these endpoints, but you can also call them directly via HTTP.

EndpointMethodDescription
/api/sdk/registerPOSTRegister app, get API key
/api/sdk/chatPOSTAI chat with tools
/api/sdk/notifyPOSTSend notification
/api/sdk/memoryPOSTStore memory
/api/sdk/memory/searchPOSTSearch memories
/api/sdk/toolsGETList tools
/api/sdk/tools/executePOSTExecute tool
/api/sdk/agent/spawnPOSTSpawn sub-agent
/api/sdk/statusGETSystem status

Example: Direct HTTP

Terminal
# Register an app
$ curl -X POST https://app.opensentinel.ai/api/sdk/register \
    -H "Content-Type: application/json" \
    -d '{"appName": "MyApp", "appType": "analytics"}'

# Chat with your API key
$ curl -X POST https://app.opensentinel.ai/api/sdk/chat \
    -H "Authorization: Bearer osk_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{"message": "Summarize today'\''s metrics"}'

Integrated Applications

Applications across the GoGreen ecosystem are connected through the SDK:

ApplicationDomainSDK
TutorAIK-12 AI tutoringTypeScript
DocGen AILegal document intelligencePython
EcomFlowMulti-channel e-commerceTypeScript
PolyMarketAIPrediction market tradingPython
GoGreen SourcingProcurement intelligenceTypeScript
TimeSheetAITimesheet trackingTypeScript
20+ more — Voice assistants, sales training, recruiting, property management, and more.
ℹ️
Add your own app. The SDK is open and any application can connect. Register via the API or SDK client, and you'll receive a scoped API key with access to all OpenSentinel features.

Fallback Behavior

All SDKs support graceful fallback. When OpenSentinel is unavailable, methods return null (TypeScript with fallback: true) or None (Python with fallback=True), allowing apps to use their own AI implementations.

const client = new OpenSentinelClient({
  url: "https://app.opensentinel.ai",
  appName: "MyApp",
  fallback: true,  // return null instead of throwing
});

const response = await client.chat("Analyze this");
if (response === null) {
  // OpenSentinel unavailable, use local AI
  const localResult = await myLocalAI("Analyze this");
}
💡
Zero downtime. With fallback mode enabled, your application continues to function even if OpenSentinel is offline for maintenance or updates. AI features degrade gracefully rather than failing.