audio

Prepare a speech script with the Smart Voice Director

Changed on

Creates an asynchronous Smart Voice Director task. The Smart Voice Director reads the text and optional instructions, then returns a script that is ready to synthesize, in Beatra speech markup tailored to the target voice and model: emotion, performance, sound effects, pauses and pronunciation. It never changes the words. Without a voice or model it recommends one, with alternatives, each with a name, a preview link and a reason. Send each script's synthesis object, unchanged, as the body of POST /v1/audio/speech; a script whose synthesis is null cannot be synthesized as is. Charged after completion from actual input, output and reasoning tokens. To submit a text, the balance must cover its estimate (the catalog's estimate_per_1000_characters_credits for its length, counting at least 1,000 characters) plus that of any other Smart Voice Director task in progress on the account. An account runs at most 2 Smart Voice Director tasks at a time. Nothing is charged when the Smart Voice Director could not direct the text (directed is false) or reuses an earlier reading of the same text.

post/v1/audio/speech/scripts

Request

  • Base URL
    https://api.beatra.ai (the document declares no server; this is the origin it was published from)
  • Auth
    none declared. Required headers: Idempotency-Key

Headers

x-request-id, string nullable
Idempotency-Key, string required
authorization, string nullable

Request body

SpeechScriptRequest required

Direct a text: annotate it for performance, and recommend a voice and a speech model when none is given.

metadata, object nullable

Caller-supplied metadata; ≤16 keys, key ≤64 chars, value ≤512 chars

callback_url, string nullable

HTTPS URL beatra will POST the final Task envelope to when the Task reaches a terminal state

callback_signing_key_id, string nullable

Optional standalone callback signing key. Omit for unsigned callback delivery; requires callback_url when provided.

input, string required

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.

instructions, string nullable

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.

voice, string nullable

Optional voice to perform for: a preset voice or one of your own cloned voices. Same meaning as voice in POST /v1/audio/speech. Omit it to let the Smart Voice Director recommend a voice.

model, 'auto' | 'minimax-speech-2.8-hd' | 'minimax-speech-2.8-turbo' | 'doubao-seed-tts-3.0' | 'doubao-seed-tts-2.0' | 'elevenlabs-v4-turbo' | 'elevenlabs-v4'

Optional speech model to perform for, with the same values and defaults as model in POST /v1/audio/speech. auto or omitted: resolved from the voice, or recommended together with the voice.

language, string

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).

context, SpeechScriptContext nullable

Text around the input. It only helps the Smart Voice Director read the tone.

Response

Task accepted

TaskEnvelope required

Standard Task envelope.

Returned by every async-creation endpoint, GET /v1/tasks/{id}, and the body of customer callback POSTs.

object, 'task'
task_id, string required
status, 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' required
capability, string required
workload_type, 'model' | 'social_operation'
model, string nullable

Caller-requested model verbatim (may be 'auto'). Null for social_operation tasks.

resolved_model, string nullable

Actual model that ran (null until execution starts; equals model for explicit-model calls)

model_selection_reason, unknown
social, SocialTaskIdentity nullable
metadata, object nullable
input, object nullable
progress, AppApiV1SchemasCommonTaskProgress nullable
output, object nullable
warnings, TaskWarning[]
error, AppApiV1SchemasCommonTaskError nullable
usage, UsageObject nullable
billing, TaskBilling nullable
callback, TaskCallback nullable
created_at, string date-time required
started_at, string date-time nullable
deadline_at, string date-time nullable
completed_at, string date-time nullable
cancel_requested_at, string date-time nullable
links, TaskLinks required

Changes