Audio modelsAPI referenceQuote an audio composition

Quote an audio composition

Parse the script, timeline, voices, sound effects and music references in prompt_document, and return the number of speech segments and the estimated credits. Quoting does not create a job or charge credits. When prompt_document is omitted, text is parsed as a simple timeline.

Authentication

API Key: X-API-Key: <API Key> or Authorization: Bearer <API Key>.

Credentials in the examples are placeholders. Replace them and run the examples on your server.

Code examples

curl -X POST 'https://shixux.com/api/v1/audio/compositions/quote' \  -H 'X-API-Key: yb_xxx_yyy' \  -H 'Content-Type: application/json' \  -d '{"text":"[00:00] 欢迎回来。","prompt_document":{"version":1,"parts":[{"type":"text","text":"[00:00] 欢迎回来。"}]},"voice_preset_id":"vp_000000000000000000000001"}'
{  "credits": 1,  "estimated": true,  "segments": 1}

Request Body

application/json
  1. body
model?string

Model ID. For image and video models, use the corresponding settings endpoint for current availability, resolutions and rates. Speech synthesis and audio composition accept indextts-2 (default) or indextts-2.5.

Default"indextts-2"
Value in"indextts-2""indextts-2.5"
speed?number

Speaking-rate multiplier from 0.5 to 2, default 1. Available only with model indextts-2.5.

Range0.5 <= value <= 2
Default1
prompt_document?

Structured script document (version 1) made of text and reference parts, describing the timeline, voices, sound effects and music. Recommended for audio composition; when omitted, text is parsed as a simple timeline.

text*string

Text to synthesize. It must not be all whitespace. In speech synthesis, indextts-2 accepts up to 2048 characters, and indextts-2.5 accepts up to 2000 characters that include a letter or digit. Audio composition scripts are limited to 5000 characters in total.

voice_preset_id?string

Preset voice ID from the preset voice catalog. Mutually exclusive with voice_asset_id and voice_ref_key.

voice_asset_id?string

Voice asset ID of your account, such as a saved designed voice or a voice reference uploaded and confirmed with purpose voice_reference. It must not be expired.

emo_asset_id?string

Emotion reference asset ID: a WAV uploaded and confirmed with purpose emotion_reference, owned by your account and unexpired. Mutually exclusive with emo_ref_key. indextts-2 only.

voice_ref_key?|

Voice reference value, mutually exclusive with voice_preset_id and voice_asset_id. For voice references registered through the upload endpoints, use voice_asset_id.

emo_ref_key?|

Emotion reference WAV value, up to 20 MiB. indextts-2 only. For emotion references registered through the upload endpoints, use emo_asset_id.

emo_alpha?Emo Alpha

Overall strength of the eight-dimensional emotion vector, from 0 to 1. Keep the default of 1 when using emotion reference audio. indextts-2 only.

Range0 <= value <= 1
Default1
emo_vector?array<>|

Eight-dimensional emotion vector in the fixed order happy, angry, sad, afraid, disgusted, melancholic, surprised, calm. Exactly eight values, each from 0 to 1.4. Mutually exclusive with emotion reference audio. indextts-2 only.

Response Body

Request succeeded

application/json
  1. response
credits*number
estimated*boolean
segments*integer

On this page