App Ecosystem SDK
TypeScript and Python SDKs for connecting external applications to OpenSentinel's AI capabilities, memory system, notification channels, and 123 tools.
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)
$ npm install opensentinel
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);
Quick Start (Python)
$ pip install opensentinel-sdk
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.
| Variable | Description | Default |
|---|---|---|
OPENSENTINEL_URL | OpenSentinel server URL | http://localhost:8030 |
OPENSENTINEL_API_KEY | Pre-registered API key | (auto-registered) |
OPENSENTINEL_ENABLED | Enable integration | false |
# 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
/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.
| Endpoint | Method | Description |
|---|---|---|
/api/sdk/register | POST | Register app, get API key |
/api/sdk/chat | POST | AI chat with tools |
/api/sdk/notify | POST | Send notification |
/api/sdk/memory | POST | Store memory |
/api/sdk/memory/search | POST | Search memories |
/api/sdk/tools | GET | List tools |
/api/sdk/tools/execute | POST | Execute tool |
/api/sdk/agent/spawn | POST | Spawn sub-agent |
/api/sdk/status | GET | System status |
Example: Direct HTTP
# 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:
| Application | Domain | SDK |
|---|---|---|
| TutorAI | K-12 AI tutoring | TypeScript |
| DocGen AI | Legal document intelligence | Python |
| EcomFlow | Multi-channel e-commerce | TypeScript |
| PolyMarketAI | Prediction market trading | Python |
| GoGreen Sourcing | Procurement intelligence | TypeScript |
| TimeSheetAI | Timesheet tracking | TypeScript |
| 20+ more — Voice assistants, sales training, recruiting, property management, and more. | ||
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");
}