Skip to main content

REST API

Authentication​

Send your quota API key with each request. Bearer auth is preferred.

curl https://api.example.com/v2/audio/speech \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ishikawa","voice":"Dennis","input":"Hello world."}' \
--output speech.mp3

X-Api-Key and X-API-Key are also accepted.

Create Speech​

POST /v2/audio/speech
Content-Type: application/json

Request Body​

FieldTypeRequiredDefaultDescription
modelStringYes—Public TTS model. Currently only ishikawa.
voiceStringYes—Voice ID, for example Dennis.
inputStringYes—Text to synthesize, 1-2,000 characters.
languageStringNoautoOptional language code. Use auto or one of the supported short codes below.
response_formatStringNomp3One of mp3, opus, wav, pcm.
speedNumberNoProvider defaultSpeaking rate from 0.5 to 1.5.

Language​

The API accepts short language codes, not provider-specific BCP-47 tags. For example, send en, not en-US.

If language is omitted or set to auto, the API tries to detect the language from input. When detection is confident and the detected language is supported, the detected language is passed to the TTS provider. When detection is not confident, no language is passed and the provider default is used.

Supported values:

CodeLanguage
autoAuto-detect
enEnglish
esSpanish
frFrench
deGerman
itItalian
ptPortuguese
plPolish
ruRussian
nlDutch
arArabic
zh-cnChinese (Simplified)
jaJapanese
koKorean
hiHindi
heHebrew

Example: MP3​

curl https://api.example.com/v2/audio/speech \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "ishikawa",
"voice": "Dennis",
"input": "Hello, this is generated speech.",
"response_format": "mp3"
}' \
--output speech.mp3

Example: WAV With Language​

curl https://api.example.com/v2/audio/speech \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "ishikawa",
"voice": "Dennis",
"input": "Buongiorno, piacere di conoscerti.",
"language": "it",
"response_format": "wav",
"speed": 1.05
}' \
--output speech.wav

Example: Auto Language Detection​

curl https://api.example.com/v2/audio/speech \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "ishikawa",
"voice": "Dennis",
"input": "Привет! Как дела у тебя сегодня?",
"language": "auto",
"response_format": "mp3"
}' \
--output speech.mp3

Response​

The response body is raw audio bytes.

FormatContent-Type
mp3audio/mpeg
opusaudio/ogg
wavaudio/wav
pcmapplication/octet-stream

The response includes:

X-Hidoba-TTS-Request-Id: 123

Use this ID when asking support to trace a TTS request.

Errors​

Validation Error​

{
"message": "The given data was invalid.",
"errors": {
"model": ["The selected model is invalid."]
}
}

Quota Exhausted​

{
"error": "Quota exhausted",
"code": "QUOTA_EXHAUSTED"
}

Provider Rejection​

Voice validation or provider-side request problems are returned as client-facing errors:

{
"error": "Invalid voiceId"
}