๐ฌ Serve text-to-speech MP3 over a webhook with Smallest.ai
โก 25 views ยท ๐ฌ Content Creation & Video
Description
Quick Overview
This workflow exposes a POST webhook that converts incoming text into an MP3 audio stream using Smallest.ai, optionally using a provided custom voice ID, and returns the audio inline in the same HTTP response.
How it works
- Receives a POST request on the
/text-to-speechwebhook endpoint with a JSON body. - Checks whether the request includes a
voicefield to indicate a custom voice ID. - If a custom voice ID is provided, sends the text and voice ID to Smallest.ai to generate an MP3 with that voice.
- If no voice ID is provided, sends the text to Smallest.ai to synthesize an MP3 using the default voice settings.
- Returns the generated MP3 as binary data to the caller with
Content-Type: audio/mpegand an inline filename ofspeech.mp3.
Setup
- Add your Smallest.ai API credentials in both Smallest.ai speech generation steps.
- Activate the workflow and copy the production webhook URL, then configure your client to POST to
/text-to-speech. - Send requests with a JSON payload containing
text(required) andvoice(optional custom voice ID).
๐ Nodes Used
Webhook
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File