Skip to main content
POST
/
v1
/
predictions
curl --request POST \
  --url https://api.shuyou.ai/v1/predictions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gemini-3.1-flash-tts-preview",
  "function": "audio",
  "input": {
    "prompt": "Say cheerfully: Have a wonderful day!",
    "style_instructions": "Say the following in a warm, upbeat tone.",
    "voice": "Kore",
    "language": "en-US",
    "output_format": "mp3"
  },
  "webhook": "https://api.shuyou.ai/backend/api/callback"
}
'
{
  "data": {
    "task_id": "2c4d50261173430290971a2395a3b607",
    "task_status": "processing"
  }
}

Prompt (input.prompt)

Required. Text to synthesize (max 32,000 characters). Supports expressive markup tags in the text:
TagEffect
[sigh]Sigh
[laughing]Laughter
[whispering]Whisper
[shouting]Shout
[extremely fast]Very fast delivery

Style instructions (input.style_instructions)

Optional (max 1,000 characters). Natural-language directions for tone, pace, accent, and emotion. Default: Say the following.

Voice presets (input.voice)

Optional. Default Kore.
voice
Achernar
Achird
Algenib
Algieba
Alnilam
Aoede
Autonoe
Callirrhoe
Charon
Despina
Enceladus
Erinome
Fenrir
Gacrux
Iapetus
Kore
Laomedeia
Leda
Orus
Pulcherrima
Puck
Rasalgethi
Sadachbia
Sadaltager
Schedar
Sulafat
Umbriel
Vindemiatrix
Zephyr
Zubenelgenubi

Language (input.language)

Optional BCP-47 language code. Default en-US.
CodeCodeCodeCode
af-ZAam-ETar-001ar-EG
az-AZbe-BYbg-BGbn-BD
ca-ESceb-PHcmn-CNcmn-tw
cs-CZda-DKde-DEel-GR
en-AUen-GBen-INen-US
es-419es-ESes-MXet-EE
eu-ESfa-IRfi-FIfil-PH
fr-CAfr-FRgl-ESgu-IN
he-ILhi-INhr-HRht-HT
hu-HUhy-AMid-IDis-IS
it-ITja-JPjv-JVka-GE
kn-INko-KRkok-INla-VA
lb-LUlo-LAlt-LTlv-LV
mai-INmg-MGmk-MKml-IN
mn-MNmr-INms-MYmy-MM
nb-NOne-NPnl-NLnn-NO
or-INpa-INpl-PLps-AF
pt-BRpt-PTro-ROru-RU
sd-INsi-LKsk-SKsl-SI
sq-ALsr-RSsv-SEsw-KE
ta-INte-INth-THtr-TR
uk-UAur-PKvi-VN

Output format (input.output_format)

Optional. Default mp3.
ValueDescription
mp3MP3 audio
wavWAV audio
ogg_opusOgg Opus audio

Authorizations

Authorization
string
header
required

Authorization: Bearer YOUR_API_KEY

Body

application/json
model
enum<string>
default:gemini-3.1-flash-tts-preview
required

Model ID. Use gemini-3.1-flash-tts-preview for this endpoint.

Available options:
gemini-3.1-flash-tts-preview
Example:

"gemini-3.1-flash-tts-preview"

function
enum<string>
required

Task type. Must be audio for text-to-speech.

Available options:
audio
Example:

"audio"

input
object
required
webhook
string<uri>

Optional HTTPS callback URL when the task completes, fails, or is cancelled.

Response

Async task created

data
object
required