Text to speech
POSThttps://api.minih3.dev/v1/audio/speech
This call is billed to your account. Price: MiniH3 TTS: $0.1 per 1,000 characters of input
Purpose: turn text into speech, compatible with the OpenAI audio/speech endpoint. The public speech model is minih3-tts, with 39 preset voices; cloned voices are not supported.
Billing: by the characters in input (Unicode characters: one CJK character or one Latin letter counts as 1), $0.1 per 1,000. No audio or a failed request is not charged.
Returns: on success the body is the audio file itself (not JSON), with Content-Type audio/mpeg for mp3, audio/wav for wav, audio/pcm for pcm and audio/ogg for opus, at 24 kHz. Errors come back as JSON.
Voices and languages: the 30 en_ voices read English, and also Latin-script text such as Malay; for Chinese use one of the 9 multilingual multi_ voices.
Errors (none is charged): a voice outside the list is 400 invalid_voice (OpenAI voice names such as alloy or nova are not accepted either); a voice that cannot read the text's language (Chinese on an en_ voice, say) is 400 unsupported_language, so switch to a multi_ voice; text the voice cannot read (only emoji or symbols, say) is 400 invalid_input, so send plain words; text too long for one request is 400 text_too_long, so split it and send the parts separately; a failure of the voice service itself is 502 upstream_failed, so retry.
Notes: for a 24-hour audio URL that drops straight into the remake workflow, use the voice tool POST /v1/tools/voice.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
model | body | string | yes | -minih3-tts |
input | body | string | yes | The text to speak; billed on its character count |
voice | body | string | yes | One of the 39 preset voices en_female_amanda_mars_bigttsen_female_anna_mars_bigttsen_female_candice_emo_v2_mars_bigttsen_female_dacey_conversation_wvae_bigttsen_female_daisy_moon_bigttsen_female_emily_mars_bigttsen_female_product_darcie_moon_bigttsen_female_lauren_moon_bigttsen_female_sarah_new_conversation_wvae_bigttsen_female_nadia_tips_emo_v2_mars_bigttsen_female_nara_moon_bigttsen_female_onez_moon_bigttsen_female_emotional_moon_bigttsen_female_sarah_mars_bigttsen_female_skye_emo_v2_mars_bigttsen_male_adam_mars_bigttsen_male_bruce_moon_bigttsen_male_corey_emo_v2_mars_bigttsen_male_dave_moon_bigttsen_male_dryw_mars_bigttsen_male_campaign_jamal_moon_bigttsen_male_glen_emo_v2_mars_bigttsen_male_chris_moon_bigttsen_male_hades_moon_bigttsen_male_jackson_mars_bigttsen_male_michael_moon_bigttsen_male_charlie_conversation_wvae_bigttsen_male_smith_mars_bigttsen_male_sylus_emo_v2_mars_bigttsen_male_jason_conversation_wvae_bigttsmulti_female_maomao_conversation_wvae_bigttsmulti_female_sophie_conversation_wvae_bigttsmulti_female_gaolengyujie_moon_bigttsmulti_female_shuangkuaisisi_moon_bigttsmulti_male_xudong_conversation_wvae_bigttsmulti_male_M100_conversation_wvae_bigttsmulti_male_jingqiangkanye_moon_bigttsmulti_zh_male_youyoujunzi_moon_bigttsmulti_male_wanqudashu_moon_bigtts |
response_format | body | string | no | -mp3wavpcmopus |
speed | body | number | no | - |
Code samples
curl -X POST "https://api.minih3.dev/v1/audio/speech" \
-H "Authorization: Bearer $MINIH3_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minih3-tts",
"input": "Four things I learned the hard way.",
"voice": "en_male_adam_mars_bigtts",
"response_format": "mp3"
}'Try it
Kept in this browser tab only (sessionStorage) and sent straight to api.minih3.dev; it never reaches this site.
Enter your key to send.Responses
200
Audio file
400
Error
401
Error
403
Error
429
Error
502
Error