All Products
Search
Document Center

Platform For AI:ListModelVersions

Last Updated:Oct 20, 2025

Retrieves a list of model versions.

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

paimodel:ListModelVersions

list

*All Resource

*

None

None

Request syntax

GET /api/v1/models/{ModelId}/versions HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ModelId

string

Yes

The model ID. For more information, see ListModels.

model-dajbueh******

Request parameters

Parameter

Type

Required

Description

Example

PageNumber

integer

No

The page number of the model version list. The value starts from 1. The default value is 1.

1

PageSize

integer

No

The number of entries to return on each page for a paged query. The default value is 10.

10

Order

string

No

The order in which to sort the entries in the paged query. The default value is ASC.

  • ASC: ascending order.

  • DESC: descending order.

DESC

SortBy

string

No

The field to use for sorting in the paged query. Currently, the GmtCreateTime field is used for sorting.

GmtCreateTime

VersionName

string

No

The model version name. This parameter is used to filter the model version list.

1.0.1

FormatType

string

No

The model format. This parameter is used to filter the model version list. Valid values:

  • OfflineModel

  • SavedModel

  • Keras H5

  • Frozen Pb

  • Caffe Prototxt

  • TorchScript

  • XGBoost

  • PMML

  • AlinkModel

  • ONNX

Valid values:

  • OfflineModel :

    OfflineModel

  • SavedModel :

    SavedModel

  • Keras H5 :

    Keras H5

  • Frozen Pb :

    Frozen Pb

  • Caffe Prototxt :

    Caffe Prototxt

  • TorchScript :

    TorchScript

  • XGBoost :

    XGBoost

  • PMML :

    PMML

  • AlinkModel :

    AlinkModel

  • ONNX :

    ONNX

SavedModel

FrameworkType

string

No

The model framework. This parameter is used to filter the model version list. Valid values:

  • Pytorch -XGBoost

  • Keras

  • Caffe

  • Alink

  • Xflow

  • TensorFlow

Valid values:

  • Pytorch :

    Pytorch

  • XGBoost :

    XGBoost

  • Keras :

    Keras

  • Caffe :

    Caffe

  • Alink :

    Alink

  • Xflow :

    Xflow

  • TensorFlow :

    TensorFlow

TensorFlow

SourceType

string

No

The source type of the model. This parameter is used to filter the model version list. Valid values:

  • Custom (default): a custom model.

  • PAIFlow: a model from a PAI pipeline.

  • TrainingService: a model from a PAI training service.

Valid values:

  • PAIFlow :

    PAIFlow

  • Custom :

    Custom

  • TrainingService :

    TrainingService

PAIFlow

SourceId

string

No

The source ID.

  • If the source type is Custom, this parameter is not restricted.

  • If the source is PAIFlow or TrainingService, the format is as follows:

region=<region_id>,workspaceId=<workspace_id>,kind=<kind>,id=<id>

where:

  • region is the Alibaba Cloud region ID.

  • workspaceId is the workspace ID.

  • kind: the type. Valid values: PipelineRun (PAIFlow pipeline) and ServiceJob (training service).

  • id: the unique identifier.

region=cn-shanghai,workspaceId=13**,kind=PipelineRun,id=run-sakdb****jdf

Label

string

No

The label string. This parameter is used to filter the list. Model versions that have the specified string in the key or value of their labels are returned.

key1

ApprovalStatus

string

No

The approval status. This parameter is used to filter the model version list. Valid values:

  • Pending: The model version is pending approval.

  • Approved: The model version is approved for publishing.

  • Rejected: The model version is rejected for publishing.

Approved

Response elements

Element

Type

Description

Example

object

The response body.

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC***3C83E

Versions

array

The list of model versions.

ModelVersion

The model version.

TotalCount

integer

The total number of model versions.

15

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC***3C83E",
  "Versions": [
    {
      "VersionName": "0.1.0",
      "GmtCreateTime": "2021-01-21T17:12:35Z",
      "GmtModifiedTime": "2021-01-21T17:12:35Z",
      "UserId": "155770209******",
      "OwnerId": "155770209******",
      "Uri": "oss://mybucket.oss-cn-beijing.aliyuncs.com/mypath/",
      "VersionDescription": "情感分析。",
      "FormatType": "SavedModel",
      "FrameworkType": "TensorFlow",
      "Options": "{}",
      "SourceType": "PAIFlow",
      "SourceId": "region=cn-shanghai,workspaceId=13**,kind=PipelineRun,id=run-sakdb****jdf",
      "ApprovalStatus": "Approved",
      "Labels": [
        {
          "Value": "v1",
          "Key": "k1"
        }
      ],
      "Metrics": {
        "Results": [
          {
            "Dataset": {
              "DatasetId": "d-sdkjanksaklerhfd"
            },
            "Metrics": {
              "cer": 0.175
            }
          },
          {
            "Dataset": {
              "Uri": "oss://xxxx/"
            },
            "Metrics": {
              "cer": 0.172
            }
          }
        ]
      },
      "TrainingSpec": {},
      "InferenceSpec": {
        "processor": "tensorflow_gpu_1.12"
      },
      "EvaluationSpec": {},
      "CompressionSpec": {},
      "ExtraInfo": {
        "CoverUris": [
          "https://e***u.oss-cn-hangzhou.aliyuncs.com/st****017.preview.png"
        ],
        "TrainedWords": [
          "albedo_overlord"
        ]
      },
      "DistillationSpec": {}
    }
  ],
  "TotalCount": 15
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.