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/provider default | Optional BCP-47 language code, for example en-US. |
response_format | String | No | mp3 | One of mp3, opus, wav, pcm. |
speed | Number | No | Provider default | Speaking 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.
| 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 or language validation problems from the provider are returned as client-facing errors:
{
"error": "Invalid voiceId"
}