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
modelStringYesPublic TTS model. Currently only ishikawa.
voiceStringYesVoice ID, for example Dennis.
inputStringYesText to synthesize, 1-2,000 characters.
languageStringNoAuto/provider defaultOptional BCP-47 language code, for example en-US.
response_formatStringNomp3One of mp3, opus, wav, pcm.
speedNumberNoProvider defaultSpeaking rate from 0.5 to 1.5.

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-IT",
"response_format": "wav",
"speed": 1.05
}' \
--output speech.wav

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 or language validation problems from the provider are returned as client-facing errors:

{
"error": "Invalid voiceId"
}