SDK Quickstart & API Integration
Instrument your AI agents in less than five minutes. SynapTrace SDKs are designed to have near-zero async runtime overhead and full compatibility with standard OpenTelemetry exporters.
1. Install the SDK
npm install @synaptrace/sdkpip install synaptrace2. Code Implementation
Wrap your top-level agent coordinator function or enable framework auto-instrumentation for LangChain, AutoGen, and CrewAI:
import { SynapTrace } from "@synaptrace/sdk";
import OpenAI from "openai";
// Initialize SynapTrace with zero-overhead async batching
const tracer = new SynapTrace({
apiKey: process.env.SYNAPTRACE_API_KEY,
serviceName: "customer-support-agent",
});
const openai = new OpenAI();
// Wrap your agent workflow with automated tracing
async function runAgent(prompt: string) {
return await tracer.traceSession("crm_triage", async (span) => {
span.setTag("model", "gpt-4o");
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: prompt }],
tools: myAgentTools,
});
// Guardrail assertions execute asynchronously without slowing down TTFT
await span.evaluate({
hallucinationCheck: true,
costBudgetMax: 0.05,
});
return response;
});
}Data Governance & Privacy Modes
SynapTrace supports two operational modes depending on your organization's security and compliance posture:
A. Metadata-Only Mode (Recommended for PII/HIPAA)
In this mode, prompt texts and completion payloads are hashed or scrubbed locally inside your application runtime before transmission. SynapTrace only receives token metrics, execution timings, and boolean assertion results.
B. Full Trace Debugging Mode
Transmits sanitized payloads encrypted via TLS 1.3 to inspect agent reasoning chains and prompt inputs directly in the Web UI dashboard. All payloads are encrypted at rest with AES-256.
Have specific SDK or framework questions?
Our engineering team is available to assist with custom orchestrator setups.