generate_audio
Convert text to speech with selectable voice and language. Get an mp3 URL for standalone use or as voiceover in video composition.
Instructions
Generate speech from text (text-to-speech): pick a voice and language, get an mp3 back. Returns request_id and cost in credits immediately — narration is quick, poll with wait_generation until COMPLETED, then output.audio.url is the mp3. Pass the resulting request_id as voiceover_request_id in compose_video to narrate a multi-scene video, or use the mp3 on its own.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to speak. Russian or English. Keep each call within the model limit (typically ≤500 characters) — split a long narration into separate calls and stitch them if needed. | |
| input | No | Advanced model-specific parameters (see get_model input_schema). Merged with the fields above. | |
| model | No | Model slug from list_models (type audio). Omit to use the default text-to-speech model. | |
| voice | No | Voice preset from the model input_schema (see get_model) — 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 | Delivery stability where supported: lower is more expressive, higher is more even. | |
| wait_seconds | No | How long to wait inline for completion before returning a request_id. | |
| idempotency_key | No | Optional stable key to safely retry without creating (and paying for) a duplicate generation. Reuse the same key when retrying the same request. |