Skip to main content
Image Generation

Image Generation - Deploy Model

Publish a trained image generation 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.
  • Deploy Model
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>",
    "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.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.7-image-pro-ft-202507011122-xxxx",
        "gmt_create": "2025-07-01T10:30:00.000",
        "gmt_modified": "2025-07-01T10:30:00.000",
        "status": "PENDING",
        "model_name": "wan2.7-image-pro-ft-202507011122-xxxx",
        "base_model": "wan2.7-image-pro",
        "workspace_id": "llm-xxxxxxxxx",
        "charge_type": "post_paid",
        "creator": "12xxxxxxx",
        "modifier": "12xxxxxxx",
        "plan": "lora"
    }
}

Next Step

Deployment is an asynchronous operation. After calling this API, you can query the deployment status through the Query and Manage Deployments API.