Stream audio in real-time as it’s being generated. This is ideal for live reading applications where you want to start playing audio before the entire text is processed.
curl -X POST https://api.gistmag.co.uk/tts/stream \ -H "Content-Type: application/json" \ -d '{ "text": "This is a long text that will be streamed in chunks...", "language": "en", "chunk_size": 200, "api_key": "your_api_key_here" }' \ --output stream.mp3
import requestsresponse = requests.post( "https://api.gistmag.co.uk/tts/stream", json={ "text": "This is a long text...", "language": "en", "chunk_size": 200, "api_key": "your_api_key_here" }, stream=True)with open("stream.mp3", "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk)