Skip to main content

Text-to-Speech

Convert text to audio.

Try It

POST/v1/audio/speechhttps://api-platform.ope.ai

Authentication

Uses Bearer Token authentication.

  • Header: Authorization: Bearer <token>
  • Example: Authorization: Bearer sk-xxxxxx

Request body (application/json)

FieldTypeRequiredDescriptionDefault / Range
modelstringYesModel ID-
textstringYesText to convertLength <= 4096
voicestringYesVoiceEach model supports different voices, please check specific model documentation
response_formatstringNoAudio formatDefault "mp3"; "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"
speednumberNoSpeedDefault 1; Range 0.1~4

Request examples

The domain below is an example: https://api-platform.ope.ai.

curl -X POST "https://api-platform.ope.ai/v1/audio/speech" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "AudioLLM/Voice1.0",
"text": "Supports multi-scenario customization for advertising voiceovers, tutorial narrations, and more",
"voice": "James"
}' --output speech.mp3

Response example

  • 200: audio/mpeg (binary audio data, saved as speech.mp3 in examples)