predict_duration
Predict the expected audio duration in seconds for a given text to estimate credit cost before synthesizing speech.
Instructions
Predict the expected output audio duration in seconds for a given text WITHOUT producing any audio file. Accepts the same parameters as text_to_speech. There is no text-length limit: long text is automatically split (auto-chunked), and credit usage and latency scale with the length of the text. Use this to estimate credit cost before synthesizing — credit usage is proportional to the predicted duration.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "predict_duration"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| model | No | ||
| speed | No | ||
| style | No | ||
| language | No | ||
| voice_id | No | ||
| pitch_shift | No | ||
| output_format | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |