cd /news/artificial-intelligence/i-built-a-one-curl-audio-translator-… · home topics artificial-intelligence article
[ARTICLE · art-59663] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

I Built a One-Curl Audio Translator with Telnyx AI Inference

Telnyx released a one-curl audio translator built with its AI Inference API, combining speech-to-text, chat completions, and text-to-speech into a single Flask app. The tool translates audio files by transcribing, translating, and re-synthesizing speech, with error handling that preserves partial results. The open-source code example is available on GitHub.

read2 min views1 publishedJul 14, 2026

Localizing a podcast, translating a recorded meeting, or dubbing a lecture used to require three different services stitched together. The Telnyx AI Inference API exposes STT, chat completions, and TTS on the same private backbone, which means a single Flask app can run the whole pipeline.

The Telnyx code example is:

https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python

It is a Python Flask app you can clone and run in a few minutes. No phone number, no webhook tunnel, no background job runner.

You POST an audio file plus a target language. The app calls Telnyx STT to transcribe the audio in the source language, calls AI Inference to translate the transcript with a TTS-friendly system prompt, and calls Telnyx TTS to render the translated text into audio. Long transcripts are chunked at sentence boundaries so the TTS model never gets an input larger than it supports, and the chunks are concatenated into one mp3.

The response includes the job id, both transcripts, and a URL you can curl to download the dubbed audio.

It is small enough to demo live, but it covers the parts that often get cut from an audio translation demo:

The design choice I care most about is per-stage error handling. If the TTS call fails on chunk 3 of 8, the app returns 200 partial

with the transcripts still intact, rather than throwing away the STT and translation work.

git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/ai-content-translator-python
cp .env.example .env
pip install -r requirements.txt
python app.py

Translate a Spanish clip into English:

curl -X POST http://localhost:5000/translate \
  -F audio=@spanish-sample.mp3 \
  -F source=es \
  -F target=en

Download the dubbed audio:

curl -OJ http://localhost:5000/translate/<job_id>/audio

Read the full transcripts:

curl http://localhost:5000/translate/<job_id> | python3 -m json.tool

I would keep the demo short:

/languages

endpoint to call out the supported set.target=en

and walk through the response shape (job_id, transcript previews, audio_url).GET /translate/<job_id>

for the full transcripts.source=auto

to show language detection.That gives viewers the full loop without getting lost in implementation details.

The demo keeps translation jobs in memory for one hour. Production would replace the in-memory jobs

dict with object storage (S3, GCS) for the audio blobs and a database (Postgres) for the metadata, run STT / translate / TTS in a queue, return 202 Accepted

for long jobs, add API key auth, and cap upload size and audio length up front.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @telnyx 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-one-curl-a…] indexed:0 read:2min 2026-07-14 ·