Deploy a trained speech synthesis model as an online API service.
Prerequisites
-
Supported region: The features described in this document are only available in the China (Beijing) region, and you must use the API Key from that region.
-
Account permissions: If you use an Alibaba Cloud sub-account (RAM user), you need to grant the sub-account model invocation, training, and deployment permissions.
-
Configure environment variables: You have successfully obtained an API Key and configured it as an environment variable.
-
Prerequisite: Model fine-tuning training is complete. Please first call the Query Tuning Job API to confirm that the job status
statusis SUCCEEDED before deploying.
Deploy model
China (Beijing)
POST https://dashscope.aliyuncs.com/api/v1/deployments
For Windows CMD, replace$DASHSCOPE_API_KEYwith%DASHSCOPE_API_KEY%. For PowerShell, replace it with$env:DASHSCOPE_API_KEY
Request parameters |
Deploy model
|
Headers |
|
|
Content-Type Fixed value: |
|
|
Authorization API Key authentication. Format: |
|
Request Body |
|
|
model_name The model ID to deploy (not the base model name, but the model identifier generated after fine-tuning or export). How to obtain:
|
|
|
plan Deployment method. CosyVoice series tuned models only support |
|
|
deploy_spec Deployment template specification. Can be obtained from the Query Deployable Models API response field
|
|
|
capacity The number of resource units for deployment, must be a multiple of |
|
|
billing_method Billing method. Currently supports |
|
|
name The display name of the model in the console. If not provided, the value of |
Response parameters |
Success response exampleKey fields:
Error response example
|
|
request_id The unique identifier of the request. |
|
|
output Job details. |
|
|
code Error code. Returned when the call fails. |
|
|
message Detailed error description. Returned when the call fails. |
Next step
Deployment is an asynchronous operation. After calling this API, you can use the Query and Manage Deployments API to check the deployment status.