Prepare Speech Script
beatra.speech.prepare_scriptUse before beatra.speech.synthesize to make speech sound natural and human. Beatra's Smart Voice Director reads the text and the user's optional instructions, then returns a script that is ready to synthesize, written in Beatra speech markup for the target voice and model: emotion, performance, sound effects, pauses and pronunciation. It never changes the words. Without voice or model it recommends one, with alternatives, each with a name, a preview link and a reason. Call beatra.speech.synthesize with each returned script's synthesis object as the arguments, unchanged, plus your own client_request_id; a script whose synthesis is null cannot be synthesized as is (read warnings). To try another voice within two days, call again with the same arguments, changing only voice (and model if needed): the earlier reading is reused and not charged again. This asynchronous task consumes Beatra credits: successful completion is charged afterward from actual tokens; nothing is charged when the result has directed false or reuses an earlier reading. To start, the balance must cover Beatra's estimate for the text (per 1,000 characters, counting at least 1,000) plus that of any other Smart Voice Director task in progress, also when an earlier reading is reused; an insufficient_balance refusal states the amount needed. An account runs at most 2 Smart Voice Director tasks at a time. Submit exactly once, then poll with beatra.tasks.get. Reuse client_request_id only for an identical retry.
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": {
"input": "<input>",
"client_request_id": "<client_request_id>"
},
"name": "beatra.speech.prepare_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Text to perform, in any supported language, 1 to 50,000 characters. It may already contain Beatra speech markup such as {pause 0.5} or {pron 行 hang2}; the Smart Voice Director keeps it and only adds to it. The words themselves are never changed. | |
| model | No | Omit unless the user requests a model. Same values as model in beatra.speech.synthesize; auto or omitted: resolved from the voice, or recommended together with the voice. | auto |
| voice | No | Optional voice to perform for: a voice_id from beatra.voices.list, a preset or one of your own cloned voices. Same meaning as voice in beatra.speech.synthesize. Omit it to let the Smart Voice Director recommend a voice. | |
| context | No | Optional, advanced: the text around the input when a long text is directed in parts, used only to understand the tone. It is not annotated, read aloud or returned. The end of before is also suggested as previous_text when the target model supports it. | |
| language | No | Language of the input as a BCP-47 tag. Usually omit it (auto, the default): the language is detected. Send it only when the user names the language or a dialect the text cannot show, such as Cantonese (yue). | auto |
| instructions | No | Optional requirements in natural language, in any language, up to 2,000 characters, for example "a bit suspenseful, whisper the last line". Without them the Smart Voice Director performs the text by its meaning. | |
| client_request_id | Yes | Stable retry identity for this billable operation. Reuse only for the exact same generation arguments. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | ||
| error | No | ||
| usage | No | ||
| status | No | ||
| billing | No | ||
| task_id | No | ||
| terminal | No | ||
| artifacts | No | ||
| resolved_model | No |