Skip to content

OmniVoice

POST /v1/audio/speech model: OmniVoice
EndpointPOST /v1/audio/speech
Inputtext, 1–4,096 characters
Outputone audio file, 24 kHz mono: wav (default), mp3, opus, flac or pcm
Streaming❌ — the whole file arrives in one response
Voicea preset, a free-text description, or a cloned reference clip
Billingper input character; the input rate on the card applies per million characters
Stabilityexperimental
Field
modelrequiredOmniVoice
inputrequiredthe text to speak, 1–4,096 characters
voiceoptionala preset, see below. Default auto
instructionsoptionaldescribe the voice in words, up to 512 characters, e.g. "male, low pitch, british accent". Takes precedence over voice
response_formatoptionalwav (default), mp3, opus, flac, pcm
speedoptional0.25–4.0
languageoptionala language code such as en or zh; omit it to let the model decide from the text
ref_audiooptionala voice to clone: base64 or a data: URL of a WAV, FLAC, OGG or MP3 clip, at most 30 s (3–10 s works best)
ref_textoptionalthe transcript of ref_audio
durationoptionaltarget length of the output in seconds, up to 600
num_stepoptionaldiffusion steps, 1–64. Fewer is faster and rougher
seedoptionalthe same seed with the same request returns identical audio

Presets for voice: auto, female, male, female-low, male-low, female-british, male-british, female-american, male-american. OpenAI voice names such as alloy are rejected with unsupported_voice.

Send a short clip in ref_audio and leave out voice and instructions — combining them is a 400 (invalid_parameters). Include ref_text: without it the clip is transcribed first, which in our tests took about 17 s instead of 4 s. The whole request body must stay under 5 MB.

Only clone a voice you have the right to use.

The body is the audio file itself. Content-Type follows response_format:

response_formatContent-Type
wavaudio/wav16-bit PCM
mp3audio/mpeg
opusaudio/oggOpus in an Ogg container
flacaudio/flac
pcmaudio/pcmraw 16-bit little-endian samples, 24 kHz mono, no header

Errors are JSON in the usual shape, with these codes:

StatuscodeCause
400invalid_parametersinput empty or over 4,096 characters, ref_audio combined with voice/instructions, or ref_text without ref_audio
400unsupported_voicevoice is not one of the presets
400unsupported_response_formate.g. aac
400invalid_ref_audiothe clip cannot be decoded, is empty, or is longer than 30 s
400unsupported_stream_formatstream_format: "sse" was sent
503server_busytoo many requests queued; retry after a short wait
Terminal window
curl https://developer.amd.com.cn/radeon/api/v1/audio/speech \
-H "Authorization: Bearer $RADEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "OmniVoice",
"input": "Hello from Radeon Cloud.",
"voice": "female",
"response_format": "mp3"
}' \
-o speech.mp3

Cloning a voice from sample.wav:

import base64, requests
ref = base64.b64encode(open("sample.wav", "rb").read()).decode()
r = requests.post(
"https://developer.amd.com.cn/radeon/api/v1/audio/speech",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "OmniVoice",
"input": "This sentence is spoken in the voice from the clip.",
"ref_audio": f"data:audio/wav;base64,{ref}",
"ref_text": "The words spoken in sample.wav.",
"response_format": "wav",
},
timeout=120,
)
r.raise_for_status()
open("cloned.wav", "wb").write(r.content)

The OmniVoice code is Apache-2.0 and the model weights are CC-BY-NC (non-commercial). The audio tokenizer is licensed under the Boson Higgs Audio 2 Community License, which asks us to show:

Built with Higgs Materials licensed from Boson AI USA, Inc., Copyright Boson AI USA, Inc., All Rights Reserved and Meta Llama 3 licensed under the Meta Llama 3 Community License, Copyright Meta Platforms, Inc., All Right Reserved. Based on Meta Llama 3.