> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/compute/zec/instance/inquirypricemodifyinstancetype.md).

# InquiryPriceModifyInstanceType

## 1. API Description

This API (InquiryPriceModifyInstanceType) is used to inquire the price after changing the instance type.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type   | Description                                                                                                                                                                                                                                                                                                                                                             |
| -------------- | -------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| instanceId     | Yes      | String | ID of the instance whose instance type is to be changed.                                                                                                                                                                                                                                                                                                                |
| instanceType   | Yes      | String | Target instance type to change to. For VM instances, the value can be obtained through [DescribeZoneInstanceConfigInfos](/api-reference/compute/zec/instance/describezoneinstanceconfiginfos.md). For GPU instances, the value can be obtained through [DescribeZoneGpuInstanceConfigInfos](/api-reference/compute/zec/instance/describezonegpuinstanceconfiginfos.md). |

## 3. Output Parameters

| Parameter Name  | Type                                                               | Description                                                                                                                                    |
| --------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| requestId       | String                                                             | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p>                          |
| specPrice       | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem) | Price of the instance type after the change. Returned when modifying a VM instance. Null when modifying a GPU instance.                        |
| gpuPrice        | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem) | <p>Price of the GPU instance type after the modification.</p><p>Returned when modifying a GPU instance. Null when modifying a VM instance.</p> |
| systemDiskPrice | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem) | Price of the system disk.                                                                                                                      |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Inquire the price after changing the instance type. VM instances return specPrice, GPU instances return gpuPrice.**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryPriceModifyInstanceType
<Common Request Params>

Request (VM instance)：
{
  "instanceId": "instanceId-xxx",
  "instanceType": "z2a.cpu.1"
}

Response (VM instance)：
{
  "requestId": "T12345678-A123-4B5C-DE67-8F9G01234567",
  "response": {
    "requestId": "T12345678-A123-4B5C-DE67-8F9G01234567",
    "specPrice": {
      "discount": 95.0,
      "discountPrice": 1444.0,
      "originalPrice": 1520.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "gpuPrice": null,
    "systemDiskPrice": {
      "discount": 100.0,
      "discountPrice": 20.0,
      "originalPrice": 20.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    }
  }
}

Request (GPU instance)：
{
  "instanceId": "instanceId-yyy",
  "instanceType": "z3a.g.C49.c8m32.1"
}

Response (GPU instance)：
{
  "requestId": "T12345678-A123-4B5C-DE67-8F9G01234568",
  "response": {
    "requestId": "T12345678-A123-4B5C-DE67-8F9G01234568",
    "specPrice": null,
    "gpuPrice": {
      "discount": 100.0,
      "discountPrice": 3000.0,
      "originalPrice": 3000.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "systemDiskPrice": {
      "discount": 100.0,
      "discountPrice": 20.0,
      "originalPrice": 20.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    }
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                    | Description                             |
| ---------------- | ----------------------------- | --------------------------------------- |
| 404              | INVALID\_INSTANCE\_NOT\_FOUND | Instance not found.                     |
| 404              | INVALID\_PRODUCT\_NOT\_FOUND  | Specified instance type does not exist. |
