All Products
Search
Document Center

Platform For AI:AddImage

Last Updated:Nov 18, 2025

Adds a custom image to a workspace.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paiimage:AddImage

create

*All Resource

*

None None

Request syntax

POST /api/v1/images HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request struct.

Name

string

Yes

The image name. The naming convention is as follows:

  • The name must be 1 to 50 characters long.

  • The name can contain lowercase letters, digits, and hyphens (-). It must start with a letter.

  • The name must be unique within the workspace.

nlp-compression

Description

string

No

The description of the image.

NLP模型压缩训练镜像

ImageUri

string

Yes

The URI of the image. The URI can be reused. For more information, see ListImage.

registry.cn-hangzhou.aliyuncs.com/pai-compression/nlp:gpu

Labels

array<object>

No

The labels of the image. This is an array where each item contains a key and a value. Official images have the following label: system.official=true The following keys are supported:

  • 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

object

No

A label.

Key

string

No

The key of the label.

system.chipType

Value

string

No

The value of the label.

GPU

WorkspaceId

string

No

The ID of the workspace to which the image belongs. For more information, see ListWorkspaces.

15******45

Accessibility

string

No

The visibility of the image. Valid values:

  • PUBLIC: All members of the workspace can perform operations on the image.

  • PRIVATE: Only the creator can perform operations on the image.

PUBLIC

Size

integer

No

The size of the image, in GB.

2

ImageId

string

No

The ID of the image. If you leave this parameter empty, the system automatically generates an ID. The format is `image-` followed by 18 uppercase letters, lowercase letters, or digits.

image-k83*****cv

SourceType

string

No

SourceId

string

No

Response elements

Element

Type

Description

Example

object

The response struct.

RequestId

string

The request ID.

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

ImageId

string

The image ID.

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

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.