{"slug": "ai-audio-translator-with-speech-to-text-llm-translation-and-text-to-speech", "title": "AI audio translator with speech-to-text, LLM translation, and text-to-speech", "summary": "Telnyx launched an AI content translator that transcribes audio via speech-to-text, translates using an LLM, and generates translated audio with text-to-speech. The tool returns translated audio and an aligned transcript, leveraging Telnyx's AI communications infrastructure for sub-200ms inference.", "body_md": "| name | ai-content-translator | ||\n|---|---|---|---|\n| title | AI Content Translator | ||\n| description | 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. | ||\n| language | python | ||\n| framework | flask | ||\n| telnyx_products |\n|\n||\n| integrations | |||\n| channel |\n|\n\nUpload any audio (podcast, meeting, lecture), STT transcribes in source language, AI Inference translates, TTS generates audio in target language. Returns translated audio + aligned transcript.\n\n**STT Transcribe**:`POST /v2/ai/transcribe`\n\n--[ref](https://developers.telnyx.com/api/inference/transcribe)**AI Inference**:`POST /v2/ai/chat/completions`\n\n--[ref](https://developers.telnyx.com/api/inference/chat-completions)**TTS Generate**:`POST /v2/ai/generate`\n\n--[ref](https://developers.telnyx.com/api/inference/generate)\n\n```\n  API Request\n        │\n        ▼\n  ┌──────────────────┐\n  │ Answer + Greet    │ ── TTS welcome message\n  └────────┬─────────┘\n           │\n           ▼\n  ┌──────────────────┐\n  │ Gather Speech     │ ── STT transcription\n  └────────┬─────────┘\n           │\n           ▼\n  ┌──────────────────┐\n  │ AI Inference      │\n  │ • Translation      │\n  └────────┬─────────┘\n           │ ◄──── conversation loop\n           │\n           ▼\n     JSON response\n```\n\n- Sends conversation to Telnyx AI Inference for processing\n- Converts response to speech via Telnyx TTS\n\nTelnyx is an **AI Communications Infrastructure** platform - voice, messaging, SIP, AI, and IoT on one private, global network.\n\n**Co-located inference**- LLM runs on the same network as voice traffic. Sub-200ms round trips.\n\nCopy `.env.example`\n\nto `.env`\n\nand fill in:\n\n| Variable | Type | Example | Required | Description | Where to get it |\n|---|---|---|---|---|---|\n`TELNYX_API_KEY` |\n`string` |\n`KEY0123456789ABCDEF` |\nyes |\nTelnyx API v2 key |\n|\n\n`AI_MODEL`\n\n`string`\n\n`moonshotai/Kimi-K2.6`\n\n[Docs](https://developers.telnyx.com/docs/inference/models)`TTS_MODEL`\n\n`string`\n\n`telnyx/tts`\n\n[Docs](https://developers.telnyx.com/docs/inference)`STT_MODEL`\n\n`string`\n\n`telnyx/asr`\n\n[Docs](https://developers.telnyx.com/docs/inference)\n\n```\ngit clone https://github.com/team-telnyx/telnyx-code-examples.git\ncd telnyx-code-examples/ai-content-translator-python\ncp .env.example .env\npip install -r requirements.txt\npython app.py\nngrok http 5000\n```\n\nSet webhook URL in [Telnyx Portal](https://portal.telnyx.com):\n\n- Call Control Application ->\n`https://<id>.ngrok.io/webhooks/voice`\n\nUpload as multipart form:\n\n```\ncurl -X POST http://localhost:5000/translate \\\n  -F audio=@lecture.mp3 \\\n  -F source=en \\\n  -F target=ja\n```\n\n**Response:**\n\n```\n{\"job_id\": \"tr-a1b2c3d4\", \"status\": \"complete\", \"source\": \"en (English)\", \"target\": \"ja (Japanese)\", \"original_length\": 1847, \"translated_length\": 923}\ncurl http://localhost:5000/health\n{\"status\": \"ok\"}\n```\n\n**Connection refused on port 5000**: App isn't running. Run`python app.py`\n\nand check no other process uses port 5000.**401 Unauthorized**: Your`TELNYX_API_KEY`\n\nis invalid. Generate a new one at[portal.telnyx.com/api-keys](https://portal.telnyx.com/api-keys).**AI response slow/empty**: Verify model name. See available models at[developers.telnyx.com](https://developers.telnyx.com/docs/inference/list-models).\n\n[run-llm-inference-python](https://raw.githubusercontent.com/team-telnyx/telnyx-code-examples/main/run-llm-inference-python/README.md)- Standalone inference[build-voice-ai-agent-python](https://raw.githubusercontent.com/team-telnyx/telnyx-code-examples/main/build-voice-ai-agent-python/README.md)- Voice AI agent", "url": "https://wpnews.pro/news/ai-audio-translator-with-speech-to-text-llm-translation-and-text-to-speech", "canonical_source": "https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python", "published_at": "2026-06-26 21:50:51+00:00", "updated_at": "2026-06-26 22:07:58.163696+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-products", "ai-infrastructure"], "entities": ["Telnyx", "Kimi-K2.6", "Flask", "Python", "ngrok"], "alternates": {"html": "https://wpnews.pro/news/ai-audio-translator-with-speech-to-text-llm-translation-and-text-to-speech", "markdown": "https://wpnews.pro/news/ai-audio-translator-with-speech-to-text-llm-translation-and-text-to-speech.md", "text": "https://wpnews.pro/news/ai-audio-translator-with-speech-to-text-llm-translation-and-text-to-speech.txt", "jsonld": "https://wpnews.pro/news/ai-audio-translator-with-speech-to-text-llm-translation-and-text-to-speech.jsonld"}}