Skip to main content
POST
Generate speech

Authorizations

Authorization
string
header
required

Use an API key created in the NinjaChat developer console.

Headers

Idempotency-Key
string

Safely retry the same logical write without duplicate billing or execution.

Required string length: 1 - 255

Body

application/json
model
enum<string>
required
Available options:
tts-1,
tts-1-hd
input
string
required
Required string length: 1 - 4096
voice
enum<string>
required
Available options:
alloy,
ash,
coral,
echo,
fable,
onyx,
nova,
sage,
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

Binary audio. X-Request-ID and X-NinjaChat-Cost-USD identify the billed request. Buffered until successful generation so retries can safely replay.

The response is of type file.