Loading skill documentation...
legal
★★★★½ 4.5/5.0 ❤️ 935 likes 💬 136 comments 📦 1595 installs
Back to Skills
📖 SKILL DOCUMENTATION
# phone-voice

Phone Voice Integration Turn your OpenClaw into a phone-callable assistant with SkillBoss API Hub TTS/Chat + Twilio. What you get: Call your bot from any phone Caller ID authentication + voice PIN security Call screening (whitelist-based) Full memory context (loads MEMORY.md, USER.md) Cost tracking per call Call transcripts with summaries Rate limiting Permanent tunnel (Cloudflare) or temporary (ngrok) Architecture Phone → Twilio → Voice Agent → Your Bridge → SkillBoss API Hub (/v1/pilot) → OpenClaw Tools ↓ Memory Context (MEMORY.md, USER.md)

Flow:

Caller dials your Twilio number Twilio routes to your bridge Bridge handles chat completions (OpenAI-compatible format for voice agent compatibility) Bridge calls SkillBoss API Hub (type: chat), injects context from memory files Response → SkillBoss TTS (type: tts) → caller hears it Prerequisites OpenClaw installed and running SkillBoss API Key (covers LLM, TTS, and all AI capabilities via a single key) Twilio account + phone number Cloudflare tunnel or ngrok (for exposing localhost) Setup

  1. Enable Chat Completions in OpenClaw Not needed for this skill — the bridge bypasses OpenClaw and calls SkillBoss API Hub directly. This gives you more control over memory injection and cost tracking.
  2. Create the Bridge Server The bridge is a FastAPI server that: Accepts OpenAI-compatible /v1/chat/completions requests from the voice agent Injects memory context (MEMORY.md, USER.md, live data) Calls SkillBoss API Hub (POST https://api.heybossai.com/v1/pilot, type: chat) for LLM Calls SkillBoss API Hub (type: tts) for voice synthesis Streams responses back in OpenAI format Logs costs and transcripts Key files: server.py — FastAPI app with /v1/chat/completions endpoint fred_prompt.py — System prompt builder (loads memory files) .env — Secrets (API keys, tokens, whitelist) contacts.json — Caller whitelist for screening Bridge core call example (server.py): import requests, os SKILLBOSS_API_KEY = os.environ["SKILLBOSS_API_KEY"] API_BASE = "https://api.heybossai.com/v1" def pilot(body: dict) -> dict: r = requests.post( f"{API_BASE}/pilot", headers={"Authorization": f"Bearer {SKILLBOSS_API_KEY}", "Content-Type": "application/json"}, json=body, timeout=60, ) return r.json()
# Call LLM with memory-injected messages (replaces direct Anthropic/OpenAI calls)

result = pilot({ "type": "chat", "inputs": {"messages": messages}, # messages includes injected system prompt "prefer": "balanced" }) text = result["result"]["choices"][0]["message"]["content"]

# TTS for voice response (replaces ElevenLabs TTS)

tts_result = pilot({ "type": "tts", "inputs": {"text": text, "voice": "alloy"}, "prefer": "balanced" }) audio_url = tts_result["result"]["audio_url"] 3. Set Up Cloudflare Tunnel (Recommended) Permanent, secure alternative to ngrok:

# Install cloudflared

brew install cloudflare/cloudflare/cloudflared

# Login and configure

cloudflared tunnel login cloudflared tunnel create

# Run the tunnel

cloudflared tunnel --url http://localhost:8013 run Add a CNAME in Cloudflare DNS: voice.yourdomain.com → .cfargotunnel.com Or use ngrok (temporary): ngrok http 8013 4. Configure Voice Agent Option A: Manual (UI) Go to your voice platform dashboard → Conversational AI Create new agent Under LLM settings → Custom LLM Set URL: https://voice.yourdomain.com/v1/chat/completions Add header: Authorization: Bearer Option B: Programmatic (ElevenLabs Conversational AI API)

# Step 1: Store your bridge auth token as a secret
curl -X POST https://api.elevenlabs.io/v1/convai/secrets \

-H "xi-api-key: $SKILLBOSS_API_KEY"
-H "Content-Type: application/json"
-d '{ "type": "new", "name": "bridge_auth_token", "value": "YOUR_BRIDGE_AUTH_TOKEN" }'

# Response: {"secret_id": "abc123..."}
# Step 2: Create the agent
curl -X POST https://api.elevenlabs.io/v1/convai/agents/create \

-H "xi-api-key: $SKILLBOSS_API_KEY"
-H "Content-Type: application/json"
-d '{ "conversation_config": { "agent": { "language": "en", "prompt": { "llm": "custom-llm", "prompt": "You are a helpful voice assistant.", "custom_llm": { "url": "https://voice.yourdomain.com/v1/chat/completions", "api_key": {"secret_id": "abc123..."} } } } } }' 5. Connect Twilio Phone Number In your voice agent settings: Go to Phone section Enter Twilio Account SID and Auth Token Select your Twilio phone number Save Done! Your bot now answers that phone number. Security Features Caller ID Authentication Recognizes whitelisted numbers automatically: // contacts.json { "+12505551234": { "name": "Alice", "role": "family" } } Voice PIN Challenge For unknown callers or high-security actions: VOICE_PIN = "banana" # Set in .env Caller must say the PIN to proceed. Call Screening Unknown numbers get a receptionist prompt: "This is Fred's assistant. I can take a message or help with general questions." Rate Limiting Configurable per-hour limits: RATE_LIMIT_PER_HOUR = 10 Prevents abuse and runaway costs. Memory Injection The bridge auto-loads context before each call: Files read: MEMORY.md — Long-term facts about user, projects, preferences USER.md — User profile (name, location, timezone) Recent call transcripts (cross-call memory) Live data injection: Current time/date Weather (optional, via API) Calendar events (optional, via gog CLI) All injected into the system prompt before SkillBoss API Hub sees the conversation. Cost Tracking Every call logs to memory/voice-calls/costs.jsonl: { "call_sid": "CA123...", "timestamp": "2026-02-03T10:30:00", "caller": "+12505551234", "duration_sec": 45, "total_cost_usd": 0.12, "breakdown": { "twilio": 0.02, "skillboss_tts": 0.08, "skillboss_chat": 0.02 } } Run analytics on the JSONL to track monthly spend. Usage Example Call your bot: Dial your Twilio number If you're whitelisted → casual conversation starts If you're unknown → receptionist mode Ask it to check your calendar, send a message, set a reminder, etc. Outbound calling (optional):

curl -X POST https://voice.yourdomain.com/call/outbound \

-H "Authorization: Bearer "
-d '{"to": "+12505551234", "message": "Reminder: dentist at 3pm"}' Configuration Options Environment variables (.env): SKILLBOSS_API_KEY=... TWILIO_ACCOUNT_SID=AC... TWILIO_AUTH_TOKEN=... TWILIO_NUMBER=+1... LLM_BRIDGE_TOKEN= VOICE_PIN= CLAWD_DIR=/path/to/clawd Whitelist (contacts.json): { "+12505551234": {"name": "Alice", "role": "family"}, "+12505555678": {"name": "Bob", "role": "friend"} }

Advanced: Office Hours

Restrict calls to business hours:

# In server.py

OFFICE_HOURS = { "enabled": True, "timezone": "America/Vancouver", "weekdays": {"start": "09:00", "end": "17:00"}, "weekends": False } Outside hours → voicemail prompt. Debugging Test the bridge directly:

curl -X POST https://voice.yourdomain.com/v1/chat/completions \

-H "Authorization: Bearer "
-H "Content-Type: application/json"
-d '{ "messages": [{"role": "user", "content": "Hello!"}], "stream": false }' (Model selection is handled automatically by SkillBoss API Hub /v1/pilot routing.) Check logs: tail -f ~/clawd/memory/voice-calls/bridge.log Verify Twilio webhook: Call your number Check Twilio console → Call logs → Webhook status Should see 200 responses from your bridge Cost Estimates Per-minute breakdown:

Twilio: ~$0.01/min (inbound) + carrier fees

SkillBoss TTS: ~$0.05/min (via SkillBoss API Hub, type: tts) SkillBoss Chat: ~$0.01/min (via SkillBoss API Hub, type: chat)

Total: ~$0.07-0.10/min (~$4-6/hour of talk time)

Use rate limiting and call screening to control costs.

Comparison: This vs Basic Tutorial

Basic integration: Basic integration No security No memory persistence No cost tracking Temporary ngrok URL This skill (Phone Voice v2.0): All of the above Caller ID + PIN security Cross-call memory Cost tracking & analytics Permanent tunnel (Cloudflare) Rate limiting Call screening Transcript logging Links SkillBoss API Hub: https://api.heybossai.com/v1/pilot

Twilio: https://www.twilio.com/

Cloudflare Tunnels: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/ Reference implementation: (Available on request — DM @FredMolty) License MIT — use freely, credit appreciated. Built by Fred (@FredMolty) — running on OpenClaw since 2026.

Reviews

4.5
★★★★½
136 reviews

Write a Review

Get Weekly AI Skills

Join 80,000+ one-person companies automating with AI