Call the POST /api/v1/models/permissions endpoint to update model authorization (inference / fine-tuning / deployment) in a specified workspace. Both per-model authorization and "authorize all" modes are supported.
Prerequisites
An API key has been created and configured as the environment variable DASHSCOPE_API_KEY. For more information, see Configure an API key in environment variables.
Request
- HTTP method: POST
-
Request URL
Replace
{WorkspaceId}with your workspace ID.Region
Endpoint
China (Beijing)
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/models/permissions -
Authentication
Set
Authorization: Bearer {API_KEY}in the request header.
Request parameters
All parameters are passed through the request body.
Parameter | Type | Required | Description |
|---|---|---|---|
models | Array[Object] | Conditionally required | List of per-model authorization items. Can be empty when |
models[].model | String | Yes | The model ID. Cannot be empty. Examples: |
models[].inference | Boolean | No | Model calling permission. |
models[].finetune | Boolean | No | Model training permission. |
models[].deploy | Boolean | No | Model deployment permission. |
access_all_entities | String | No | Authorize-all switch. Valid values:
When |
Response parameters
Parameter | Type | Description |
|---|---|---|
request_id | String | The request ID. Example: |
code | String | Error code. |
message | String | Error message. |
success | Boolean | Whether the call succeeded. Example: |
output | Object | Business data. |