Skip to main content
Text Generation

Create deployment

Create a model deployment task.

Prerequisites

Model deployment

Endpoint

POST https://dashscope-intl.aliyuncs.com/api/v1/deployments

Request examples

  • Billing by provisioned throughput units (PTU)
  • Billing by model unit usage duration
  • Billing by token usage
After running the deployment command below, billing starts immediately upon successful deployment—even if you have not yet called the model. Confirm the billing rules before deploying.
The PTU billing mode charges based on the duration of provisioned throughput usage. It suits scenarios requiring stable throughput guarantees, high concurrency, low latency, and predictable traffic. In this mode, throughput/concurrency and generation speed are preset by the platform and cannot be adjusted.
curl "https://dashscope-intl.aliyuncs.com/api/v1/deployments" \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "name": "my_qwen_flash",
    "model_name": "qwen-flash-2025-07-28",
    "plan": "ptu",
    "ptu_capacity": {
        "input_tpm": 10000,
	"output_tpm": 1000
    }
}'

Request parameters

Parameter

Type

Location

Required

Description

model_name

String

body

Yes

The name of the model to deploy. This corresponds to the model ID in My Models. You can also get this ID from the output of the Create Training Job or Create Import Job operations.

plan

String

body

Yes

The deployment plan. The following billing methods are supported:

Billing method

Plan setting

Billing by model unit

"plan": "mu"

Billing by compute unit

"plan": "cu"

Provisioned throughput

"plan": "ptu"

LoRA shared deployment (billed by token usage)

"plan": "lora"

You can quickly find the supported deployment plans for a fine-tuned model in My Models.

Fine-tuned CosyVoice models currently only support "plan": "mu".

name

String

body

Yes

The display name of the model in the console.

capacity

Integer

body

No

Required only when "plan": "mu" is specified. Specifies the number of resource units for the deployment. The value must be an integer multiple of base_capacity. The constraints vary based on the deploy_spec value. For example, for MU2, the value must be a multiple of 8, while for MU5, it can be 1. Example: "capacity": 1.

CosyVoice models currently provide the following two deployment templates with corresponding capacity constraints:

  • single-node deployment: capacity must be an integer multiple of 1, such as 1, 2, 3, 4, or 5.

  • single-node deployment - flagship complex inference edition: capacity must be an integer multiple of 8, such as 8, 16, 24, or 32.

billing_method

String

body

No

Required only when "plan": "mu" is specified. Currently, only "POST_PAY" (Post-paid) is supported. Example: "billing_method": "POST_PAY".

deploy_spec

String

body

No

This setting is applicable only when "plan": "mu" is specified.

For details about feature support, see Feature support for model unit deployment.

This parameter is required when "plan": "mu" is specified. Example: "deploy_spec": "MU1".

You can get this value from the template_id field returned by the Get Deployable Model List operation.

enable_thinking

Boolean

body

No

Supported by some models. You can set this to true or false.

max_context_length

Number

body

No

Supported by some models. Example: "max_context_length": 131072.

rpm_limit

Number

body

No

Supported by some models. Specifies the maximum number of requests per minute (RPM).

tpm_limit

Number

body

No

Supported by some models. Specifies the maximum number of tokens per minute (TPM).

ptu_capacity

Object

body

No

This setting is applicable only when "plan": "ptu" is specified.

For details about feature support, see Feature Support for PTU Deployment.

If you do not specify this parameter, the system defaults to 10,000 input_tpm and 1,000 output_tpm.

Example: "ptu_capacity": { "input_tpm": 10000, "output_tpm": 1000 }.

Example: "ptu_capacity": { "input_tpm": 10000, "output_tpm": 1000 }.

ptu_capacity.input_tpm

Number

body

No

Supported by all models. Specifies the maximum number of input tokens per minute (TPM).

ptu_capacity.output_tpm

Number

body

No

Supported by all models. Specifies the maximum number of output tokens per minute (TPM).

ptu_capacity.thinking_output_tpm

Number

body

No

Supported by some models. Specifies the maximum number of provisioned thinking output tokens per minute (TPM).

suffix

String

body

No

After a model is deployed, a new model name is generated. The suffix parameter specifies the suffix for this new name. It must be globally unique and have a maximum length of 8 characters. You can omit the suffix for the first deployment of a model. If you deploy the same model multiple times, you must specify a unique suffix for each deployment.

See the deployed_model output parameter for more information.

Supported models

  • Usage duration billing (Provisioned Throughput)
  • Billing by usage duration (model unit)
  • By model Token usage
Cost = Usage duration × (Input TPM unit price × Input TPM + Output TPM unit price × Output TPM)Postpaid is calculated by hour: the usage duration unit is hours, and the unit price takes the "1 hour continuous" column in the table below; prepaid is calculated by day: the usage duration unit is days, and the unit price takes the "1 day continuous" column in the table below.
  • Prepaid orders take effect immediately after payment, valid for N days until 23:59 on day N. If ordered after 22:00, the expiration date is automatically extended by 1 day.
  • After a prepaid order expires, the service will be stopped with a 2-hour delay, and resources will be retained for 14 hours after stopping before being released.
  • Prepaid orders cannot be terminated early.
  • For post-paid billing, if your account is in arrears, the deployed resources will be retained and billed for 24 hours, during which the service can still be used normally. After 24 hours, the system stops billing, the model deployment enters an arrears state, and the underlying resources will be deleted, but the model deployment task will be retained. After you pay off the arrears, the system will reallocate resources and resume usage (fees will continue to accrue after resumption). If you do not want to continue incurring charges, you can delete the model deployment task; once deleted successfully, billing will stop.
When the model input exceeds the maximum input Token, the relevant call will automatically switch to the pay-as-you-go mode of the current model; when the purchased TPM is exceeded, it is handled according to the overflow policy selected at creation ("Auto-overflow" switches to pay-as-you-go, "PTU capacity only" returns 429). At this time, inference performance may degrade and will be governed by the public traffic of the current snapshot model in the workspace, and the fee is charged according to the model invocation (pay-as-you-go) standard.
  • At this time (only under the "Auto-overflow" policy), the call API response Header will include: x-dashscope-ptu-overflow:true.
  • For TPM statistics, go to: Model Monitoring.
For specific fee-reduction and refund rules for scale-in (downgrade) scenarios, please refer to: Refund rules for configuration downgrades.
PTU deployment supports stepped capacity coefficients and cache discounts for long inputs. For details, see Provisioned Throughput long input and cache.
  • Singapore
  • North China 2 (Beijing)
  • Qwen
  • DeepSeek
  • GLM
  • Qwen-VL

Model name

Model code

Max input tokens

Postpaid input

Per 10K TPM/hour

Postpaid output

Per 1K TPM/hour

Prepaid input

Per 10K TPM/day

Prepaid output

Per 1K TPM/day

Qwen3.8-Max

qwen3.8-max

1M

$4.8

$1.44

$57.6

$17.28

Qwen3.7-Max-2026-05-20

qwen3.7-max-2026-05-20

256K

$1.92

$1.8

$72

$21.6

Qwen3.7-Plus-2026-05-26

qwen3.7-plus-2026-05-26

256K

$0.96

$0.384

$11.52

$4.608

Qwen3.6-Plus-2026-04-02

qwen3.6-plus-2026-04-02

128K

$1.2

$0.72

$14.4

$8.64

Qwen3.5-Plus-2026-04-20

qwen3.5-plus-2026-04-20

128K

$0.96

$0.576

$11.52

$6.912

Response example

The command returns the following:
{
  "request_id": "f2ae64f7-83cc-410c-bc0b-840443f7eb86",
  "output": {
    "deployed_model": "emo-35b3f106-sample01",
    "gmt_create": "2025-06-17T11:00:38.68",
    "gmt_modified": "2025-06-17T11:00:38.68",
    "status": "PENDING",
    "model_name": "emo",
    "base_model": "emo",
    "base_capacity": 1,
    "capacity": 1,
    "ready_capacity": 0,
    "workspace_id": "llm-v71tlv3d***",
    "charge_type": "post_paid",
    "creator": "175805416***",
    "modifier": "175805416***"
  }
}

Response parameters

Parameter

Type

Description

request_id

String

The ID of the request.

output

Object

Details of the deployment task.

deployed_model

String

A unique identifier for the deployed model. This ID is used for API operations, such as querying deployment details, modifying deployment rate limiting, deployment scaling, and deleting deployments, and is also passed as an SDK parameter when you invoke the model.

gmt_create

String

The creation time of the deployment task.

gmt_modified

String

The last modification time of the deployment task.

status

String

The status of the deployment task.

  • PENDING: The task is being created.

  • UPDATING: The task is being updated.

  • RUNNING: The deployment task is running, and the deployed model can process requests.

  • STOPPED: The deployment task is stopped and is not billed.

  • DELETING: The task is being deleted.

  • FAILED: The creation or update of the task failed.

model_name

String

The name of the model used in the deployment task.

base_model

String

The ID of the base model used in the deployment task.

base_capacity

Number

The minimum number of resource units required to run the base model.

capacity

Number

The number of resource units used by the deployment task.

ready_capacity

Number

The number of resource units that are ready to process requests immediately. Resource initialization speed or hardware status can limit this value.

workspace_id

String

The ID of the deployment task's workspace.

charge_type

String

The billing method for the deployment task.

post_paid: Post-paid.

creator

String

The UID of the user who created the deployment task.

modifier

String

The UID of the user who last modified the deployment task.

plan

String

The billing model for the deployment task. This parameter is not returned for some billing models.

Returned only for Model Unit deployments.

model_unit_spec

String

The model unit specification.

enable_thinking

Boolean

Specifies if Thinking mode is enabled. This feature is only available for certain models.

max_context_length

Number

The maximum context length.

rpm_limit

String

The maximum number of requests per minute (RPM).

tpm_limit

Number

The maximum number of tokens per minute (TPM).

Returned only for provisioned throughput (PTU) deployments.

ptu_capacity

Object

This parameter takes effect only when "plan": "ptu" is set.

Example: "ptu_capacity": { "input_tpm": 10000, "output_tpm": 1000 }.

ptu_capacity.input_tpm

Number

The maximum number of input tokens per minute (TPM) for the deployed model. This feature is supported by all models.

ptu_capacity.output_tpm

Number

The maximum number of output tokens per minute (TPM) for the deployed model. This feature is supported by all models.

ptu_capacity.thinking_output_tpm

Number

The maximum number of thinking output tokens per minute (TPM) for the deployed model. This feature is only available for certain models.

Error response

Response example

{
    "request_id": "ca218d57-b91b-46b2-bd35-c41c6287bcf4",
    "message": "Model: qwen-plus-20230703-cx7f not found!",
    "code": "NotFound"
}

Response parameters

Parameter

Type

Description

request_id

String

The unique ID of the request.

code

String

The error code.

message

String

The error message.

The following errors can occur when a request fails:

Error code

Error message

Reason

NotFound

Model: xxx not found!

  • You are creating a deployment task with a model that does not exist.

  • You are querying, updating, or deleting a deployment task with a model that does not exist.

Conflict

Deployed model xxx already exists, please specify a suffix.

You are creating a deployment task with a suffix that is already in use.

InvalidParameter

Invalid capacity (xx), capacity must be larger than or equal to 0 and multiples of 1 and less than 1000!

You are creating or updating a deployment task with an invalid number of capacity units.