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
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | String | Yes | — | Public TTS model. Currently only ishikawa. |
voice | String | Yes | — | Voice ID, for example Dennis. |
input | String | Yes | — | Text to synthesize, 1-2,000 characters. |
language | String | No | auto | Optional language code. Use auto or one of the supported short codes below. |
response_format | String | No | mp3 | One of mp3, opus, wav, pcm. |
speed | Number | No | Provider default | Speaking 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:
| Code | Language |
|---|---|
auto | Auto-detect |
en | English |
es | Spanish |
fr | French |
de | German |
it | Italian |
pt | Portuguese |
pl | Polish |
ru | Russian |
nl | Dutch |
ar | Arabic |
zh-cn | Chinese (Simplified) |
ja | Japanese |
ko | Korean |
hi | Hindi |
he | Hebrew |
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.
| Format | Content-Type |
|---|---|
mp3 | audio/mpeg |
opus | audio/ogg |
wav | audio/wav |
pcm | application/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"
}