OpenAI TTS API SDKs for JavaScript, Python, Ruby, Go, Java, and PHP on RunAPI.
Generate MP3 speech from text with tts-1 or tts-1-hd. RunAPI validates and stores each audio result before returning it.
Install
npm install @runapi.ai/openai-tts
pip install runapi-openai-tts
gem install runapi-openai-tts
go get github.com/runapi-ai/openai-tts-sdk/go@latestFor Java, install ai.runapi:runapi-openai-tts:0.1.1. The PHP package is released from the split repository at https://github.com/runapi-ai/openai-tts-php.
Quick start
import { OpenaiTtsClient } from '@runapi.ai/openai-tts';
const client = new OpenaiTtsClient();
const result = await client.textToSpeech.run({ model: 'tts-1', text: 'Hello from RunAPI' });
console.log(result.audios[0].url);Variants
The returned URL points to RunAPI-managed storage. See the OpenAI TTS model page for current pricing, limits, and usage details.
License
Licensed under the Apache License, Version 2.0.