TypeScript SDK
TypeScript SDK
@prosodyai/sdk reference
Package: @prosodyai/sdk
See Integration for when to use batch vs streaming.
Install
npm install @prosodyai/sdkClient
import { ProsodyClient } from '@prosodyai/sdk';
const client = new ProsodyClient({
apiKey: process.env.PROSODY_API_KEY!, // psk_* from dashboard
});
const result = await client.analyze('./utterance.wav');Default origin: https://api.prosodyai.app. Auth header: X-API-Key.
Methods
| Method | Transport |
|---|---|
analyze() | POST /v1/analyze/audio |
analyzeBase64() | POST /v1/analyze/base64 |
analyzePCM() | Wraps PCM as WAV → analyze |
createStream() | Chunked PCM → analyze on an interval |
createRealtimeStream() | WebSocket /v1/stream/realtime |
Response fields
| Field | Batch | Realtime |
|---|---|---|
| Valence / arousal / dominance | ✓ | ✓ |
signals (engagement, stress, …) | ✓ | ✓ |
turns with turn.prosody | When diarize=true | Via transcript turns |
text, speaker labels | When returned | ✓ |
kpi_predictions | When KPIs configured | When KPIs configured |
session_id | When sessionId set | When sessionId set |
Streaming also emits agent steering cues on the wire (modulation_mode, tone-shift events). See Streaming.