PreviewVoice
Generates a preview of a synthesized voice.
Try it now
You can call this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful call, OpenAPI Explorer automatically generates SDK code examples.
RAM authorization
The following table lists the authorization information of this API. You can use the Action element of a RAM policy statement to grant a RAM user or RAM role the permission to call this API. Details:
-
Operation: the specific permission point.
-
Access level: the access level of each operation, which can be Write, Read, or List.
-
Resource type: the resource types supported for authorization in this operation. Details:
- Required resource types are marked with a preceding *.
- For operations that do not support resource-level authorization,
All resourcesis used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Related operation: other permissions required to successfully perform the operation. The caller must have the permissions of the related operations at the same time for the operation to succeed.
| Operation | Access level | Resource type | Condition key | Related operation |
|---|---|---|---|---|
| bailianvoicebot:PreviewVoice | create | *All resources * |
| None |
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| BusinessUnitId | string | Yes | The ID of the Model Studio business unit. | llm-c11iig67g863rih8 |
| NlsEngine | string | Yes | The TTS engine. | BAILIAN |
| NlsAccessType | string | Yes | The TTS access type. | MANAGED |
| Model | string | No | The TTS model. | Qwen |
| Voice | string | Yes | The voice for synthesis. | Cherry |
| Text | string | Yes | The text to synthesize for the preview. | Hello, nice to meet you |
| Params | object | No | The synthesis parameters. | |
| SpeechRate | float | No | The speech rate. Note Valid values: -500~500. | 0 |
| Volume | integer | No | The volume. Note Valid values: 0~100. | 50 |
| PitchRate | float | No | The pitch rate. Note Valid values: -500~500. | 0 |
Response elements
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| RequestId | string | The request ID. | CF6D3484-19A1-5C77-863B-AC8B5754D37C |
| HttpStatusCode | integer | The HTTP status code. | 200 |
| Message | string | The error message. | Instance llm-baployoyopf22m2r does not exist. |
| Code | string | The internal error code. | OK |
| Data | string | The preview audio link. | https://cab-config-pre.oss-cn-hangzhou.aliyuncs.com/TTSDEMO/05B9FBF3-3681-10FF-9C24-340A93F3A25F.wav?Expires=1774795253&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE&security-token=YOUR_SECURITY_TOKEN |
| Params | array | The list of dynamic error parameters. | |
| param | string | A dynamic error parameter. | llm-xdne77rxe14ziszr |
Examples
Success response
JSON format
{
"RequestId": "CF6D3484-19A1-5C77-863B-AC8B5754D37C",
"HttpStatusCode": 200,
"Message": "Instance llm-baployoyopf22m2r does not exist.",
"Code": "OK",
"Data": "https://cab-config-pre.oss-cn-hangzhou.aliyuncs.com/TTSDEMO/05B9FBF3-3681-10FF-9C24-340A93F3A25F.wav?Expires=1774795253&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE&security-token=YOUR_SECURITY_TOKEN",
"Params": [
"llm-xdne77rxe14ziszr"
]
}
Error codes
Visit the Error Center for more error codes.
Release notes
| Change time | Change summary | Operation |
|---|---|---|
| 2026-04-22 | New OpenAPI | View change details |