generate_audio
Generate speech from text (text-to-speech): pick a voice and language, get an audio file back. Returns request_id and cost in credits immediately — narration is quick, poll with wait_generation until COMPLETED, then output.audio.url is the file and output.audio.format its format (mp3 or wav, depending on the model). Pass the resulting request_id as voiceover_request_id in compose_video to narrate a multi-scene video, or use the file on its own.
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": "generate_audio"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to speak in a language supported by the selected model. The allowed length depends on the model: 10–10000 characters per call on the default model, considerably more on some others — get_model returns text_limits.min_chars / text_limits.max_chars. Text outside the model limits is rejected with 400 before anything is charged: pick a model with a higher limit, or split the narration into separate calls and download the parts; standalone audio stitching is not a public MCP tool. | |
| input | No | Model-specific parameters from get_model input_schema.parameters, keyed by parameter name and merged with the fields above — e.g. the default model's directing fields style / pace / accent / audio_profile / scene / sample_context / temperature. Some parameters can change the cost of the call — get_model shows the reference pricing. A misspelled name, or a parameter this model is known not to apply, is rejected before the generation starts; the error lists the parameters the model declares. | |
| model | No | Model slug from list_models (type audio). Omit to use the default text-to-speech model. | |
| voice | No | Exact voice ID from input_schema.parameters voice.options (see get_model); labels are not IDs — different male/female narrators. Omit for the model default. | |
| language | No | Language of the text, e.g. 'ru' or 'en'. Omit for the model default. | |
| stability | No | ElevenLabs v4: delivery stability, from 0 to 1. Lower is more expressive, higher is more even. Other speech models reject the call. | |
| similarity | No | ElevenLabs v4 voice similarity, from 0 to 1. Other speech models reject the call. | |
| wait_seconds | No | How long to wait inline for completion before returning a request_id. | |
| previous_text | No | ElevenLabs v4: preceding script context for continuity across separate calls. Other speech models reject the call. | |
| idempotency_key | No | Optional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse. | |
| secondary_voice | No | ElevenLabs v4: second voice ID for lines prefixed B:. Lines prefixed A: use voice. Other speech models reject the call. |