generate a speech preview
speech-previews_createSynthesize a confirmed script with a chosen voice into a standalone speech audio job after verifying project access; check options first because synthesis may be paid.
Instructions
Synthesize a confirmed script in a voice from voices_list into one standalone speech audio job (ElevenLabs), after verifying access to projectId. This is a potentially paid action. Check speech-previews_get-options first. On the free plan (its freeScriptLimit is set) the API refuses speech it estimates at over 20 seconds (160 words a minute) or over 320 characters, and a free lipsync takes at most 15 seconds, so keep a script you will lipsync to about 40 words, and split longer text into several previews; paid plans and credits have no duration limit, only the 5,000-character script limit. Persist idempotencyKey before calling, and after an uncertain response retry only with that same key and identical input; a new key can bill again. A 5xx error with no job id (such as 503 or 504 while the speech provider is unavailable) usually means nothing was created, but a job may have been saved before the response was lost. Either way, wait about a minute and retry with the same key and input: it returns the saved job if there is one and never bills twice. After three such failures, tell the user the speech service is unavailable and stop. Returns the job: status PENDING, PROCESSING, SUCCESS or FAILED, with url and duration filled only on SUCCESS, so poll speech-previews_get by the returned id (jobs_get and jobs_wait do not cover speech jobs). Never create again because attaching the resulting audio failed. An inaccessible project or a malformed idempotencyKey fails before anything is synthesized. Not for lipsyncing a script directly (lipsync_create with script and voiceId), editing words in a video in the original speaker voice (dialogue-previews_create) or translating audio (translation-previews_create). Pass projectIntent=explicit with projectId only for a project the user explicitly chose or one just created for this request, never because its name matches or it is open; default new work to a new project.
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": {
"projectId": "<projectId>",
"idempotencyKey": "<idempotencyKey>",
"script": "<script>",
"voiceId": "<voiceId>"
},
"name": "speech-previews_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | Exact text the user confirmed, spoken as written; up to 5,000 characters. | |
| voiceId | Yes | Voice id returned by voices_list (premade ElevenLabs voices or this organization's clones). A voice with a restriction cannot synthesize; pick another. | |
| projectId | Yes | Project the preview is for, from projects_create or projects_list. The tool checks you can access it before synthesizing; pass the same id to speech-previews_get. | |
| stability | No | Voice consistency from 0 to 1; higher is steadier, lower is more expressive. | |
| projectIntent | No | Required with projectId. Set only for an explicit user project selection/update, or the new project just created for this request. Never infer intent from a matching project name, workflow name or active editor. | |
| idempotencyKey | Yes | A fresh UUID, persisted before the call and sent as the Idempotency-Key header. After an uncertain response, reuse it with the identical script and voice; only this key deduplicates, so a new key can bill a second synthesis. | |
| similarityBoost | No | How closely to match the selected voice, from 0 to 1. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||