beatra文档

预检语音合成

下方的接口说明(参数、请求和响应)是英文原文,字段名与接口完全一致。

POST
/v1/audio/speech/validate

Request Body

application/jsonRequired
voice
Required
Voice

Opaque Beatra voice_id (preset or cloned)

input
Required
Input

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. Some models accept fewer characters; read constraints.input_max_characters on the model card (ElevenLabs models: 10,000).

Minimum length: 1Maximum length: 50000
modelModel

Model to check against (default auto)

Default: "auto"Value in: "auto" | "minimax-speech-2.8-hd" | "minimax-speech-2.8-turbo" | "doubao-seed-tts-2.0" | "elevenlabs-v4-turbo" | "elevenlabs-v4"
languageLanguage

BCP-47 language hint

formatFormat

Audio format the create call would use

Default: "mp3"Value in: "mp3" | "wav" | "flac" | "opus" | "pcm"
sample_rateSample Rate

Sample rate in Hz for the chosen format

speedSpeed

Speaking rate (0.5 to 2.0)

Default: 1Minimum: 0.5Maximum: 2
volumeVolume

Volume (0 to 10)

Default: 1Maximum: 10
pitchPitch

Normalized pitch (-1.0 to 1.0)

Default: 0Minimum: -1Maximum: 1
emotionEmotion

Emotion preset for the whole request

subtitle_enableSubtitle Enable

Whether the create call would request subtitles

Default: false
directionDirection

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_textPrevious Text

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.

model_optionsModel Options

Expert provider options, same as the create call

Header Parameters

Authorization
Required
string

Bearer API key.

X-Request-Idstring

Optional client request id echoed in the response.

curl -X POST "https://api.beatra.cn/v1/audio/speech/validate" \
  -H "Authorization: string" \
  -H "X-Request-Id: string" \
  -H "Content-Type: application/json" \
  -d '{
    "voice": "string",
    "input": "string",
    "model": "auto",
    "language": "string",
    "format": "mp3",
    "sample_rate": 8000,
    "speed": 1,
    "volume": 1,
    "pitch": 0,
    "emotion": "happy",
    "subtitle_enable": false,
    "direction": "string",
    "previous_text": "string",
    "model_options": {}
  }'

Validation report

{
  "valid": true,
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "field": "string"
    }
  ],
  "weighted_characters": 0,
  "price_credits": "string",
  "execution": {
    "mode": "string"
  },
  "script_markup": {
    "pause": {
      "syntax": "string",
      "range": [
        0
      ],
      "note": "string"
    },
    "tags": [
      {
        "token": "string",
        "meaning": "string"
      }
    ],
    "pronunciation": {
      "syntax": "string",
      "readings": "string"
    },
    "escape": "string",
    "alias": {
      "syntax": "string",
      "note": "string"
    },
    "inline_emotion": {
      "syntax": "string",
      "values": [
        "string"
      ],
      "note": "string"
    },
    "performance": [
      {
        "token": "string",
        "meaning": "string"
      }
    ]
  },
  "limitations": [
    "string"
  ]
}

最后更新