# 批量查询模型价格 - GetUFSquareModelPrices

## 简介

批量查询模型价格




## 使用方法

您可以选择以下方式中的任意一种，发起 API 请求：
- 多语言 OpenSDK / [Go](https://github.com/ucloud/ucloud-sdk-go) / [Java](https://github.com/ucloud/ucloud-sdk-java) / [Python](https://github.com/ucloud/ucloud-sdk-python3) / [JavaScript](https://github.com/ucloud/ucloud-sdk-js) / [PHP](https://github.com/ucloud/ucloud-sdk-php) /
- [CloudShell 云命令行](https://shell.ucloud.cn/)

## 定义

### 公共参数

| 参数名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Action**     | string  | 对应的 API 指令名称，当前 API 为 `GetUFSquareModelPrices`                        | **Yes** |
| **PublicKey**  | string  | 用户公钥，可从 [控制台](https://console.ucloud.cn/uaccount/api_manage) 获取                                             | **Yes** |
| **Signature**  | string  | 根据公钥及 API 指令生成的用户签名，参见 [签名算法](https://docs.ucloud.cn/api/summary/signature)  | **Yes** |

### 请求参数

| 参数名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Keyword** | string | 模型名称模糊搜索（例：deepseek-r1） |No|
| **Offset** | int | 列表起始位置偏移量，默认为0 |No|
| **Limit** | int | 返回数据长度，默认为20 |No|

### 响应字段

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **RetCode** | int | 返回状态码，为 0 则为成功返回，非 0 为失败 |**Yes**|
| **Action** | string | 操作指令名称 |**Yes**|
| **Message** | string | 返回错误消息，当 `RetCode` 非 0 时提供详细的描述信息 |No|
| **Models** | array[[*ModelPriceGroup*](#modelpricegroup)] | 匹配模型的价格信息 |**Yes**|
| **TotalCount** | int | 总条数用于翻页 |No|

#### 数据模型

#### ModelPriceGroup

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Manufacturer** | string | 制造商 |**Yes**|
| **ModelName** | string | 模型名称 |No|
| **ModelId** | string | ModelId |No|
| **Tiers** | array[[*PriceTier*](#pricetier)] | 价格阶梯（有序数组） |No|

#### PriceTier

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Rates** | array[[*PriceRate*](#pricerate)] | 该档位下的收费列表（有序数组） |**Yes**|
| **DescriptionEn** | string | 档位描述（例如 "标准上下文 32k"） |**Yes**|
| **Condition** | string | 档位/条件（例如 "32k"、"128k"） |No|
| **Description** | string | 档位描述（例如 "标准上下文 32k"） |No|

#### PriceRate

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **ChargeItemDescriptionEn** | string | 收费项描述英文描述 |**Yes**|
| **Currency** | string | 货币单位 |**Yes**|
| **Unit** | string | 计价单位 |**Yes**|
| **UnitEn** | string | 计价单位英文 |**Yes**|
| **ChargeItem** | string | 收费项：input/output/thinking/tool... |No|
| **ChargeItemDescription** | string | 收费项描述 |No|
| **Price** | string | 价格 |No|

## 示例

### 请求示例
```
https://api.ucloud.cn/?Action=GetUFSquareModelPrices
&Region=cn-zj
&Zone=cn-zj-01
&Keyword=tUpakpEx
&Offset=2
&Limit=2
```

### 响应示例
```json
{
  "Action": "GetUFSquareModelPricesResponse",
  "Models": [
    {
      "ModelId": "OimToelj",
      "ModelName": "vNbcKKTy",
      "Tiers": [
        {
          "Condition": "eNlQgdAu",
          "Description": "sVuQZmlZ",
          "Rates": [
            {
              "ChargeItem": "qoFeTVec",
              "ChargeItemDescription": "jydMPQin",
              "Price": "xgXpKJwx"
            }
          ]
        }
      ]
    }
  ],
  "RetCode": 0,
  "TotalCount": 4
}
```
