Everything you need to integrate Semantic Streaming and start saving on CDN costs.
Get up and running in under 10 minutes.
npm install semantic-streaming-sdk
import { SemanticStreamingSDK } from 'semantic-streaming-sdk'; const sdk = new SemanticStreamingSDK({ licenseKey: 'ss_live_your_key' });
yourPlayer.onSkip((skip) => { const decision = sdk.analyzeSkip({ duration: skip.seconds, currentQuality: skip.quality, platform: 'web' }); if (decision.action === 'adjust_quality') yourPlayer.setQuality(decision.toQuality); });
All API endpoints (except health) require your API key in the request header.
X-API-Key: ss_live_your_api_key_here
Base URL: https://semantic-streaming-production.up.railway.app
| Parameter | Type | Description |
|---|---|---|
| namerequired | string | Your full name |
| emailrequired | string | Your email address |
| companyoptional | string | Company name |
{ "success": true, "apiKey": "ss_live_xxxx", "user": { "plan": "pilot" } }| Parameter | Type | Description |
|---|---|---|
| durationrequired | number | Skip duration in seconds |
| currentQualityrequired | string | 144p, 240p, 360p, 480p, 720p, 1080p, 2k, 4k |
| sessionIdoptional | string | Your session identifier |
| platformoptional | string | web, ios, android |
{
"action": "adjust_quality",
"fromQuality": "1080p",
"toQuality": "240p",
"savings": { "savedMB": 14.65, "percentage": 91.1 },
"restorationDelay": 2000
}| Query Param | Type | Description |
|---|---|---|
| periodoptional | string | e.g. 2026-03 — defaults to current month |
curl https://semantic-streaming-production.up.railway.app/api/v1/health
// Works with hls.js — real CDN quality switching const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); const sdk = new SemanticStreamingSDK({ licenseKey: 'ss_live_your_key' }); video.addEventListener('seeked', async () => { const duration = Math.abs(video.currentTime - lastTime); if (duration >= 2.0) { const decision = await sdk.analyzeSkip({ duration, currentQuality: '1080p' }); if (decision.action === 'adjust_quality') { hls.currentLevel = findLevel(decision.toQuality); // REAL switch setTimeout(() => hls.currentLevel = -1, 2000); // restore } } });
Try it yourself at semanticstreaming.netlify.app/demo
import { HTML5VideoIntegration } from 'semantic-streaming-sdk'; const optimizer = new HTML5VideoIntegration(videoElement, { minQuality: '360p' }); optimizer.on('savingsCalculated', (d) => console.log(`Saved ${d.savings.savedMB} MB`));
import { useRef, useEffect } from 'react'; import { HTML5VideoIntegration } from 'semantic-streaming-sdk'; function OptimizedPlayer({ src }) { const ref = useRef(); useEffect(() => { const opt = new HTML5VideoIntegration(ref.current); return () => opt.destroy(); }, []); return <video ref={ref} src={src} controls />; }
| Status | Code | Description |
|---|---|---|
| 400 | Bad Request | Missing or invalid parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 409 | Conflict | Email already registered |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Something went wrong on our end |