Text To Audio Price
text_to_audio_priceCalculate text-to-audio generation cost from character count, language, and speed before running a job. Validates mode, voice, and instructions so quotes fail where the actual job would.
Instructions
Calculate price for text-to-audio generation.
The price follows the number of characters (text, or count_text), the
language and the speed. mode, voice and instruct are only validated,
so the quote fails where the job would. Left unset they are taken from the
model's card, exactly as text_to_audio does.
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>",
"model": "<model>"
},
"name": "text_to_audio_price"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language code as the model expects it (Kokoro: 'en-us'; Qwen3: 'English'). Defaults to the model's own | |
| mode | No | TTS mode: 'custom_voice', 'voice_clone' or 'voice_design'. Leave unset to use the mode the model supports | |
| text | Yes | Text for price calculation | |
| model | Yes | TTS model name (e.g., 'Kokoro') | |
| speed | No | Speech speed. Per model (see 'speed' in the model list; most fix it at 1). Defaults to the model's own | |
| voice | No | Voice name from the model list for the chosen lang (e.g. Kokoro en-us 'af_alloy'). Defaults to the model's default voice for that language | |
| instruct | No | Voice description or style instruction, as the job will send it. Validated, not priced | |
| count_text | No | Price for this many characters instead of the given text | |
| sample_rate | No | Sample rate in Hz. Defaults to the model's own | |
| audio_format | No | Output format. Defaults to the model's own; most models emit mp3 only |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||