Model deployment management API, applicable to all model types including text, image, video, and speech . Supports querying deployment status and list, modifying throttling, scaling, and deleting deployments.
Prerequisites
- Supported region: The features described in this document are only available in the Singapore region, and you must use the API Key from that region.
- You have successfully obtained an API Key and configured it as an environment variable.
- You have read Model deployment and Deploy models using the API to understand the basic steps of model deployment.
Get model deployment status
Query the details and running status of a specified model deployment. You can poll this API; when the status becomes RUNNING, it indicates that the model has been deployed successfully.
Endpoint
Request example
Sample request:
Request parameters
Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
deployed_model | String | path | Yes | The unique identifier for the model deployment. Returned by Create deployment or List deployments. |
Response example
Pay attention to the status field. When the status becomes RUNNING, the model has been deployed successfully and is ready for invocation.
Response parameters
Field | Type | Description |
|---|---|---|
request_id | String | Unique identifier for the request. |
output | Object | Job details. |
output.deployed_model | String | Unique identifier of the model deployment. Used to query deployment status and invoke the model. |
output.model_name | String | Model identifier name. |
output.base_model | String | The base model used. |
output.status | String | Deployment status:
|
output.base_capacity | Number | Base resource unit count. |
output.capacity | Number | Current resource unit count. |
output.ready_capacity | Number | Number of ready resource units. |
output.workspace_id | String | The workspace ID associated with the Alibaba Cloud Model Studio API Key. See Get the Workspace ID. |
output.charge_type | String | Billing mode. post_paid indicates pay-as-you-go. |
output.gmt_create | String | Deployment creation time. |
output.gmt_modified | String | Deployment last modified time. |
output.creator | String | Alibaba Cloud account ID of the creator. |
output.modifier | String | Alibaba Cloud account ID of the modifier. |
output.plan | String | Deployment plan. |
List deployable models
Get the list of eligible candidate models for deployment on the Model Studio platform, i.e., which models can be used to create deployments.
Endpoint
Request example
Use the following command to query models available for deployment. We recommend using version=v1.0 to get a complete response including deployment plans and template information.
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
page_no | Number | No | Page number. Default value: 1. |
page_size | Number | No | Page size. Default value: 50. Maximum value: 100. Minimum value: 1. |
model_source | String | No | Model source. |
version | String | No | API version. We recommend using |
Response example
After the command is executed, the following result is returned:
Response parameters
Parameter | Type | Description |
|---|---|---|
models | Array | List of deployable models. |
models[].model_name | String | Model name. |
models[].plans | Array | List of deployment plans supported by the model. Returned when |
models[].plans[].plan | String | Deployment plan type: |
models[].plans[].templates | Array | List of deployment templates (returned when |
models[].plans[].templates[].template_id | String | Template ID, passed as the |
models[].plans[].templates[].template_name | String | Template display name. |
models[].plans[].templates[].template_type | String | Template type: |
models[].plans[].templates[].template_version | String | Template version. |
models[].plans[].templates[].template_desc | String | Template description. |
models[].plans[].templates[].roles | Object | Node role configuration. COUPLED mode contains a |
models[].plans[].templates[].roles.{role}.model_unit_spec | String | Model unit specification. |
models[].plans[].templates[].roles.{role}.capacity_unit_per_instance | Number | Number of capacity units per instance, i.e., base_capacity. When creating a deployment, |
page_no | Number | Query page number. |
page_size | Number | Query page size. |
total | Long | Total number of models matching the query conditions. |
List deployed models
Get the list of deployed instances, i.e., the model services that are actually running or have been deployed in the current workspace.
Endpoint
Request example
Run the following command to obtain the list of dedicated services:
Request parameters
Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
page_no | Number | query | No | Page number. Default: 1. |
page_size | Number | query | No | Page size. Default: 50. Maximum: 200. Minimum: 1. |
Response example
Sample response:
Response parameters
Field | Type | Description |
|---|---|---|
request_id | String | Unique identifier for the request. |
output.page_no | Number | Current page number. |
output.page_size | Number | Number of items per page. |
output.total | Number | Total number of deployments. |
output.deployments | Array | List of model deployments. Each element has the same fields as the output of Get a model deployment. |
Modify deployment throttling
Modify the RPM (Requests Per Minute) and TPM (Tokens Per Minute) throttling settings for a specified model deployment.
Endpoint
Request example
Run the following command to modify the throttling settings of a specified deployment:
Request parameters
Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
deployed_model | String | path | Yes | The unique identifier for the model deployment. You can obtain it from Create deployment or the List deployments operation. |
rpm_limit | Number | body | At least one parameter | Requests per minute (RPM). |
tpm_limit | Number | body | Tokens per minute (TPM). |
Response example
Sample response:
Response parameters
In addition to the base fields listed in Get a model deployment, the response may also include the following fields:
Field | Type | Description |
|---|---|---|
output.plan | String | Deployment plan. |
output.model_unit_spec | String | Model unit deployment template, such as MU1. |
output.enable_thinking | Boolean | Whether thinking mode is enabled. |
output.max_context_length | Number | Maximum context length. |
output.rpm_limit | Number | Requests per minute limit. |
output.tpm_limit | Number | Tokens per minute limit. |
Scale a deployment
Adjust the number of resource units used by a dedicated service by performing an update operation.
Endpoint
Request example
Run the following command to scale a specified service:
Request parameters
Parameter | Type | Location | Required | Description | |
|---|---|---|---|---|---|
deployed_model | String | path | Yes | The unique identifier for the model deployment. You can obtain it from Create deployment or the List deployments operation. | |
capacity | Number | body | Conditionally required | Only available when For more information, see feature support for model unit deployment. | The resource units used by the model after the update. Must be an integer multiple of |
ptu_capacity | Object | body | Conditionally required | Only available when For more information, see feature support for PTU deployment. | Takes effect only when Example: |
ptu_capacity.input_tpm | Number | body | Supported by all models. Input tokens per minute. The maximum input token amount per minute supported by the deployed model. | ||
ptu_capacity.output_tpm | Number | body | Supported by all models. Output tokens per minute. The maximum output token amount per minute supported by the deployed model. | ||
ptu_capacity.thinking_output_tpm | Number | body | Supported by some models. Thinking output tokens per minute. The maximum thinking output token amount per minute supported by the deployed model. | ||
Response example
Sample response:
Response parameters
Response parameters are the same as Get a model deployment. For details, see the response parameters of Get a model deployment.
Delete a deployment
Delete a specified model deployment and release the corresponding computing resources.
Endpoint
Request example
Run the following command to delete a specified deployment.
Request parameters
Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
deployed_model | String | path | Yes | The unique identifier for the model deployment. You can obtain it from Create deployment or the List deployments operation. |
Response example
Pay attention to the status field. When the status becomes DELETING, it indicates that the deployment is being deleted.
Response parameters
Response parameters are the same as Get a model deployment. For details, see the response parameters of Get a model deployment.
Error responses
Response example
Response parameters
Field | Type | Description |
|---|---|---|
request_id | String | The unique ID for the request. |
code | String | The error code. |
message | String | The error message. |
Error code | Error message | Error reason |
|---|---|---|
NotFound | Model: xxx not found! |
|
Conflict | Deployed model xxx already exists, please specify a suffix. | The specified suffix 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! | Invalid capacity units specified when creating or updating the deployment. |