audio
post/v1/audio/speech

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

TextToSpeechRequest required
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.

model_options, object nullable

Per-model-family passthrough options; opaque to the platform, validated per model

voice, string required

Opaque beatra voice_id (preset or cloned)

input, string required

Text to synthesize. It may contain speech markup such as {pause 0.5}, {laugh}, {pron 行 hang2} or {sub W3C 万维网联盟}; read the vocabulary and limits from the model card (beatra.models.list). Some models also accept inline emotion and performance markup, listed under script_markup on their card; other models skip it with a warning. Malformed markup is corrected or skipped with a markup_adjusted warning instead of failing the request. Each model has its own single-request limit (constraints.input_max_characters, and cjk_input_max_characters where present, on the model card); longer text is refused with a message that says how to split it.

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'

TTS model; 'auto' picks a model compatible with the voice

language, string nullable

Optional BCP-47 language tag, for example zh-CN, yue-HK, or en-US. 'auto' explicitly asks the engine to detect the spoken language. Read supported_languages from the selected model's catalog card. When omitted, the voice or provider chooses the language.

format, 'mp3' | 'wav' | 'flac' | 'opus' | 'pcm'
sample_rate, 8000 | 16000 | 22050 | 24000 | 32000 | 44100 nullable
speed, number
volume, number
pitch, number

Pitch adjustment from -1 to 1: 0 keeps the voice's original pitch, -1 is the lowest and 1 the highest the selected model supports. Use decimals such as 0.25 or -0.5 for subtle tuning.

emotion, 'happy' | 'sad' | 'angry' | 'fearful' | 'disgusted' | 'surprised' | 'calm' | 'fluent' nullable

Provider-neutral discrete speaking emotion

subtitle_enable, boolean

Request sentence-level subtitles with the audio. Subtitles are free; when present, output.subtitles carries the subtitle file URL and format.

direction, string nullable

Optional natural-language performance direction for the whole request, for example '像在耳边说悄悄话一样,轻声地说' or 'read it like breaking news'. Models and voices that follow it list direction under controls on their model card (with direction_max_characters); anywhere else it is ignored with an option_ignored warning. Effects vary with the voice and the text and are not a guarantee of intensity.

previous_text, string nullable

Optional text that comes right before this clip, for example the previous line of a dialogue or the previous paragraph, so separate calls keep a continuous tone. It is never spoken and never billed; any length is accepted and only its end is used (previous_text_tail_characters on the model card). Models and voices that do not use it ignore it with an option_ignored warning.

next_text, string nullable

Optional text that comes right after this clip, for example the next line of a dialogue or the next paragraph, so separate calls keep a continuous tone. It is never spoken and never billed; any length is accepted and only its start is used (next_text_head_characters on the model card). Models and voices that do not use it ignore it with an option_ignored warning.

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