# Get host price - GetUHostInstancePrice

## Overview

Get the price of the UHost instance based on the UHost instance configuration.






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `GetUHostInstancePrice`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **Zone** | string | Availability Zone. See [Availability Zone List](/docs/api/summary/regionlist) |No|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **CPU** | int | Number of CPU cores. Optional parameters: 1-64. Refer to the control panel for optional range. Default value: 4 |**Yes**|
| **Memory** | int | Memory size. Unit: MB. Range: [1024, 262144], must be a multiple of 1024 (optional range refers to the control panel). Default value: 8192 |**Yes**|
| **Count** | int | Number of purchases, range [1,5] |**Yes**|
| **Disks.N.IsBoot** | string | Is it a system disk. Enumeration value: <br /><br /> > True, it is a system disk <br /><br /> > False, it is a data disk (default). There can only be one disk in the Disks array that is a system disk. |**Yes**|
| **Disks.N.Size** | int | Disk size, in GB. Please refer to [Disk Type](api/uhost-api/disk_type). |**Yes**|
| **Disks.N.Type** | string | Disk type. Please refer to [Disk Type](api/uhost-api/disk_type). |**Yes**|
| **Disks.N.BackupType** | string | Disk Backup Plan. Enumerated values: <br /><br /> > NONE, no backup <br /><br /> > DATAARK, UDataArk <br /><br /> > SNAPSHOT, USnap<br /><br /> The backup modes currently supported by the disk refer to [Disk Type](api/uhost-api/disk_type)". |No|
| **ImageId** | string | Image Id, can be obtained through [DescribeImage](api/uhost-api/describe_image). If the Image Id is not provided, the system disk size must be provided. |No|
| **GPU** | int | Number of GPU card cores. Only GPU models support this field. |No|
| **ChargeType** | string | Billing mode. Enumerated values are: <br /><br /> > Year, pay annually; <br /><br /> > Month, pay monthly; <br /><br /> > Dynamic, pay hourly // >Spot preemptive instance <br /><br /> If a certain enumerated value is not passed, the default return is a combination of annual, monthly, and hourly prices. |No|
| **NetCapability** | string | Network Enhancement. Enumeration values: Normal, not enabled; Super, enable Network Enhancement 1.0. The default value is Normal. |No|
| **UHostType** | string | [To be deprecated] Cloud host machine type (V1 version concept). Refer to [Cloud host machine type description](api/uhost-api/uhost_type). |No|
| **MachineType** | string | Cloud Host Type (Concept of V2 version). Enumeration values ["N", "C", "G", "O", "OS", "OPRO", "OMAX", "O.BM", "O.EPC"]. Refer to [Cloud Host Type Description](api/uhost-api/uhost_type). |No|
| **GpuType** | string | GPU type, enumeration values ["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S",2080","2080TiS","2080TiPro","3090","4090","4090Pro","A100","A800"] |No|
| **Quantity** | int | Purchase duration. Default: 1. This parameter is not required when purchasing hourly (Dynamic). When paying monthly, pass this parameter as 0, which represents purchase until the end of the month. |No|
| **CpuPlatform** | string | Value "Intel" "Amd", default value "Intel". |No|
| **UDSetUHostInstance** | boolean | Dedicated Cloud Host. If you want to create a cloud host on a dedicated host, this parameter can be set to true. |No|
| **ShowPriceDetails** | boolean | Return detailed price information |No|
| **UHostFamily** | string | Specification family. Consists of model code and CPU platform, used to specify the hardware type and processor platform of the UHost.<br /><br />When MachineType is "O" (Quick Type), the following values are supported:<br />- o1i: Quick Type O1 generation, Intel platform<br />- o1a: Quick Type O1 generation, AMD platform<br />- o1r: Quick Type O1 generation, ARM platform<br />- o2i: Quick Type O2 generation, Intel platform Default value: o1i or o1a or o1r (the system will automatically choose based on resource availability)<br /><br />When MachineType is "OM" (Quick Shared Type), the following values are supported:<br />- om1i: Quick Memory Enhanced Type OM1 generation, Intel platform<br />- om2i: Quick Memory Enhanced Type OM2 generation, Intel platform<br /><br />Note: The specification family must match the MachineType, otherwise the request will be rejected. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **PriceSet** | array[[*UHostPriceSet*](#uhostpriceset)] | Price List UHostPriceSet |No|

#### Data Model


#### UHostPriceSet

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ChargeType** | string | Billing Type. Yearly, Monthly, Dynamic |**Yes**|
| **Price** | float | Price, unit: Yuan, retain two valid digits after the decimal point |**Yes**|
| **OriginalPrice** | float | The original price before the limited-time discount (i.e., the unit price after the list price is multiplied by the business discount). |**Yes**|
| **PriceDetail** | [*PriceDetail*](#pricedetail) | Detailed price information (only returned by the inquiry interface). |No|
| **OriginalPriceDetail** | [*PriceDetail*](#pricedetail) | Original price details (only returned by the inquiry interface). |No|

#### PriceDetail

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **UHost** | float | Host Price |No|
| **UDisk** | float | UDisk Price |No|
| **Snapshot** | float | Snapshot Price |No|
| **Volume** | float | Volume Price |No|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=GetUHostInstancePrice
&Region=cn-bj2
&Zone=cn-bj2-04
&ProjectId=org-xxx
&ImageId=xxx
&MachineType=N
&CPU=2
&Memory=4096
&Count=1
&ChargeType=Dynamic
&Disks.0.Size=40
&Disks.0.IsBoot=True
&Disks.0.Type=CLOUD_SSD
&CpuPlatform=pmuJsysU
&Volumes.N.Type=asluorww
&Volumes.N.Size=3
&Volumes.N.IsBoot=eHeLEeHi
&HpcEnhanced=false
&GpuTyp=pmujj
&GPU=1
&UDSetUHostInstance=true
&ShowPriceDetails=true
&UHostFamily=cFaXhzxa
```

### Response Example
    
```json
{
  "Action": "GetUHostInstancePriceResponse",
  "PriceSet": [
    {
      "ChargeType": "Dynamic",
      "Price": 0.42
    }
  ],
  "RetCode": 0
}
```





