Skip to main content

REST API

Authentication​

The base URL is https://backend.hidoba.com.

Send your quota API key as a bearer token or in the X-Api-Key header. Replace the example voice placeholders with IDs supported by your selected model.

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

Create Speech​

POST https://backend.hidoba.com/v2/audio/speech
Content-Type: application/json

Request Body​

FieldTypeRequiredDefaultDescription
modelStringYes—ishikawa, matsuo, or komahi.
voiceStringYes—Voice ID for the selected model, up to 255 characters. If the supplied ID includes a folder, send it in full, for example example-voices/voice-02.wav.
inputStringYes—Text to synthesize, 1–2,000 characters after trimming surrounding whitespace.
languageStringNoautoOptional language code. Use auto or one of the supported short codes below.
response_formatStringNomp3One of mp3, opus, wav, pcm.
speedNumberNoModel defaultIshikawa accepts 0.5 through 1.5. Matsuo and Komahi accept 1.0.
excitementNumberNo0Matsuo only. A value from 0 through 1 that controls the blend of the voice’s available styles.

Omit stream and stream_format for this endpoint.

For a Matsuo voice with all three styles, 0 uses the normal style, around 0.33 favors whispering, and 1 uses the excited style. A voice’s available styles determine how much the setting changes its sound.

Language​

Use the language codes in the table. For English, send en.

Omitting language behaves the same as setting it to auto. For Ishikawa, the API detects the language from input and passes it to the model when detection is confident and the language is supported. Otherwise, the provider uses its default. Matsuo and Komahi handle automatic language selection within the model.

A ✓ indicates that the model accepts the language code.

CodeLanguageishikawamatsuokomahi
autoAutomatic✓✓✓
enEnglish✓✓✓
esSpanish✓——
frFrench✓—✓
deGerman✓——
itItalian✓——
ptPortuguese✓——
plPolish✓——
ruRussian✓——
nlDutch✓——
arArabic✓——
zh-cnMandarin Chinese (Simplified)✓✓—
jaJapanese✓——
koKorean✓——
hiHindi✓——
heHebrew✓——

Example: English MP3 with Matsuo​

curl --fail https://backend.hidoba.com/v2/audio/speech \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "matsuo",
"voice": "girl1",
"input": "Hello, this is generated speech.",
"language": "en",
"response_format": "mp3",
"excitement": 0.85
}' \
--output speech.mp3

Example: WAV With Language​

curl --fail https://backend.hidoba.com/v2/audio/speech \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "komahi",
"voice": "example-voices/voice-02.wav",
"input": "Bonjour, votre commande est prête.",
"language": "fr",
"response_format": "wav"
}' \
--output speech.wav

Example: Auto Language Detection​

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

Response​

A successful request returns 200 OK with binary audio.

FormatContent-TypeAudio encoding
mp3audio/mpegMP3
opusaudio/oggOpus in an Ogg container
wavaudio/wavPCM in a WAV container
pcmapplication/octet-streamMatsuo and Komahi return raw signed 16-bit little-endian PCM at 24 kHz, mono. Ishikawa includes a WAV header.

The response includes a request ID header.

X-Hidoba-TTS-Request-Id: 123

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

Successful synthesis is charged at the selected model’s rate using its reported character count. Counts can vary by model for text containing emoji and other Unicode characters.

Errors​

Check the HTTP status before decoding the response as audio.

Validation Error​

Invalid request fields return 422.

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

Quota Exhausted​

An exhausted quota returns 429 with the code QUOTA_EXHAUSTED.

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

Provider Rejection​

An invalid provider request can return 422, including a voice ID the model does not accept. Ishikawa can return 404 for an unavailable voice.

{
"error": "Invalid TTS request"
}

Temporary Limits​

The API can return 429 when too many speech requests are in progress. If the quota still has an available balance, reduce concurrency and retry with backoff.