Resources
28Install
npx skillscat add nia-agent-cyber/openai-voice-skill Install via the SkillsCat registry.
SKILL.md
OpenAI Voice Skill
Real-time voice conversations using OpenAI's native SIP integration. Way more fluid than multi-hop STT→LLM→TTS solutions.
How It Works
Phone call → Twilio SIP → OpenAI Realtime API
↓
Your webhook accepts call
with custom instructions
↓
Native voice conversationOpenAI handles STT, LLM, and TTS in a single low-latency pipeline.
Prerequisites
- Twilio account with a phone number
- OpenAI API key with Realtime API access
- Public webhook URL (ngrok, cloudflared, or deployed server)
Setup
1. Install Dependencies
cd scripts
pip install -r requirements.txt2. Configure Environment
cp .env.example .env
# Edit .env with your credentials:
# - OPENAI_API_KEY
# - OPENAI_PROJECT_ID (from platform.openai.com/settings)
# - WEBHOOK_SECRET (generate with: openssl rand -hex 32)3. Start Webhook Server
python webhook-server.py4. Expose Webhook (Development)
# Using cloudflared (recommended, no auth needed)
cloudflared tunnel --url http://localhost:8080
# Or ngrok
ngrok http 80805. Configure OpenAI Webhook
- Go to platform.openai.com/settings → Project → Webhooks
- Add webhook URL:
https://your-tunnel.trycloudflare.com/webhook - Subscribe to:
realtime.call.incoming
6. Configure Twilio SIP Trunk
- In Twilio Console → Elastic SIP Trunking → Create trunk
- Set Termination SIP URI:
sip:$PROJECT_ID@sip.api.openai.com;transport=tls - Assign your phone number to the trunk
Customization
Edit config/agent.json to customize:
{
"name": "Your Agent Name",
"instructions": "You are a helpful assistant...",
"voice": "alloy",
"model": "gpt-realtime"
}Available voices: alloy, echo, fable, onyx, nova, shimmer
Making Outbound Calls
# Via API
curl -X POST http://localhost:8080/call \
-H "Content-Type: application/json" \
-d '{"to": "+1234567890"}'Monitoring
# View active calls
curl http://localhost:8080/calls
# View call logs
tail -f logs/calls.logTroubleshooting
Call doesn't connect:
- Verify Twilio SIP trunk points to correct OpenAI SIP URI
- Check OpenAI webhook is receiving events
- Ensure PROJECT_ID matches your OpenAI project
Poor audio quality:
- OpenAI Realtime uses Opus codec by default
- Ensure network has low latency to OpenAI servers
Webhook not firing:
- Verify webhook URL is publicly accessible
- Check webhook signature validation