This topic shows you how to deploy a Qwen model on Alibaba Cloud Model Studio by using API calls.
Prerequisites
- You have read the Model Deployment Overview and are familiar with the supported models and basic deployment steps.
- Obtain an API key and export the API key as an environment variable.
1. Deploy the model
The following command uses the fine-tuned custom model qwen3-8b-ft-202511132025-0260 to create a dedicated service named qwen3-8b-ft-202511132025-0260.
To obtain the custom model ID, go to the Model Studio console - model finetuning page. Click the Task Name of the model you want to deploy, click Outputs, and then click the blue model name. This opens the My Models page, where you can find the Model ID in the basic information section.
Use the Model IDas the input for the model_name parameter to deploy the model by using the API.
- Provisioned Throughput (PTU)
- Model unit
- Token usage
After you run the deployment command, billing starts as soon as the service is successfully deployed, even if you do not use it. Before proceeding, we recommend you review the service billing rules.
deployed_model is the unique ID of the dedicated service.
2. Query service status
Run the following command to query the details of a specific dedicated service:
RUNNING, the service deployment is complete.
3. Make inference requests
If this is your first time using the DashScope SDK, see Install the SDK.Ensure the API Key's workspace matches the model's deployment workspace.
4. Delete the dedicated service
If you no longer need a dedicated service, you can delete it by using the following command:
API reference
For details on the API calls, see API details.
FAQ
Permission errors during deployment
When deploying a model by using an API, ensure the following:
-
The API Key's Workspace must have permission to manage the model. Go to the Business Space Management page in Model Studio and check the model deployment permission settings for the corresponding workspace.
API call error:
In the Actions column for the corresponding workspace, click Model Permission and Flow Control Settings. In the Model List, find the target model and check the authorization status in the Model Deployment column. If it shows Not Authorized, click Edit in the Actions column to grant permission. If you are prompted about insufficient permissions, contact your organization or IT administrator to add the relevant permissions or perform the operation on your behalf.Workspace xxx does not have deployment privilege for model xxxx. -
The Owner Account that owns the API Key has the required permissions in the Workspace. Go to the Model Studio console, click the workspace in the lower-left corner, switch to the correct workspace, and then click
to check the model deployment permission settings.
API call error:
In the left-side navigation pane, click Permission Management and confirm that the user list includes the API Key's owner account (with type primary account). If you are prompted about insufficient permissions, contact your organization or IT administrator to add the relevant permissions or perform the operation on your behalf.Workspace access denied.