Help Center/ ModelArts/ API Reference/ Training Management/ This API is used to obtain the public flavors supported by a training job.
Updated on 2026-07-24 GMT+08:00

This API is used to obtain the public flavors supported by a training job.

Function

This API is used to obtain the supported resource specifications of training jobs on ModelArts.

This API applies to the following scenario: When you need to know the resource specifications supported by the platform to configure training jobs, you can use this API to obtain the specification list. Before using this API, ensure that you have the permission to view the resource specifications. After the query is complete, the platform returns the supported resource specifications. If you do not have the permission to perform operations, the API will return an error message.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v2/{project_id}/training-job-flavors

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: User project ID. For details, see Obtaining a Project ID and Name.

Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A.

Default Value: N/A.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

flavor_type

No

String

Definition: type of the training job specifications.

Constraints: N/A

Range:

  • CPU

  • GPU

  • Ascend: NPU resource specifications

Default Value: If this parameter is not specified, all types of resource specifications are queried by default.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total_count

Integer

Definition: Total number of training job resource flavors.

Range: N/A.

flavors

Array of FlavorResponse objects

Definition: List of training job resource flavors.

Table 4 FlavorResponse

Parameter

Type

Description

pool_id

String

Definition: ID of the resource pool selected for a training job.

Range: N/A.

flavor_id

String

Definition: Resource flavor ID.

Range: N/A.

flavor_name

String

Definition: Resource flavor name.

Range: N/A.

max_num

Integer

Definition: Maximum number of nodes supported by a flavor.

Range: N/A.

flavor_type

String

Definition: Resource flavor type.

Range:

  • CPU: CPU resource specifications

  • GPU: GPU resource specifications

  • Ascend: NPU resource specifications

billing

BillingInfo object

Definition: Billing information of a resource flavor.

flavor_info

FlavorInfoResponse object

Definition: Resource flavor details.

attributes

Map<String,String>

Definition: Other specifications. key indicates the attribute name, and value indicates the attribute value. Both are of the string type.

Range: N/A

Table 5 BillingInfo

Parameter

Type

Description

code

String

Definition: Billing code.

Range: N/A.

unit_num

Integer

Definition: Number of billing units.

Range: N/A

Table 6 FlavorInfoResponse

Parameter

Type

Description

max_num

Integer

Definition: Maximum number of nodes that can be selected. The value 1 indicates that the distributed mode is not supported.

Range: N/A.

cpu

Cpu object

Definition: CPU specifications.

gpu

Gpu object

Definition: GPU specifications.

npu

Npu object

Definition: Ascend specifications.

memory

Memory object

Definition: Memory information.

disk

DiskResponse object

Definition: Disk information.

Table 7 Cpu

Parameter

Type

Description

arch

String

Definition: CPU architecture.

Range: N/A.

core_num

Integer

Definition: Number of cores.

Range: N/A.

Table 8 Gpu

Parameter

Type

Description

unit_num

Integer

Definition: Number of GPUs.

Range: N/A.

product_name

String

Definition: Product name.

Range: N/A.

memory

String

Definition: GPU memory capacity.

Range: N/A

Table 9 Npu

Parameter

Type

Description

unit_num

String

Definition: Number of NPUs.

Range: N/A.

product_name

String

Definition: Product name.

Range: N/A.

memory

String

Definition: NPU memory capacity.

Range: N/A

Table 10 Memory

Parameter

Type

Description

size

Integer

Definition: memory capacity.

Range: N/A

unit

String

Definition: memory capacity unit.

Range: GB.

Table 11 DiskResponse

Parameter

Type

Description

size

Integer

Definition: Disk size.

Range: N/A

unit

String

Definition: Unit of the disk size.

Range: GB.

Example Requests

Obtain all public CPU resource flavors for training jobs.

GET https://endpoint/v2/{project_id}/training-job-flavors?flavor_type=CPU

Example Responses

Status code: 200

ok

{
  "total_count" : 2,
  "flavors" : [ {
    "flavor_id" : "modelarts.vm.cpu.2u",
    "flavor_name" : "Computing CPU(2U) instance",
    "flavor_type" : "CPU",
    "billing" : {
      "code" : "modelarts.vm.cpu.2u",
      "unit_num" : 1
    },
    "flavor_info" : {
      "max_num" : 1,
      "cpu" : {
        "arch" : "x86",
        "core_num" : 2
      },
      "memory" : {
        "size" : 8,
        "unit" : "GB"
      },
      "disk" : {
        "size" : 50,
        "unit" : "GB"
      }
    }
  }, {
    "flavor_id" : "modelarts.vm.cpu.8u",
    "flavor_name" : "Computing CPU(8U) instance",
    "flavor_type" : "CPU",
    "billing" : {
      "code" : "modelarts.vm.cpu.8u",
      "unit_num" : 1
    },
    "flavor_info" : {
      "max_num" : 16,
      "cpu" : {
        "arch" : "x86",
        "core_num" : 8
      },
      "memory" : {
        "size" : 32,
        "unit" : "GB"
      },
      "disk" : {
        "size" : 50,
        "unit" : "GB"
      }
    }
  } ]
}

Status Codes

Status Code

Description

200

ok

Error Codes

See Error Codes.