Production-ready code examples for the Telnyx platform. Each example is a self-contained project with working code, documentation, and environment configuration - clone, configure, and run in minutes.
# 1. Clone the repository
git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples
# 2. Pick an example
cd send-sms-python
# 3. Configure and run (see each example's README for language-specific commands)
cp .env.example .env
# Edit .env with your Telnyx API key from https://portal.telnyx.com
pip install -r requirements.txt && python app.pyFull API reference at developers.telnyx.com
Each example's README has a Quick Start with the exact install/run commands for its language, an API.md typed endpoint reference, and a GUIDE.md walkthrough.
(72 examples)
Build voice applications with Telnyx Voice AI - IVR menus, call recording, conferencing, WebRTC, and AI-powered call routing.
| Example | Language | Description |
|---|---|---|
| branded-caller-id-manager-python | Python | Branded Caller ID Manager - register, manage, and verify branded calling profiles with STIR/SHAKEN attestation for higher answer rates. |
| build-conference-calling-python | Python | Create multi-party conference calls. |
| build-ivr-phone-menu-nodejs | Node.js | Production-ready IVR system using the Telnyx Voice API and Express.js. Answers inbound calls, plays a menu via TTS, collects DTMF input, and routes callers to sales or support. |
| build-ivr-phone-menu-python | Python | Build an interactive voice response menu with DTMF input. |
| bulk-number-validation-cleaner-python | Python | Bulk Number Validation & Cleaner - validate and clean phone number lists via Telnyx Number Lookup API. |
| call-analytics-dashboard-api-python | Python | Pull call detail records from the Telnyx API and expose call usage analytics through a dashboard API. |
| call-forwarding-python | Python | Forward incoming calls to another destination. |
| call-queue-with-hold-music-python | Python | Call Queue with Hold Music - queue callers with position announcements and hold music, route to agents. |
| call-sentiment-live-escalation-python | Python | Call Sentiment Live Escalation - monitor call transcripts in real-time. When negative sentiment or distress is detected, auto-escalate to a supervisor. |
| call-whisper-monitoring-python | Python | Monitor calls with whisper prompts for agents. |
| call-whisper-screen-pop-python | Python | Call Whisper & Screen Pop - whisper caller info to agent before connecting the call. |
| cloud-storage-call-archive-python | Python | Cloud Storage Call Archive - archive call recordings to Telnyx Cloud Storage (S3-compatible) with searchable metadata. |
| cnam-caller-id-lookup-enrichment-python | Python | CNAM Caller ID Lookup Enrichment - look up CNAM for inbound callers, enrich CRM records with caller identity. |
| commercial-voiceover-generator-python | Python | Provide product name, target audience, and tone. AI writes 3 script variations with timing marks, TTS renders each in multiple voices, delivers top picks via SMS for client approval. |
| conference-live-poll-dtmf-python | Python | Conference Live Poll via DTMF - host asks a question, all conference participants vote by pressing 1-4, results tallied instantly. |
| deepfake-voice-detector-python | Python | Real-time synthetic speech detection on live phone calls. Captures audio via media streaming, extracts acoustic features, scores deepfake probability with AI Inference, alerts security team via Slack. |
| edge-compliance-monitor-python | Python | Real-time compliance checking for regulated call centers using Telnyx Voice, AI Inference, and Edge Compute. |
| edge-fraud-firewall-python | Python | Screen every inbound call at the edge with Telnyx Voice, Number Lookup, and AI Inference. |
| edge-geo-smart-router-python | Python | Route calls by geography at the edge using Telnyx Voice, AI Inference, and Edge Compute. |
| edge-ivr-ab-tester-python | Python | A/B test different IVR flows at the edge. |
| edge-merge-ai-receptionist-python | Python | Edge worker answers every call using Telnyx Voice, AI Inference, and Edge Compute with Merge HRIS. |
| edge-merge-reference-checker-python | Python | Automate reference checks when an ATS application advances using Telnyx Voice and AI Inference with Merge ATS. |
| edge-merge-shift-coverage-python | Python | Manager texts need a closer tonight using Telnyx Messaging and Edge Compute with Merge HRIS. |
| edge-number-masking-python | Python | Marketplace-style proxy number pool at the edge. |
| edge-voicemail-to-action-python | Python | AI-powered voicemail triage at the edge. |
| edge-webhook-aggregator-python | Python | Multi-tenant webhook consolidation at the edge. |
| fax-to-structured-data-pipeline-python | Python | Fax-to-Structured-Data Pipeline - receive faxes, AI extracts structured data (invoices, orders, prescriptions) into JSON. |
| live-podcast-call-in-python | Python | Hosts on a conference call, listeners call in. AI screens callers via STT, queues approved ones, generates real-time fact-checks for the host, TTS announces topics. |
| make-outbound-phone-call-csharp | C# | Place an outbound phone call with the Telnyx Call Control API using C# and ASP.NET. |
| make-outbound-phone-call-java | Java | Place an outbound phone call with the Telnyx Call Control API using Java. |
| make-outbound-phone-call-nodejs | Node.js | Initiate an outbound phone call using the Telnyx Call Control API. Exposes an Express endpoint that dials a number and returns the call control ID. |
| make-outbound-phone-call-php | PHP | Place an outbound phone call with the Telnyx Call Control API using PHP. |
| make-outbound-phone-call-python | Python | Programmatically place an outbound phone call using Telnyx Call Control and handle the call lifecycle. |
| make-outbound-phone-call-ruby | Ruby | Place an outbound phone call using the Telnyx Call Control API and the Telnyx Ruby SDK, exposed through a Sinatra endpoint. |
| media-stream-voice-cloak-python | Python | Media Stream Voice Cloak - real-time voice modification via media streaming API. Apply pitch shift, echo, or anonymization. |
| merge-deal-desk-alerts-python | Python | CRM webhook fires when a deal moves to negotiation, triggering Telnyx Voice and AI Inference alerts with Merge CRM. |
| merge-employee-hotline-python | Python | Employees call and authenticate via caller ID using Telnyx Voice and AI Inference with Merge HRIS. |
| merge-expense-by-phone-python | Python | Salesperson calls and dictates an expense using Telnyx Voice and AI Inference with Merge Accounting. |
| merge-interview-pipeline-python | Python | ATS webhook fires when a new application arrives, triggering Telnyx Voice, AI Inference, and Messaging with Merge ATS. |
| merge-invoice-collector-python | Python | Pulls overdue invoices from Merge Accounting and collects payments using Telnyx Voice, AI Inference, and Messaging. |
| merge-pipeline-briefing-python | Python | Morning pipeline briefing delivered by Telnyx Voice and AI Inference with Merge CRM. |
| merge-recruitment-hotline-python | Python | Job seekers call a recruitment hotline powered by Telnyx Voice, AI Inference, and Messaging with Merge ATS. |
| merge-ticket-escalation-python | Python | Critical ticket fires a webhook from Merge Ticketing, escalating via Telnyx Voice and AI Inference. |
| multi-number-identity-router-python | Python | Multi-Number Identity Router - route calls based on which number was dialed. Each number maps to a different business identity, greeting, and routing destination. |
| multilingual-voiceover-kit-python | Python | Submit a script in one language, AI translates to multiple targets preserving tone and timing, TTS renders each language with native-sounding voices. Batch localization for 15 languages. |
| number-lookup-fraud-screener-python | Python | Number Lookup Fraud Screener - screen inbound calls/messages for fraud indicators using number lookup before connecting. |
| number-lookup-lead-enrichment-python | Python | Number Lookup Lead Enrichment - CNAM and carrier lookup to qualify and enrich sales leads. |
| number-porting-status-tracker-python | Python | Number Porting Status Tracker - track porting orders with status webhooks and SMS alerts. |
| number-reputation-monitor-auto-rotate-python | Python | Number Reputation Monitor - track outbound number reputation, auto-rotate flagged numbers. |
| number-search-and-purchase-api-python | Python | Number Search and Purchase API - search, filter, and buy phone numbers programmatically. |
| number-warmup-reputation-builder-python | Python | Number Warmup & Reputation Builder - gradually ramp SMS volume on new numbers to build carrier reputation and avoid spam flags. |
| porting-loa-automation-python | Python | Porting LOA Automation - automate Letter of Authorization generation and porting order submission. |
| porting-order-tracker-dashboard-python | Python | Submit, track, and manage number porting orders with SLA monitoring, timeline visualization, and bulk operations. |
| real-time-call-intelligence-dashboard-python | Python | Real-Time Call Intelligence Dashboard - live transcription, sentiment analysis, and competitor detection. |
| record-phone-calls-nodejs | Node.js | Initiate outbound calls and control call recording using the Telnyx Voice API with Express. Handles call lifecycle webhooks and recording start/stop. |
| record-phone-calls-python | Python | Record calls and receive recording webhooks. |
| route-phone-calls-to-ai-agent-go | Go | Receive inbound call webhooks from the Telnyx Voice API and answer calls programmatically with a Go + Gin server. |
| route-phone-calls-to-ai-agent-nodejs | Node.js | Receive inbound call webhooks from the Telnyx Voice API and answer calls programmatically with an Express server using Call Control. |
| route-phone-calls-to-ai-agent-python | Python | Handle inbound calls with webhook-driven AI routing. |
| route-phone-calls-to-ai-agent-ruby | Ruby | Handle inbound calls with webhook-driven AI routing using Ruby and Sinatra. |
| smart-number-geo-assignment-python | Python | Smart Number Geo-Assignment - automatically purchase and assign local numbers based on caller geography to maximize answer rates. |
| texml-dynamic-call-router-python | Python | TeXML Dynamic Call Router - time-of-day and caller-based routing with TeXML responses. |
| text-to-speech-phone-call-nodejs | Node.js | Initiate an outbound voice call and play a text-to-speech message on answer using the Telnyx Call Control API. |
| text-to-speech-phone-call-python | Python | Play text-to-speech audio during a phone call. |
| transfer-live-phone-calls-python | Python | Transfer active calls to another number or agent. |
| video-voiceover-replacement-python | Python | Upload audio with existing voice-over. STT extracts the script, AI rewrites/improves it (5 modes: polish, professional, simplify, energize, shorten), TTS re-records with studio quality. |
| video-webinar-recording-manager-python | Python | Video Webinar Recording Manager - manage video room webinars with automatic recording, transcription, and clip extraction. |
| voice-to-slack-bridge-python | Python | Voice-to-Slack Bridge - call a phone number, speak a message, AI transcribes and posts to Slack with urgency tagging. |
| voice-verified-identity-2fa-python | Python | Voice-Verified Identity + 2FA - Number Lookup, SMS OTP, and AI-assisted secure transactions. |
| voiceover-audition-generator-python | Python | Submit a script, hear it read by every available TTS voice. AI scores and ranks best-fit voices based on content, tone, and audience. SMS delivers top picks to decision-makers. |
| webrtc-browser-calling-python | Python | Enable browser-based calling with WebRTC. |
| wireguard-private-voice-network-python | Python | WireGuard Private Voice Network - create WireGuard mesh network for private SIP trunking with encrypted voice traffic. |
(101 examples)
Send and receive text messages with the Telnyx SMS API - build autoresponders, implement 2FA, and manage bulk messaging campaigns.
| Example | Language | Description |
|---|---|---|
| abandoned-cart-recovery-python | Python | SMS 1h after abandon with incentive, AI voice call 24h later if no purchase. Integrates with Shopify webhooks and Stripe for discount codes. |
| accounting-tax-season-line-python | Python | Handles scheduling, document checklist reminders, status updates. AI texts clients with missing doc reminders. CPA reviews readiness before appointments. |
| after-hours-nurse-triage-python | Python | AI screens symptoms using clinical decision tree, routes urgent to on-call nurse via PagerDuty, queues non-urgent for AM callback. Nurse reviews and overrides AI severity scores. |
| ai-appointment-booking-sms-flow-python | Python | AI Appointment Booking SMS Flow - guided SMS booking with available slot selection. |
| ai-appointment-reminder-sms-voice-python | Python | AI Appointment Reminder - SMS first, voice call for non-responders, AI handles rescheduling. |
| alphanumeric-sender-id-sms-python | Python | Send SMS messages with a branded alphanumeric sender ID using the Telnyx Messaging API. Validates sender IDs and enforces regional restrictions. |
| autonomous-outbound-sales-agent-python | Python | Autonomous Outbound Sales Agent - AI-driven lead qualification, objection handling, and meeting booking. |
| billing-anomaly-detector-python | Python | Billing Anomaly Detector - monitor usage and billing for anomalies, alert on cost spikes and unusual patterns. |
| cdr-usage-analytics-dashboard-python | Python | Pull Call Detail Records, build usage analytics with cost breakdowns, peak-hour analysis, and AI-powered insights. |
| cloud-storage-media-cdn-python | Python | Cloud Storage Media CDN - use Telnyx Cloud Storage (S3-compatible) as a CDN for IVR prompts, hold music, and voice assets. |
| e911-address-validator-python | Python | Validate and register emergency (E911) addresses for phone numbers via the Telnyx API. |
| ecommerce-order-status-bot-python | Python | Customers call or text order number, get real-time Shopify tracking. AI detects delivery exceptions and proactively texts customers before they call support. |
| edge-compute-webhook-proxy-python | Python | Receive Telnyx voice and SMS webhooks at the edge with minimal latency. Validates, enriches with timestamps, HMAC-signs, and forwards to your backend. |
| edge-mcp-server-deploy-python | Python | Deploy an MCP server to Telnyx Edge Compute exposing Telnyx APIs as tools for AI agents. Send SMS, search numbers, run inference. |
| elearning-course-narrator-python | Python | Upload course content, AI structures into audio modules with pacing cues and quiz prompts, TTS narrates each module, stores in Cloud Storage with a JSON manifest. |
| emergency-mass-notification-system-python | Python | Emergency Mass Notification System - SMS + voice calls with delivery tracking and escalation. |
| fraud-alert-verification-python | Python | Suspicious transaction triggers voice call to customer, verifies via DTMF, blocks or approves in real-time. Fraud team reviews edge cases via Slack. |
| global-lead-response-engine-python | Python | Global Lead Response Engine - multi-language AI qualification with live transfer and omnichannel follow-up. |
| hosted-messaging-campaign-manager-python | Python | Hosted Messaging Campaign Manager - manage hosted messaging campaigns with subscriber opt-in/out tracking and delivery analytics. |
| hotel-guest-services-python | Python | Room service, housekeeping, concierge requests via voice or SMS. AI routes and tracks. Staff gets Slack notifications, guest gets SMS when fulfilled. |
| interview-screen-scheduler-python | Python | Candidate applies, AI calls for 5-min phone screen, scores answers, books qualified candidates on hiring manager's calendar. Integrates with Greenhouse ATS and Google Calendar. |
| isv-notification-engine-python | Python | SaaS platform sends alerts via SMS/voice/WhatsApp based on customer preference and urgency. Multi-channel with fallback cascade and delivery tracking. |
| ivr-prompt-generator-python | Python | Generate professional IVR/phone system prompts. AI writes caller-friendly scripts from business descriptions, TTS renders in multiple voices, test via live Telnyx call playback. |
| law-firm-client-intake-python | Python | AI answers after-hours calls, screens case type, collects facts, runs conflict check, books consultation via Calendly, collects retainer deposit via Stripe. |
| long-code-sms-python | Python | Send A2P SMS over a long code with a rate-limited queue, delivery tracking, and signed inbound webhooks using the Telnyx Messaging API. |
| marketplace-comms-bridge-python | Python | Buyer texts about a listing, AI responds with details, facilitates anonymous buyer-seller connection via masked numbers, handles scheduling. Ops reviews flagged conversations. |
| media-stream-custom-audio-mixer-python | Python | Media Stream Custom Audio Mixer - mix custom audio into live calls via WebSocket-based media streaming. |
| media-stream-live-transcription-python | Python | Media Stream Live Transcription - fork call audio to WebSocket for real-time transcription display. |
| merge-employee-onboarding-python | Python | New employee webhook from Merge HRIS triggers full provisioning: Telnyx phone number, AI voicemail greeting, welcome SMS with IT setup instructions, and IT ticket via Merge Ticketing. |
| messaging-campaign-ab-test-optimizer-python | Python | Messaging Campaign A/B Test Optimizer - test SMS copy variants, AI picks winners, auto-scales. |
| migrate-from-elevenlabs-python | Python | Migrate from ElevenLabs - import ElevenLabs voice configurations to Telnyx TTS with voice mapping and cost comparison. |
| migrate-from-twilio-python | Python | Migrate from Twilio - complete Twilio-to-Telnyx migration tool: numbers, messaging profiles, voice apps, and webhook configs. |
| migrate-from-vapi-python | Python | Migrate from Vapi - import Vapi voice agents to Telnyx AI Assistants with voice, prompt, and tool configuration mapping. |
| missions-workflow-orchestrator-python | Python | Missions Workflow Orchestrator - create and manage multi-step mission workflows using the Telnyx Missions API. |
| mms-photo-inventory-tracker-python | Python | MMS Photo Inventory Tracker - text a photo of inventory items with MMS, AI identifies and catalogs them automatically. |
| mms-receipt-scanner-expense-tracker-python | Python | MMS Receipt Scanner & Expense Tracker - text a photo of a receipt, AI extracts data and tracks expenses. |
| multi-channel-appointment-confirmation-python | Python | Multi-Channel Appointment Confirmation - confirm appointments via SMS, voice call, and WhatsApp. Tries SMS first, escalates to voice if no response. |
| multi-language-customer-survey-python | Python | Multi-Language Customer Survey - outbound voice surveys in the caller's language with AI analysis. |
| patient-appointment-engine-python | Python | AI answers calls, checks availability, books appointments, collects copay via Stripe, sends SMS confirmation. Staff reviews next-day schedule. |
| payment-reminder-escalation-python | Python | Invoice overdue: day 1 SMS, day 7 voice call with payment link, day 14 escalation to collections with full context. Integrates with Stripe/QuickBooks. |
| phone-number-lookup-python | Python | Look up carrier, line type, and portability data for any phone number using the Telnyx Number Lookup API, with a 24-hour in-memory cache. |
| podcast-episode-repurposer-python | Python | Upload a recorded episode, STT transcribes, AI Inference extracts key quotes and topics, TTS generates audiogram clips with different voices, SMS distributes clips to subscribers. |
| podcast-highlight-clipper-python | Python | Upload audio, STT + AI Inference identifies viral moments with virality scoring, TTS generates teaser intros for each clip, SMS distributes highlights to subscriber list. |
| post-service-followup-engine-python | Python | After appointment, SMS satisfaction survey. Negative responses trigger AI voice callback to understand the issue, then creates ticket in Jira and alerts manager via Slack. |
| prescription-refill-line-python | Python | Patient calls, AI verifies identity (DOB + last 4 of phone), checks refill eligibility, sends approval to pharmacist via Slack. Pharmacist approves/denies, patient gets SMS. |
| programmable-hold-experience-python | Python | Programmable Hold Experience - custom hold experiences: tips, trivia, estimated wait time, callback offers. |
| rcs-rich-card-product-catalog-python | Python | RCS Rich Card Product Catalog - AI-powered product recommendations with rich cards and carousels. |
| receive-mms-webhook-python | Python | Receive inbound MMS messages with a Telnyx webhook, verify the signature, and download media attachments. |
| receive-sms-webhook-csharp | C# | Receive inbound SMS via webhook with Ed25519 signature verification using C# and ASP.NET. |
| receive-sms-webhook-java | Java | Receive inbound SMS via Telnyx webhooks with a JDK HttpServer, verifying the Ed25519 signature before reading data.payload. |
| receive-sms-webhook-nodejs | Node.js | Receive inbound SMS messages via Telnyx webhooks with an Express server. Validates payloads and acknowledges within 5 seconds. |
| receive-sms-webhook-php | PHP | Receive and Ed25519-verify inbound Telnyx SMS webhooks using the Telnyx PHP SDK over a vanilla PHP front controller. |
| receive-sms-webhook-python | Python | Receive inbound SMS via webhook. |
| receive-sms-webhook-ruby | Ruby | Receive inbound SMS messages via Telnyx webhooks with a Sinatra server, verifying the Telnyx Ed25519 signature before trusting any payload. |
| rent-collection-escalation-python | Python | Automated multi-channel rent reminders. Day 1: SMS + Stripe payment link. Day 3: voice call. Day 7: late fee notice. Day 14: manager escalation. |
| returns-processor-python | Python | Customer texts photo of defective item via MMS, AI evaluates damage, auto-approves low-value refunds via Stripe, escalates high-value to team lead. |
| schedule-sms-messages-python | Python | Schedule SMS messages to be sent at a future time with the Telnyx Messaging API, backed by an APScheduler job store and a Flask job-management API. |
| send-bulk-sms-nodejs | Node.js | Send bulk SMS messages to many recipients with rate limiting and per-message error tracking using the Telnyx Messaging API and Express. |
| send-bulk-sms-python | Python | Send SMS messages to multiple recipients. |
| send-mms-picture-message-nodejs | Node.js | Send an MMS picture message with media attachments using the Telnyx Messaging API and a Node.js and Express endpoint. |
| send-mms-picture-message-python | Python | Send an MMS message with image attachments using the Telnyx Messaging API. |
| send-sms-csharp | C# | Send an SMS message using the Telnyx Messaging API with a C# minimal ASP.NET endpoint. |
| send-sms-go | Go | Send an SMS message using the Telnyx Messaging API and Go SDK, exposed over a Gin HTTP endpoint. |
| send-sms-java | Java | Send an SMS message using the Telnyx Messaging API and Java SDK, exposed over a JDK HttpServer endpoint. |
| send-sms-nodejs | Node.js | Send an SMS message using the Telnyx Messaging API with a Node.js and Express endpoint. |
| send-sms-notifications-python | Python | Production-ready Flask service that sends SMS notifications, tracks delivery status via webhooks, and exposes a small REST API. |
| send-sms-php | PHP | Send an SMS message using the Telnyx Messaging API and the Telnyx PHP SDK, exposed through a vanilla PHP front controller. |
| send-sms-python | Python | Send an SMS message using the Telnyx Messaging API. Supports delivery status webhooks. |
| send-sms-ruby | Ruby | Send an SMS message using the Telnyx Messaging API and the Telnyx Ruby SDK, exposed through a Rails controller endpoint. |
| service-booking-dispatch-python | Python | Customer calls HVAC/plumber/electrician, AI checks tech availability, books slot, collects deposit via Stripe, texts confirmation to customer and tech. |
| shift-fill-engine-python | Python | Open shift triggers calls down the availability list. First to confirm gets it, rest are cancelled. Texts confirmation + notifies manager via Slack. |
| shortcode-sms-python | Python | Send and receive two-way SMS over a Telnyx shortcode with Flask. Includes inbound webhook handling with signature verification. |
| smart-ivr-ab-tester-python | Python | Smart IVR A/B Tester - run two IVR flows simultaneously and track which converts better. |
| sms-appointment-no-show-predictor-python | Python | SMS Appointment No-Show Predictor - AI predicts no-shows from SMS response patterns, triggers interventions. |
| sms-auto-reply-bot-nodejs | Node.js | Receive inbound SMS via signed Telnyx webhooks and send automatic replies using Node.js and Express. |
| sms-auto-reply-bot-python | Python | Build an SMS autoresponder bot. |
| sms-chatbot-with-conversation-memory-python | Python | SMS Chatbot with Conversation Memory - persistent AI conversations over text with context retention. |
| sms-conversation-threading-python | Python | Group inbound and outbound SMS by contact into persistent conversation threads with the Telnyx Messaging API and a SQLAlchemy-backed store. |
| sms-delivery-receipts-nodejs | Node.js | Track SMS delivery status with Telnyx webhooks. Send messages, receive finalized delivery receipts, and look up per-message status. |
| sms-delivery-receipts-python | Python | Track SMS delivery status with Telnyx message.finalized webhooks, store delivery receipts in SQLite, and query message status over HTTP. |
| sms-drip-campaign-engine-python | Python | SMS Drip Campaign Engine - multi-step nurture sequences with branch logic and AI personalization. |
| sms-emergency-check-in-python | Python | SMS Emergency Check-In - periodic wellness checks via SMS with escalation to emergency contacts. |
| sms-escape-room-game-python | Python | SMS Escape Room Game - text-based adventure game over SMS. Solve puzzles, find clues, escape before time runs out. |
| sms-keyword-auto-responder-python | Python | SMS Keyword Auto-Responder - keyword-triggered responses with match analytics. |
| sms-marketing-campaign-python | Python | Run bulk SMS marketing campaigns with Flask and the Telnyx Messaging API - create campaigns, send rate-limited batches, and track delivery via webhooks. |
| sms-opt-out-management-python | Python | Manage SMS opt-out preferences with Telnyx. Auto-handles STOP/UNSUBSCRIBE replies via verified inbound webhooks, blocks messages to opted-out numbers, and keeps an auditable opt-out list in SQLite. |
| sms-poll-voting-system-python | Python | Text-to-vote polling with real-time results. |
| sms-survey-bot-python | Python | Run multi-question SMS surveys over the Telnyx Messaging API. Sends questions, validates inbound replies via signed webhooks, tracks per-participant progress, and exposes results. |
| sms-trivia-game-tournament-python | Python | SMS Trivia Game Tournament - multi-player trivia via SMS. Players join, answer timed questions, scores tracked on a live leaderboard. |
| sms-two-factor-auth-nodejs | Node.js | Production-ready OTP 2FA system with Node.js and Express. Generates one-time passwords, delivers them over SMS via the Telnyx Messaging API, and verifies them with expiration, attempt limits, and rate limiting. |
| sms-two-factor-auth-python | Python | Implement SMS-based two-factor authentication. |
| toll-free-sms-campaign-manager-python | Python | Toll-Free SMS Campaign Manager - manage toll-free verification and send compliant campaigns. |
| toll-free-sms-python | Python | Send SMS from a toll-free number with the Telnyx Messaging API and track delivery status via signed webhooks. |
| two-way-sms-chat-nodejs | Node.js | Send and receive SMS messages with Telnyx using Node.js and Express, with signature-verified inbound webhooks and automatic replies. |
| two-way-sms-chat-python | Python | Send and receive SMS with Telnyx to run interactive, stateful text conversations over a Flask webhook. |
| verify-multi-channel-auth-python | Python | Verify Multi-Channel Auth - multi-channel verification: SMS first, fallback to voice call, then WhatsApp. Cascading 2FA. |
| verify-phone-number-otp-flow-python | Python | Verify Phone Number OTP Flow - Telnyx Verify API with SMS primary and voice call fallback. |
| whatsapp-order-tracking-notifications-python | Python | WhatsApp Order Tracking Notifications - proactive shipping updates and AI-powered order inquiries. |
| whatsapp-sms-bridge-python | Python | WhatsApp-SMS Bridge - receive messages on WhatsApp and forward them via SMS, and vice versa. Bidirectional bridge between two messaging channels. |
| white-label-appointment-platform-python | Python | Multi-tenant SaaS that gives any service business their own AI phone line with booking, reminders, and calendar sync. Each tenant has own number, greeting, and config. |
| x402-usdc-account-funder-python | Python | X402 USDC Account Funder - fund your Telnyx account with USDC cryptocurrency on the Base blockchain. |
(88 examples)
Create, manage, and chat with Telnyx AI Assistants - LLM-powered agents for voice and messaging automation.
| Example | Language | Description |
|---|---|---|
| ai-after-hours-emergency-triage-python | Python | AI After-Hours Emergency Triage - after-hours calls screened by AI. True emergencies get forwarded to on-call; everything else gets a voicemail + next-day callback promise. |
| ai-assistant-knowledge-base-python | Python | AI Assistant Knowledge Base - AI Assistant with document knowledge base for context-aware Q&A over uploaded documents. |
| ai-assistant-multi-tool-python | Python | AI Assistant Multi-Tool - AI Assistant with custom function-calling tools for CRM lookup, appointment booking, and order status. |
| ai-assistant-phone-setup-python | Python | AI Assistant Phone Setup - create and configure a managed Telnyx AI Assistant and wire it to a phone number. |
| ai-audiobook-narrator-python | Python | Submit text, AI Inference chunks into chapters with pacing/emotion markup, TTS narrates each chapter with consistent voice, stores final audio in Telnyx Cloud Storage. |
| ai-billing-dispute-resolution-agent-python | Python | AI Billing Dispute Resolution Agent - handles billing questions with account lookup. |
| ai-call-center-quality-scorer-python | Python | AI Call Center Quality Scorer - automatically score agent performance from call recordings on compliance, empathy, resolution, and talk-to-listen ratio. |
| ai-cold-caller-objection-trainer-python | Python | AI Cold Caller Objection Trainer - practice handling sales objections with AI-generated scenarios. |
| ai-competitive-win-loss-call-analyzer-python | Python | AI Competitive Win/Loss Call Analyzer - analyze recorded sales calls for competitive intelligence. |
| ai-compliance-quiz-phone-python | Python | AI Compliance Quiz Phone - employees call and take a compliance quiz. AI asks questions, evaluates answers, scores pass/fail, records completion. |
| ai-conference-moderator-python | Python | AI moderator for multi-party calls. Manages agenda, enforces time limits, tracks speakers, produces structured summary with action items. |
| ai-conference-note-taker-python | Python | AI Conference Note-Taker - joins calls, transcribes, extracts action items, sends SMS summaries. |
| ai-content-translator-python | Python | Upload any audio (podcast, meeting, lecture), STT transcribes in source language, AI Inference translates, TTS generates audio in target language. Returns translated audio + aligned transcript. |
| ai-customer-churn-predictor-python | Python | AI Customer Churn Predictor - analyze call/message patterns via Telnyx APIs, AI predicts churn risk and suggests interventions. |
| ai-customer-winback-caller-python | Python | AI Customer Winback Caller - AI calls churned customers with personalized re-engagement offers. |
| ai-debt-collection-compliance-agent-python | Python | AI Debt Collection Compliance Agent - FDCPA-compliant outbound collection with real-time guardrails. |
| ai-deposition-assistant-python | Python | AI joins legal deposition calls, produces real-time transcript, flags objectionable questions, tracks exhibits, generates structured deposition summary. |
| ai-event-rsvp-phone-line-python | Python | AI Event RSVP Phone Line - call to RSVP for an event. AI collects guest info, dietary restrictions, plus-ones, and confirms the reservation. |
| ai-hiring-phone-screen-python | Python | AI Hiring Phone Screen - automated first-round phone screening for job applicants. |
| ai-insurance-claims-intake-voice-python | Python | AI Insurance Claims Intake - voice agent collects claim details, classifies, routes to adjuster. |
| ai-language-learning-phone-tutor-python | Python | AI Language Learning Phone Tutor - call a number, practice a foreign language with AI. |
| ai-live-call-participant-python | Python | AI joins a live multi-human conference call as an active participant. Listens via media streaming, contributes via TTS, takes notes, responds when addressed by name. |
| ai-medical-appointment-prep-caller-python | Python | AI Medical Appointment Prep Caller - calls patients before appointments to collect intake info. |
| ai-meeting-action-tracker-python | Python | Joins multi-party calls, identifies speakers, extracts action items with owners and deadlines, posts structured notes to Slack. |
| ai-negotiation-practice-phone-python | Python | AI Negotiation Practice Phone - practice salary negotiations, sales deals, or vendor contracts with an AI that plays the opposing side and scores your technique. |
| ai-phone-story-hotline-python | Python | AI Phone Story Hotline - call a number, choose a genre, and listen to an AI-generated interactive story where your choices shape the narrative. |
| ai-phone-tree-builder-from-description-python | Python | AI Phone Tree Builder - describe your business in English, AI creates a working phone system. |
| ai-podcast-call-in-show-python | Python | AI Podcast Call-In Show - callers dial in, AI screens and queues them, host manages live. |
| ai-podcast-post-producer-python | Python | AI Podcast Post-Producer - record a podcast over a conference call, then AI generates show notes, timestamps, highlights, and social media clips. |
| ai-podcast-producer-python | Python | Record a multi-host podcast via conference call, transcribe each speaker with STT, generate show notes + chapters + social clips via AI Inference, and produce TTS intro/outro bumpers. |
| ai-powered-ivr-replacement-python | Python | AI-Powered IVR Replacement - natural language routing with A/B testing and structured insights. |
| ai-price-quote-phone-agent-python | Python | AI Price Quote Phone Agent - caller describes what they need, AI generates a customized price quote in real time with line items. |
| ai-property-management-maintenance-line-python | Python | AI Property Management Maintenance Line - tenants call, AI triages maintenance requests. |
| ai-real-estate-showing-scheduler-python | Python | AI Real Estate Showing Scheduler - buyers call or text, AI checks availability and books showings. |
| ai-real-time-translation-bridge-python | Python | Connect two callers who speak different languages with real-time AI translation on a live phone call. Built with Telnyx Voice Call Control and AI Inference. |
| ai-receptionist-with-booking-tools-python | Python | AI Receptionist with Booking Tools - AI Assistant with tool_use for real calendar booking actions. |
| ai-restaurant-reservation-voice-agent-python | Python | AI Restaurant Reservation Voice Agent - handles calls, checks availability, books tables, sends SMS confirmation. |
| ai-sales-call-with-live-crm-updates-python | Python | AI Sales Call with Live CRM Updates - multi-participant call with real-time deal intelligence. |
| ai-sales-coach-whisper-python | Python | AI coach listens to a live sales call and whispers real-time suggestions to the rep only. Customer never hears the AI. Generates post-call scorecard. |
| ai-sales-demo-booking-agent-python | Python | AI Sales Demo Booking Agent - inbound calls, AI qualifies the lead, books a demo on the calendar. |
| ai-standup-facilitator-phone-python | Python | AI Standup Facilitator Phone - team members call in their daily standup update. AI collects what they did, what they're doing, and blockers, then summarizes for the team. |
| ai-tech-support-voice-agent-python | Python | IT helpdesk voice agent that answers calls, troubleshoots issues using a knowledge base, and escalates to human support via Telnyx Voice AI and Inference. |
| ai-video-dubbing-pipeline-python | Python | Upload audio, STT transcribes with speaker diarization, AI Inference translates to target language, TTS generates dubbed audio with speaker-matched voices. Full STT-to-TTS pipeline. |
| ai-voice-agent-with-function-calling-python | Python | AI Voice Agent with Function Calling - voice agent that calls external APIs mid-conversation. |
| ai-voice-memo-to-email-python | Python | AI Voice Memo to Email - call a number, dictate a memo, AI cleans it up and sends it as a formatted email via Telnyx. |
| ai-voice-survey-sentiment-tracker-python | Python | AI Voice Survey Sentiment Tracker - real-time CSAT scoring from voice tone and word choice. |
| ai-voicemail-transcription-forwarding-python | Python | AI Voicemail Transcription & Forwarding - voicemail to AI-summarized SMS/email with priority classification. |
| ai-voiceover-studio-python | Python | Upload a script, select voice/style/pacing, AI adds professional direction cues (pauses, emphasis, pacing), TTS renders the voice-over, stores output in Cloud Storage. Supports multiple takes and retakes. |
| build-voice-ai-agent-nodejs | Node.js | Build a complete voice AI agent with Telnyx - answer inbound calls, transcribe speech, generate replies with Telnyx Inference, and speak them back via Call Control. |
| build-voice-ai-agent-python | Python | Build a complete voice AI agent with Telnyx - inbound call handling, AI conversation, and call control. |
| call-recording-ai-summarizer-python | Python | Call Recording AI Summarizer - record calls, then summarize and extract action items with AI. |
| chat-with-ai-assistant-go | Go | Send messages to a Telnyx AI assistant and maintain multi-turn context with a conversation id, using a Go + Gin server. |
| chat-with-ai-assistant-java | Java | Chat with a Telnyx AI Assistant and thread a multi-turn conversation using the Telnyx Java SDK over a JDK HttpServer endpoint. |
| chat-with-ai-assistant-nodejs | Node.js | Send a message to a Telnyx AI Assistant and return its response over a production-ready Express endpoint. |
| chat-with-ai-assistant-php | PHP | Send a message to a Telnyx AI Assistant from a vanilla PHP front controller and return its reply, keeping conversation context across turns. |
| chat-with-ai-assistant-python | Python | Send messages to a Telnyx AI Assistant and receive responses. Supports conversation history and streaming. |
| chat-with-ai-assistant-ruby | Ruby | Chat with a Telnyx AI Assistant and maintain conversation context over a production-ready Sinatra endpoint using the Telnyx Ruby SDK. |
| click-to-call-webrtc-with-ai-assist-python | Python | Click-to-Call WebRTC with AI Assist - browser-based calling with real-time AI coaching sidebar. |
| clone-ai-assistant-python | Python | Clone an existing AI assistant configuration. |
| compliance-call-recorder-ai-auditor-python | Python | Compliance Call Recorder + AI Auditor - auto-record, batch-process with AI, flag violations, create tickets. |
| conference-call-with-ai-summary-python | Python | Conference Call with AI Summary - multi-party conference with transcription and AI post-call summary. |
| create-ai-assistant-nodejs | Node.js | Create a Telnyx AI Assistant over an HTTP endpoint using the Telnyx Node.js SDK and Express. |
| create-ai-assistant-python | Python | Create a new Telnyx AI Assistant with a system prompt, model selection, and tool configuration. |
| fax-to-ai-document-processor-python | Python | Fax to AI Document Processor - receive fax, AI extracts data, forwards structured summary. |
| full-stack-ai-contact-center-python | Python | Full-Stack AI Contact Center - complete contact center: IVR + queue + AI agent assist + recording + live analytics. |
| global-ip-failover-monitor-python | Python | Global IP Failover Monitor - monitor Global IP endpoints across regions, auto-failover between healthy endpoints. |
| insurance-claims-intake-python | Python | Policyholder calls, AI collects incident details, accepts photos via MMS, creates claim, assigns adjuster, texts status updates. Adjuster reviews AI-prepared claim. |
| list-ai-assistants-nodejs | Node.js | List all AI assistants in your Telnyx account using the Telnyx Node.js SDK and an Express endpoint. |
| list-ai-assistants-python | Python | List all Telnyx AI Assistants in your account with filtering and pagination. |
| maintenance-request-dispatch-python | Python | Tenant texts issue, AI categorizes and estimates cost, auto-dispatches vendor for routine work, manager approves orders over $500 via SMS reply. |
| missions-ai-task-runner-python | Python | Missions AI Task Runner - AI-driven task execution within the Telnyx Missions framework. AI decides next steps based on task results. |
| multi-channel-ai-helpdesk-with-ticketing-python | Python | Multi-Channel AI Helpdesk with Ticketing - voice + SMS + WhatsApp support with auto-ticket creation. |
| multi-party-ai-training-call-python | Python | AI plays customer roles for sales/support practice. Multiple trainees join, AI rotates scenarios and scores each trainee. |
| omnichannel-ai-receptionist-python | Python | One AI brain that handles inbound calls, SMS, and WhatsApp with unified conversation context and intelligent routing via Telnyx AI Inference. |
| policy-renewal-campaign-python | Python | Automated multi-channel renewal reminders. 60 days: SMS. 30 days: AI voice call reviewing coverage changes. 7 days: urgent SMS. Agent reviews lapsed policies for win-back. |
| restaurant-reservation-waitlist-python | Python | AI answers calls, checks table availability, books or adds to waitlist, texts when table is ready. Host reviews large party requests. |
| run-llm-inference-nodejs | Node.js | Run large language model inference through the Telnyx Inference API using an OpenAI-compatible chat completions interface from Node.js. Works as both an HTTP server and a CLI tool. |
| run-llm-inference-python | Python | Send chat completion requests to the Telnyx Inference API using an OpenAI-compatible interface from Python. |
| storage-voicemail-archive-python | Python | Storage Voicemail Archive - record voicemails to Telnyx Cloud Storage with search. |
| texml-voicemail-drop-python | Python | Leave pre-recorded voicemails at scale via TeXML. |
| three-way-ai-interpreter-python | Python | Two humans speak different languages on the same call. AI translates in real-time and speaks the translation to each party. |
| update-ai-assistant-python | Python | Update an existing Telnyx AI Assistant's configuration, model, system prompt, and tools via the API. |
| video-room-ai-meeting-moderator-python | Python | Video Room AI Meeting Moderator - create video rooms with AI-powered agenda tracking and time management. |
| video-room-ai-moderator-python | Python | Video Room AI Moderator - create video rooms with AI-powered content moderation on chat and participant management. |
| voice-journal-daily-log-python | Python | Voice Journal Daily Log - call a number, speak your daily journal entry, AI transcribes and organizes it with mood, topics, and gratitude extraction. |
| warm-transfer-ai-briefing-python | Python | When an agent transfers a call, AI summarizes the conversation and briefs the next agent before connecting. No cold handoffs. |
| webhook-debugger-ai-assistant-python | Python | Webhook Debugger AI Assistant - catch, inspect, and debug Telnyx webhooks with AI explanations. |
| webrtc-ai-interpreter-live-calls-python | Python | WebRTC AI Interpreter for Live Calls - real-time translation between two callers speaking different languages. |
(13 examples)
Connect your PBX or SBC to Telnyx SIP Trunking - trunk setup, inbound routing, failover, and codec configuration.
| Example | Language | Description |
|---|---|---|
| configure-sip-codecs-python | Python | Configure audio codecs for SIP trunks. |
| inbound-sip-routing-nodejs | Node.js | Create and manage Telnyx SIP connections for inbound call routing, and receive inbound call webhooks, using Node.js and Express. |
| inbound-sip-routing-python | Python | Route inbound SIP calls to your endpoints. |
| setup-sip-trunk-csharp | C# | Create, list, and retrieve credential-authenticated SIP connections using the Telnyx.net SDK and minimal ASP.NET. |
| setup-sip-trunk-go | Go | Create, list, and retrieve Telnyx SIP trunk connections via a Go and Gin REST API. |
| setup-sip-trunk-java | Java | Create, list, and retrieve credential-authenticated Telnyx SIP connections with the Telnyx Java SDK and the JDK's built-in HTTP server. |
| setup-sip-trunk-nodejs | Node.js | Create, retrieve, and list credential-authenticated SIP connections using the Telnyx SIP Trunking API. |
| setup-sip-trunk-php | PHP | Create, list, and retrieve a Telnyx credential (SIP) connection using the Telnyx PHP SDK over a vanilla PHP front controller. |
| setup-sip-trunk-python | Python | Provision and configure a SIP trunk connection on Telnyx with codec preferences, authentication, and failover. |
| setup-sip-trunk-ruby | Ruby | Create, list, and retrieve credential-authenticated SIP connections using the Telnyx SIP Trunking API with Ruby and Sinatra. |
| sip-failover-routing-python | Python | Configure failover routing for SIP connections. |
| sip-load-balancer-health-check-python | Python | SIP Load Balancer Health Check - monitor SIP trunk health across multiple endpoints, auto-failover to healthy trunks, track uptime metrics. |
| sip-trunking-failover-monitor-python | Python | SIP Trunking Failover Monitor - health-check SIP connections, auto-failover, SMS alerts. |
(17 examples)
Activate SIM cards, monitor data usage, provision eSIMs, and track device locations with the Telnyx IoT platform.
| Example | Language | Description |
|---|---|---|
| activate-sim-card-csharp | C# | Enable (activate) a SIM card on the Telnyx network using C# and ASP.NET. |
| activate-sim-card-go | Go | Activate a Telnyx IoT SIM card over HTTP using the Telnyx Go SDK and Gin. |
| activate-sim-card-java | Java | Activate a Telnyx IoT SIM card over HTTP using the Telnyx Java SDK and the JDK HttpServer. |
| activate-sim-card-nodejs | Node.js | Retrieve and activate a Telnyx IoT SIM card by ID using the Telnyx Node.js SDK over an Express API. |
| activate-sim-card-php | PHP | Enable (activate) a Telnyx IoT SIM card by ID using the Telnyx PHP SDK over a vanilla PHP front controller. |
| activate-sim-card-python | Python | Activate a SIM card on the Telnyx network. |
| activate-sim-card-ruby | Ruby | Activate a Telnyx IoT SIM card using Ruby and Sinatra. |
| iot-fleet-alert-escalation-python | Python | IoT Fleet Alert Escalation - severity-based routing from IoT sensors to SMS, calls, and multi-party conferences. |
| iot-panic-button-voice-alert-python | Python | IoT Panic Button Voice Alert - IoT device triggers SIM-based alert, system calls emergency contacts with location and status. |
| iot-smart-building-voice-control-python | Python | IoT Smart Building Voice Control - call a number to control building systems via AI + IoT SIMs. |
| monitor-iot-data-usage-nodejs | Node.js | Monitor Telnyx IoT SIM card data usage with an Express server that polls usage on an interval and exposes REST endpoints for per-SIM consumption and threshold alerts. |
| monitor-iot-data-usage-python | Python | Production-ready Flask application for monitoring SIM card data usage via Telnyx IoT API. |
| provision-esim-python | Python | Provision eSIM profiles over the air. |
| sim-fleet-data-usage-anomaly-detector-python | Python | SIM Fleet Data Usage Anomaly Detector - monitor IoT SIM usage, AI detects anomalies, SMS alerts. |
| track-iot-device-location-python | Python | Production-ready Flask application for device location tracking via Telnyx IoT API. |
| voice-activated-iot-command-python | Python | Voice-Activated IoT Command - call a number, speak commands to control IoT devices. AI interprets natural language into device actions dispatched via SIM API. |
| wireless-fleet-activation-portal-python | Python | Bulk activate SIMs with status tracking. |
Telnyx is an AI Communications Infrastructure platform that provides a single, integrated API for:
- Voice AI - Programmable voice with Call Control, IVR, recording, conferencing, and WebRTC.
- SMS & MMS - Send and receive messages globally with delivery receipts and webhook events.
- SIP Trunking - Connect your existing PBX with elastic SIP trunks, failover routing, and codec control.
- AI Assistants - Deploy LLM-powered voice and messaging agents with built-in telephony.
- IoT & SIM - Global IoT connectivity with SIM management, eSIM provisioning, and data monitoring.
Unlike stitching together multiple vendors into a Frankenstack, Telnyx gives you one platform, one API key, and one bill. Calls and messages traverse the Telnyx-owned private IP network for lower latency and higher reliability.
- Sign up at portal.telnyx.com.
- Navigate to API Keys in the left sidebar.
- Click Create API Key and copy the key.
- Add it to your
.envfile asTELNYX_API_KEY=your_key_here.
Telnyx offers free trial credit for testing.
Q: What programming languages are supported?
These examples cover Python, Node.js, Go, and Ruby. Telnyx also provides official SDKs for Java, PHP, and C#.
Q: Are these examples production-ready?
Yes. Every example includes error handling, environment-based configuration, and Telnyx webhook signature verification. Review security and scaling considerations before deploying to production.
Q: How is Telnyx different from Twilio?
Telnyx is an AI Communications Infrastructure platform with a private global network. It offers integrated voice, messaging, AI, SIP, and IoT under one API - no need to stitch together multiple vendors. Telnyx also offers significantly lower pricing with no per-seat fees or contracts. See a detailed Telnyx vs Twilio comparison.
Q: Do I need multiple vendors for voice, SMS, and AI?
No. Telnyx provides voice, SMS/MMS, SIP trunking, AI assistants, and IoT SIM management through a single platform and API key.
Q: Can I use these examples with my existing PBX?
Yes. The SIP trunking examples show how to connect Telnyx to Asterisk, FreeSWITCH, 3CX, and other PBX systems.
Q: Is there a free tier?
Telnyx provides trial credit when you sign up. After that, pricing is pay-as-you-go with no minimums or contracts.
Q: How do I get help?
Check the Troubleshooting section in each example, visit developers.telnyx.com, or reach out to support@telnyx.com.
See CONTRIBUTING.md for guidelines on adding new examples.