All Products
Search
Document Center

Platform For AI:AddImage

Last Updated:May 23, 2025

Adds a custom image to a workspace.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
paiimage:AddImagecreate
*All Resources
*
    none
none

Request syntax

POST /api/v1/images HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request data.

NamestringYes

The image name. The name must meet the following requirements:

  • The name must be 1 to 50 characters in length.
  • The name can contain lowercase letters, digits, and hyphens (-). The name must start with a lowercase letter.
  • The name must be unique in a workspace.
nlp-compression
DescriptionstringNo

The image description.

ImageUristringYes

The URL of the image, which can be repeated. You can call ListImage to view the image URL.

registry.cn-hangzhou.aliyuncs.com/pai-compression/nlp:gpu
Labelsarray<object>No

The image tag, which is an array. Each element in the array contains a key-value pair. Alibaba Cloud images have the system.official=true tag. You can add the following keys to an image:

  • system.chipType
  • system.dsw.cudaVersion
  • system.dsw.fromImageId
  • system.dsw.fromInstanceId
  • system.dsw.id
  • system.dsw.os
  • system.dsw.osVersion
  • system.dsw.resourceType
  • system.dsw.rootImageId
  • system.dsw.stage
  • system.dsw.tag
  • system.dsw.type
  • system.framework
  • system.origin
  • system.pythonVersion
  • system.source
  • system.supported.dlc
  • system.supported.dsw
objectNo

The tag.

KeystringNo

The tag key.

system.chipType
ValuestringNo

The tag value.

GPU
WorkspaceIdstringNo

The workspace ID. You can call ListWorkspaces to obtain the workspace ID.

15******45
AccessibilitystringNo

The accessibility of the image. Valid values:

  • PUBLIC: The image is accessible to all members in the workspace.
  • PRIVATE: The image is accessible only to the image creator.
PUBLIC
SizeintegerNo

The size of the image. Unit: GB.

2
ImageIdstringNo

The image ID. If you do not specify this parameter, the system automatically generates an image ID. The image ID must start with image- followed by 18 characters in letters or digits.

image-k83*****cv

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

RequestIdstring

The request ID.

5A14FA81-DD4E-******-6343FE44B941
ImageIdstring

The image ID.

image-4c62******53uor

Examples

Sample success responses

JSONformat

{
  "RequestId": "5A14FA81-DD4E-******-6343FE44B941",
  "ImageId": "image-4c62******53uor"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-04-01The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-07-09The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-06-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-12-14The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-12-14The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-08-12The internal configuration of the API is changed, but the call is not affectedView Change Details
2021-09-22Add OperationView Change Details