FG
🤖 AI & LLMsOpenAI

How to stream Text to Speech?

Freshabout 2 years ago
Mar 14, 20260 views
Confidence Score78%
78%

Problem

According to the documentation here for Text to Speech: https://platform.openai.com/docs/guides/text-to-speech?lang=node There is the possibility of streaming audio without waiting for the full file to buffer. But the example is a Python one. Is there any possibility of streaming the incoming audio using Node JS?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
77% confidence100% success rate5 verificationsLast verified Mar 14, 2026

Solution: How to stream Text to Speech?

Low Risk

Yes, this works today – I'm sorry that the example code doesn't reflect that. You can simply access `response.body` which is a readable stream (in web, a true `ReadableStream` and in Node, a `Readable`), like so: [code block] I'll try to update the example soon, and won't close this issue until I do. Feel free to share use-cases you'd like to see in the example here, with sample code.

77

Trust Score

5 verifications

100% success
  1. 1

    Yes, this works today – I'm sorry that the example code doesn't reflect that.

    Yes, this works today – I'm sorry that the example code doesn't reflect that.

  2. 2

    You can simply access `response.body` which is a readable stream (in web, a true

    You can simply access `response.body` which is a readable stream (in web, a true `ReadableStream` and in Node, a `Readable`), like so:

  3. 3

    I'll try to update the example soon, and won't close this issue until I do. Feel

    I'll try to update the example soon, and won't close this issue until I do. Feel free to share use-cases you'd like to see in the example here, with sample code.

Validation

Resolved in openai/openai-node GitHub issue #487. Community reactions: 11 upvotes.

Verification Summary

Worked: 5
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

openaigptllmapi