One npm install. Drop-in compatible with the OpenAI SDK. Every AI call automatically issues a cryptographic STP certificate, enforces PII protection, and logs to the Merkle audit trail.
npm install @streetmp/sdkThe only line that changes is the import.
// ❌ BEFORE — Raw OpenAI (unprotected)
import OpenAI from "openai";
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const res = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: "user", content: userInput } // ← raw PII, no audit trail,
// no compliance, no cert
],
});
// No trust score. No execution ID. No STP certificate.
// No proof this was governed. Just vibes.// ✅ AFTER — StreetMP OS SDK (governed, certified, auditable)
import { StreetMPClient } from "@streetmp/sdk";
const client = new StreetMPClient({
apiKey: process.env.STREETMP_API_KEY, // smp_live_...
tenantId: "acme-corp",
partnerId: "fintech-partner-sg", // optional white-label
});
const res = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: userInput }],
// ↑ local PII pre-scan runs HERE before any network I/O
// StreetMPPiiError thrown if NRIC/CC/SSN detected
});
console.log(res.streetmp?.trust_score); // 87.3
console.log(res.streetmp?.trust_band); // "GOLD"
console.log(res.streetmp?.execution_id); // "exec_a3f8c2d1e94b..."
console.log(res.streetmp?.pii_redacted); // 2 fields masked
// Every call issues a tamper-evident STP/1.0 certificate.
// Verify at: os.streetmp.com/verify/exec_a3f8c2d1e94b...All of StreetMP OS, packaged into a single import.
Same message format as openai.chat.completions.create(). Replace the import, add your API key, done.
Scans for CC, SSN, NRIC/FIN, MyKad, IBAN, email before any network I/O. StreetMPPiiError lets you fix your data pipeline.
Every completion returns res.streetmp.execution_id — a Merkle-anchored STP/1.0 certificate verifiable by any auditor.
Set partnerId to put your company name on public verification pages: 'Verified by [You] via StreetMP Trust Protocol.'
MAS TRM · BNM RMiT · PDPA-SG · GDPR enforced at kernel level. No configuration required beyond tenant ID.
Uses native fetch (Node ≥18). No node_modules bloat. Ships as ESM. 8kB minified.
Every completion returns an execution_id. Verify it any time.
// STP Certificate verification — no account needed
const cert = await client.stp.verify("exec_a3f8c2d1e94b7056fe3a");
console.log(cert.verified); // true
console.log(cert.status); // "SECURE"
console.log(cert.certificate?.trust_band); // "GOLD"
// ["MAS_TRM_9.2_AI_GOVERNANCE", "V74_CONSENSUS_REQUIRED"]
// "StreetMP Trust Protocol Kernel v1.0"Set partnerId to white-label the entire trust protocol under your brand. Your customers see "Verified by [Your Company] via StreetMP Trust Protocol" on every certificate.
// White-label partner SDK integration
import { StreetMPClient, StreetMPPiiError } from "@streetmp/sdk";
const client = new StreetMPClient({
apiKey: "smp_live_partner_key",
tenantId: "end-customer-tenant-id",
partnerId: "your-partner-id", // registers your brand
userId: currentUser.id, // optional per-user correlation
});
try {
const res = await client.chat.completions.create({
messages: [{ role: "user", content: prompt }],
});
// Response headers contain:
// x-streetmp-partner-id: your-partner-id
// x-streetmp-partner-name: Your Company Name
// x-streetmp-partner-accent: #10b981
// Public /verify page shows: "Verified by Your Company via STP"
} catch (e) {
if (e instanceof StreetMPPiiError) {
// ["CREDIT_CARD", "NRIC_FIN"]
// The request never left your application layer.
}
}interface StreetMPClientOptions {
apiKey: string; // smp_live_... — from os.streetmp.com/dashboard
tenantId: string; // your org identifier
partnerId?: string; // ISV white-label ID
userId?: string; // end-user correlation (never stored with prompts)
baseUrl?: string; // default: https://api.streetmp.com/v1/proxy
timeoutMs?: number; // default: 30_000
localPiiCheck?: boolean; // default: true — throws StreetMPPiiError on detect
}Get your StreetMP API key, run the install command, and your first STP-certified call will be live in under 60 seconds.
npm install @streetmp/sdk