Skip to main content
Video Generation

Video Generation - Deploy Model

Publish a trained model as an online API service.

Prerequisites

  • Supported regions: The model deployment API is currently available only in the Singapore region. If you use other regions, please deploy models through the Model Studio console in that region.
  • Account permissions: If you use Alibaba Cloud sub-accounts (RAM users), 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 has been completed. Please first call the Query Fine-tuning Job API to confirm the job status status is SUCCEEDED before proceeding with deployment.

Deploy Model

  • Singapore
POST https://dashscope-intl.aliyuncs.com/api/v1/deployments
For Windows CMD, replace $DASHSCOPE_API_KEY with %DASHSCOPE_API_KEY%. For PowerShell, replace with $env:DASHSCOPE_API_KEY

Request Parameters

Headers
Content-Type string (Required)Fixed value: application/jsonAuthorization string (Required)API Key authentication, in the format Bearer sk-xxxx.
Request Body
model_name string (Required)The model ID to deploy (not the base model name, but the model identifier generated after fine-tuning or export). How to obtain:capacity integer (Required)The number of deployed model instances. Recommended value: 1.plan string (Required)Deployment method. Recommended value for LoRA efficient fine-tuning: lora.aigc_config object (Required)Prompt configuration.

aigc_config properties

use_input_prompt boolean (Required)Controls the prompt source when calling the deployed model to generate videos.
  • false (default): Automatic generation mode. When calling the video generation API, the system ignores the input prompt and uses the templates configured in aigc_config.prompt and aigc_config.lora_prompt_default to automatically generate prompts.
  • true: Manual input mode. When calling the video generation API, the system directly uses the input prompt, and the above two parameters become ineffective.
prompt string (Required)Preset Prompt template. Only effective when use_input_prompt=false is set.When calling the deployed model to generate videos, the system analyzes the input image, fills the image content into this template, and automatically generates a complete description with effect instructions.Note: This parameter overrides the prompt parameter passed in the video generation API.lora_prompt_default string (Required)Fallback Prompt template. Only effective when use_input_prompt=false is set.When aigc_config.prompt fails to generate, the system uses this parameter as a fallback prompt to generate the video.
  • Image-to-Video (First Frame)
  • Image-to-Video (First and Last Frames)
The following example uses the money rain effect. Upload a portrait image, and the system automatically generates a video with the effect.
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/deployments' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model_name": "<replace with model_name>",
    "aigc_config": {
        "use_input_prompt": false,
        "prompt": "Provide a video description based on the image content. The description must include the phrase "Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she/he stretches her/his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain."\nOutput Template:\nThe video begins with a shot of [subject description]. [Environment description]. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she/he stretches her/his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.\nExample:\nThe video begins showing a young woman standing in front of a brick wall covered with ivy. She has long, smooth reddish-brown hair, wearing a white sleeveless dress, a shiny silver necklace, and a smile on her face. The brick wall in the background is covered with green vines, appearing rustic and natural. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she stretches her arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.",
        "lora_prompt_default": "Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, she/he stretches her/his arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain."
    },
    "capacity": 1,
    "plan": "lora"
}'

Response Parameters

request_id stringUnique identifier of the request.output objectTask details.

Properties

deployed_model stringUnique identifier of the deployed model. Used to query model deployment status and invoke the model.model_name stringModel identifier name.status stringDeployment status:
  • PENDING: Deploying.
  • RUNNING: Running.
  • FAILED: Deployment failed.
base_model stringThe base model used.gmt_create stringDeployment task creation time.gmt_modified stringDeployment task update time.workspace_id stringThe workspace ID associated with the Alibaba Cloud Model Studio API Key. See Get the Workspace ID.charge_type stringBilling mode. post_paid indicates pay-as-you-go.creator stringAlibaba Cloud account ID of the creator.modifier stringAlibaba Cloud account ID of the modifier.plan stringDeployment method.
code stringError code. Returned when the call fails. See the error code table below.message stringDetailed error description. Returned when the call fails.
  • Success Response Example
  • Error Response Example
Key fields: output.deployed_model (unique identifier of the deployed model), output.status (deployment status).
{
    "request_id": "96020b2e-9072-4c8a-9981-xxxxxxxxx",
    "output": {
        "deployed_model": "wan2.5-i2v-preview-ft-202511111122-xxxx",
        "gmt_create": "2025-11-11T17:46:53.294",
        "gmt_modified": "2025-11-11T17:46:53.294",
        "status": "PENDING",
        "model_name": "wan2.5-i2v-preview-ft-202511111122-xxxx",
        "base_model": "wan2.5-i2v-preview",
        "workspace_id": "llm-xxxxxxxxx",
        "charge_type": "post_paid",
        "creator": "12xxxxxxx",
        "modifier": "12xxxxxxx",
        "plan": "lora"
    }
}

Prompt Template Configuration

The following explains how to configure the aigc_config.prompt parameter.
  • Why set this parameter? Without this parameter, you would need to manually write a complete Prompt each time you call the deployed model. Once configured, when calling the fine-tuned model to generate videos, you only need to upload an image, and the system will automatically complete the effect instructions based on this parameter without requiring manual Prompt input.
  • How to configure? Prompt = Task instruction (tells the model what to do) + Output template (standardizes output format) + Example (helps the model learn the example structure).
Provide a video description based on the image content. The description must include the phrase "Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her (him). The bills continue to fall, while the camera slowly zooms in, she (he) stretches her (his) arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain."
Output Template:
The video begins with a shot of [subject description]. [Environment description]. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her (him). The bills continue to fall, while the camera slowly zooms in, she (he) stretches her (his) arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.
Example:
The video begins showing a young woman at a beach scene. Her hair is wet, dark brown, curly and slightly messy. She has a bright smile on her face. The background features turbulent waves and distant mountains. Then the s86b5p money rain effect begins, countless huge-sized US dollar bills (beige background/dark green patterns) pour down like a torrential rain, densely hitting and surrounding her. The bills continue to fall, while the camera slowly zooms in, she stretches her arms upward, neck slightly tilted back, expression surprised, completely immersed in this wild money rain.
For the "Output template" description, see Video annotation: Write prompts for videos.

Next Step

Deployment is an asynchronous operation. After calling this API, you can query the deployment status through the Query and Manage Deployments API.
Video Generation - Deploy Model - Alibaba Cloud Model Studio