POST
/
v1
/
audio
/
speech
curl -X POST "https://api.applerouter.ai/v1/audio/speech" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Hello! Welcome to AppleRouter.",
    "voice": "alloy"
  }' \
  --output speech.mp3
Content-Type: audio/mpeg

[Binary audio data]

Overview

Generates natural-sounding speech from text input.
model
string
required
TTS Model (e.g. tts-1, tts-1-hd)
input
string
required
Text to convert to speech (max 4096 characters)
voice
string
required
Voice to use: alloy, echo, fable, onyx, nova, or shimmer
response_format
string
Audio format: mp3, opus, aac, flac, wav, or pcm
speed
number
Speed (0.25 to 4.0, default 1.0)
curl -X POST "https://api.applerouter.ai/v1/audio/speech" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Hello! Welcome to AppleRouter.",
    "voice": "alloy"
  }' \
  --output speech.mp3
Content-Type: audio/mpeg

[Binary audio data]

Available Voices

VoiceDescription
alloyNeutral and balanced
echoWarm and conversational
fableExpressive and energetic
onyxDeep and authoritative
novaFriendly and optimistic
shimmerClear and professional

Authorizations

Authorization
string
header
required

使用 Bearer Token 认证。格式: Authorization: Bearer sk-xxxxxx

Body

application/json
model
string
required
Example:

"tts-1"

input
string
required

要转换的文本

Maximum string length: 4096
voice
enum<string>
required
Available options:
alloy,
echo,
fable,
onyx,
nova,
shimmer
response_format
enum<string>
default:mp3
Available options:
mp3,
opus,
aac,
flac,
wav,
pcm
speed
number
default:1
Required range: 0.25 <= x <= 4

Response

200 - audio/mpeg

成功生成音频

The response is of type file.