Serve text-to-speech MP3 over a webhook with Smallest.ai

Go to Workflow
3 views
Built by Zain Khan Zain Khan
Created on July 28, 2026

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-speech webhook endpoint with a JSON body.
Checks whether the request includes a voice field 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/mpeg and an inline filename of speech.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) and voice (optional custom voice ID).