Installation

1
Clone the Repository
Get the AI Stream SDK source code from GitHub.
git clone https://github.com/StreamerSDK/Ai-StreamerSDK.git cd Ai-StreamerSDK
2
Install Dependencies
Install all required Node.js packages.
npm install
3
Set Up Environment
Copy the example environment file and configure your settings.
cp env.example .env # Edit .env with your API keys and settings

Basic Setup

1
Configure Environment Variables
Set up your basic configuration in the .env file.
# Basic configuration RTMP_URL=rtmp://live.twitch.tv/app/YOUR_STREAM_KEY IMAGE_PATH=/path/to/your/image.png # TTS Provider (choose one) TTS_PROVIDER=auto # auto, elevenlabs, openai, local, mock # LLM Provider (choose one) LLM_PROVIDER=auto # auto, openai, claude, mock
2
Test Basic Setup
Run the demo to verify everything is working.
npm run test:demo
Setup Complete!
Your AI Stream SDK is now ready to use. You can start creating agents and streaming content.

TTS Providers

Choose a Text-to-Speech provider based on your needs and budget.

ElevenLabs
High-quality AI voice synthesis with natural-sounding voices. Best for production use.
High quality voices
Multiple voice options
Voice cloning support
Fast generation

Setup:

# Get API key from https://elevenlabs.io export ELEVENLABS_API_KEY="sk-your-key-here" export ELEVENLABS_VOICE_ID="alloy" # optional export TTS_PROVIDER="elevenlabs"
Cost Warning
ElevenLabs charges per character. Monitor your usage to avoid unexpected costs.
OpenAI TTS
OpenAI's text-to-speech API with multiple voice options and good quality.
Multiple voices
Good quality
Reliable service
Reasonable pricing

Setup:

# Get API key from https://platform.openai.com export OPENAI_API_KEY="sk-your-key-here" export OPENAI_MODEL="tts-1" # or tts-1-hd export TTS_PROVIDER="openai"
Local TTS
Simple local text-to-speech using system voices. Free but basic quality.
Completely free
No API keys needed
Works offline
Basic quality

Setup:

export TTS_PROVIDER="local"
Mock TTS
Generates silent audio files for testing. Perfect for development and testing.
Free for testing
No API keys needed
Fast generation
No actual speech

Setup:

export TTS_PROVIDER="mock"

LLM Providers

Choose a Large Language Model provider for AI intelligence.

OpenAI GPT
OpenAI's GPT models for high-quality AI responses. Best for most use cases.
High quality responses
Multiple models
Fast generation
Reliable service

Setup:

# Get API key from https://platform.openai.com export OPENAI_API_KEY="sk-your-key-here" export LLM_PROVIDER="openai"
Anthropic Claude
Anthropic's Claude models for thoughtful, long-form AI responses.
Thoughtful responses
Long-form content
Safety-focused
Good for analysis

Setup:

# Get API key from https://console.anthropic.com export ANTHROPIC_API_KEY="sk-ant-your-key-here" export LLM_PROVIDER="claude"
Mock LLM
Generates predefined responses for testing. Perfect for development.
Free for testing
No API keys needed
Fast responses
No real AI

Setup:

export LLM_PROVIDER="mock"

Streaming Setup

1
RTMP Streaming
Set up RTMP streaming to platforms like Twitch, YouTube, or Facebook.

Twitch Setup:

# Get your stream key from Twitch Creator Dashboard export RTMP_URL="rtmp://live.twitch.tv/app/YOUR_STREAM_KEY"

YouTube Live Setup:

# Get your stream key from YouTube Studio export RTMP_URL="rtmp://a.rtmp.youtube.com/live2/YOUR_STREAM_KEY"

Facebook Live Setup:

# Get your stream key from Facebook Creator Studio export RTMP_URL="rtmp://live-api-s.facebook.com:80/rtmp/YOUR_STREAM_KEY"
2
WebRTC Streaming
Set up WebRTC streaming for low-latency applications.
# WebRTC configuration (coming soon) export WEBRTC_ENABLED="true" export WEBRTC_SERVER="wss://your-webrtc-server.com"

Test Your Setup

1
Run Basic Test
Test your basic setup with the demo script.
npm run test:demo
2
Test TTS Providers
Test all available TTS providers.
npm run test:tts
3
Test Streaming
Test streaming with a real RTMP URL.
npm run start:example
Setup Complete!
Your AI Stream SDK is now fully configured and ready to use. You can start creating intelligent streaming agents!