tencentcloud-sdk-nodejs-tokenhub 4.1.309 → 4.1.312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs-tokenhub",
3
- "version": "4.1.309",
3
+ "version": "4.1.312",
4
4
  "description": "腾讯云 API NODEJS SDK",
5
5
  "main": "./tencentcloud/index.js",
6
6
  "module": "./es/index.js",
@@ -95,8 +95,10 @@ export declare class Client extends TencentCloudCommon.AbstractClient {
95
95
  指标族(MetricType)
96
96
  - `tokens`(默认):Token 用量统计。支持 Dimension = apikey / endpoint / model。
97
97
  返回指标:TotalToken(总)/ InputTotalToken(输入)/ OutputTotalToken(输出)/ CacheTotalToken(读缓存)。
98
- - `search`:【待上线】联网搜索用量统计。支持 Dimension = apikey / endpoint / model。
98
+ - `search`:联网搜索用量统计。支持 Dimension = apikey / endpoint / model。
99
99
  返回指标:SearchRequestCount(搜索请求数)/ SearchCount(搜索引擎调用次数)。
100
+ - `apikey_usage`:APIKey 锚定用量统计(某 APIKey 下按模型或接入点展开)。支持 Dimension = endpoint / model。
101
+ 返回指标:TotalToken(总 Token)/ InputTotalToken(输入 Token)/ OutputTotalToken(输出 Token)/ CacheTotalToken(读缓存)/ RequestCount(请求次数)/ SuccessCount(成功次数)。
100
102
 
101
103
  响应内容
102
104
  - MetricType 字段用于切换指标族,响应回显 MetricType 与 MetricKeys。
@@ -145,8 +145,10 @@ class Client extends TencentCloudCommon.AbstractClient {
145
145
  指标族(MetricType)
146
146
  - `tokens`(默认):Token 用量统计。支持 Dimension = apikey / endpoint / model。
147
147
  返回指标:TotalToken(总)/ InputTotalToken(输入)/ OutputTotalToken(输出)/ CacheTotalToken(读缓存)。
148
- - `search`:【待上线】联网搜索用量统计。支持 Dimension = apikey / endpoint / model。
148
+ - `search`:联网搜索用量统计。支持 Dimension = apikey / endpoint / model。
149
149
  返回指标:SearchRequestCount(搜索请求数)/ SearchCount(搜索引擎调用次数)。
150
+ - `apikey_usage`:APIKey 锚定用量统计(某 APIKey 下按模型或接入点展开)。支持 Dimension = endpoint / model。
151
+ 返回指标:TotalToken(总 Token)/ InputTotalToken(输入 Token)/ OutputTotalToken(输出 Token)/ CacheTotalToken(读缓存)/ RequestCount(请求次数)/ SuccessCount(成功次数)。
150
152
 
151
153
  响应内容
152
154
  - MetricType 字段用于切换指标族,响应回显 MetricType 与 MetricKeys。
@@ -176,19 +176,19 @@ export interface ModelImage {
176
176
  */
177
177
  export interface UsageSeries {
178
178
  /**
179
- * <p>[tokens 族]总 token 数用量时间周期内的 JSON 字符串形式,如 <code>&quot;[12,null,15]&quot;</code>。</p>
179
+ * <p>[tokens / apikey_usage 族]总 token 数用量时间周期内的 JSON 字符串形式,如 <code>&quot;[12,null,15]&quot;</code>。</p>
180
180
  */
181
181
  TotalToken?: string;
182
182
  /**
183
- * <p>[tokens 族]输入 token 数用量时间周期内的 JSON 字符串形式,如 <code>&quot;[7,null,9]&quot;</code>。</p>
183
+ * <p>[tokens / apikey_usage 族]输入 token 数用量时间周期内的 JSON 字符串形式,如 <code>&quot;[7,null,9]&quot;</code>。</p>
184
184
  */
185
185
  InputTotalToken?: string;
186
186
  /**
187
- * <p>[tokens 族]输出 token 数用量时间周期内的 JSON 字符串形式,如 <code>&quot;[5,null,6]&quot;</code>。</p>
187
+ * <p>[tokens / apikey_usage 族]输出 token 数用量时间周期内的 JSON 字符串形式,如 <code>&quot;[5,null,6]&quot;</code>。</p>
188
188
  */
189
189
  OutputTotalToken?: string;
190
190
  /**
191
- * <p>[tokens 族]读缓存 token 数用量时间周期内的 JSON 字符串形式,如<code>&quot;[5,null,6]&quot;</code>。</p>
191
+ * <p>[tokens / apikey_usage 族]读缓存 token 数用量时间周期内的 JSON 字符串形式,如<code>&quot;[5,null,6]&quot;</code>。</p>
192
192
  */
193
193
  CacheTotalToken?: string;
194
194
  /**
@@ -199,6 +199,14 @@ export interface UsageSeries {
199
199
  * <p>[search 族] 搜索引擎调用次数用量时间周期内的 JSON 字符串形式,如<code>&quot;[5,null,6]&quot;</code>。</p>
200
200
  */
201
201
  SearchCount?: string;
202
+ /**
203
+ * <p>[apikey_usage 族] 请求次数在时间周期内的 JSON 字符串形式,如 <code>&quot;[12,null,15]&quot;</code>。</p>
204
+ */
205
+ RequestCount?: string;
206
+ /**
207
+ * <p>[apikey_usage 族] 请求失败次数在时间周期内的 JSON 字符串形式,如 &quot;[12,null,15]&quot;。</p>
208
+ */
209
+ RequestFailCount?: string;
202
210
  }
203
211
  /**
204
212
  * DescribeTokenPlanList返回参数结构体
@@ -1190,33 +1198,41 @@ export interface TokenPlanPackageInfo {
1190
1198
  RemainCycles?: number;
1191
1199
  }
1192
1200
  /**
1193
- * 时间周期内的统计聚合值(按 metric key 索引)。声明 tokens / search 两族字段都在本 schema 中,按 MetricKeys 实际返回取值,参见响应顶层 `MetricKeys` 字段。
1201
+ * 时间周期内的统计聚合值,按 MetricKeys 实际返回取值,参见响应顶层 `MetricKeys` 字段。
1194
1202
  */
1195
1203
  export interface UsageStats {
1196
1204
  /**
1197
- * <p>[tokens 族] 时间周期内的累计总 token 数。</p>
1205
+ * <p>[tokens / apikey_usage 族] 时间周期内的累计总 token 数。</p>
1198
1206
  */
1199
1207
  TotalToken?: number;
1200
1208
  /**
1201
- * <p>[tokens 族] 时间周期内的累计输入 token 数。</p>
1209
+ * <p>[tokens / apikey_usage 族] 时间周期内的累计输入 token 数。</p>
1202
1210
  */
1203
1211
  InputTotalToken?: number;
1204
1212
  /**
1205
- * <p>[tokens 族] 时间周期内的累计输出 token 数。</p>
1213
+ * <p>[tokens / apikey_usage 族] 时间周期内的累计输出 token 数。</p>
1206
1214
  */
1207
1215
  OutputTotalToken?: number;
1208
1216
  /**
1209
- * <p>[tokens 族] 时间周期内的累计读缓存 token 数(命中缓存部分)</p>
1217
+ * <p>[tokens / apikey_usage 族] 时间周期内的累计读缓存 token 数(命中缓存部分)注意:CacheTotalToken 是 InputTotalToken 的子集(已包含在内)。</p>
1210
1218
  */
1211
1219
  CacheTotalToken?: number;
1212
1220
  /**
1213
- * <p>[search 族] 整段累计联网搜索请求数</p>
1221
+ * <p>[search 族] 时间周期内的累计联网搜索请求数</p>
1214
1222
  */
1215
1223
  SearchRequestCount?: number;
1216
1224
  /**
1217
- * <p>[search 族] 整段累计搜索引擎调用次数</p>
1225
+ * <p>[search 族] 时间周期内的累计搜索引擎调用次数</p>
1218
1226
  */
1219
1227
  SearchCount?: number;
1228
+ /**
1229
+ * <p>[apikey_usage 族] 时间周期内的累计请求次数</p>
1230
+ */
1231
+ RequestCount?: number;
1232
+ /**
1233
+ * <p>[apikey_usage 族] 时间周期内的累计请求失败次数</p>
1234
+ */
1235
+ RequestFailCount?: number;
1220
1236
  }
1221
1237
  /**
1222
1238
  * DescribeUsageRankList返回参数结构体
@@ -1227,11 +1243,11 @@ export interface DescribeUsageRankListResponse {
1227
1243
  */
1228
1244
  Dimension?: string;
1229
1245
  /**
1230
- * <p>回填请求的指标族:tokens / search 。</p>
1246
+ * <p>回填请求的指标族:取值同入参 MetricType(tokens / search / apikey_usage)</p><p>枚举值:</p><ul><li>tokens: tokens</li></ul>
1231
1247
  */
1232
1248
  MetricType?: string;
1233
1249
  /**
1234
- * <p>本次响应中 Stats / Series / PageStats / TotalStats 实际包含的 metric key 列表,按MetricType 区分:tokens=[Total,Input,Output,Cache]search=[SearchRequestCount,SearchCount]</p>
1250
+ * <p>本次响应中 Stats / Series / PageStats / TotalStats 实际包含的 metric key 列表,按MetricType 区分:<br>tokens=[TotalToken, InputTotalToken, OutputTotalToken, CacheTotalToken]<br>search=[SearchRequestCount,SearchCount]<br>apikey_usage=[TotalToken, InputTotalToken, OutputTotalToken, CacheTotalToken, RequestCount, RequestFailCount]</p>
1235
1251
  */
1236
1252
  MetricKeys?: Array<string>;
1237
1253
  /**
@@ -1267,7 +1283,7 @@ export interface DescribeUsageRankListResponse {
1267
1283
  */
1268
1284
  Timestamps?: Array<number | bigint>;
1269
1285
  /**
1270
- * <p>对象排行列表,按<code>MetricKeys[0]</code>降序排序。ShowAll=false 时为当前页 10 个对象(含 Series);ShowAll=true 时为全量对象(不含 Series,用于 CSV 导出)。</p>
1286
+ * <p>对象排行列表,按 SortKey 降序排序。ShowAll=false 时为当前页 10 个对象(含 Series);ShowAll=true 时为全量对象(不含 Series,用于 CSV 导出)。</p>
1271
1287
  */
1272
1288
  TopList?: Array<UsageRankItem>;
1273
1289
  /**
@@ -1278,6 +1294,10 @@ export interface DescribeUsageRankListResponse {
1278
1294
  * <p>总统计结果</p>
1279
1295
  */
1280
1296
  TotalStats?: UsageStats;
1297
+ /**
1298
+ * <p>排序指标键</p>
1299
+ */
1300
+ SortKey?: string;
1281
1301
  /**
1282
1302
  * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
1283
1303
  */
@@ -1802,9 +1822,13 @@ export interface DescribeUsageRankListRequest {
1802
1822
  */
1803
1823
  EndTime: string;
1804
1824
  /**
1805
- * <p>指标族切换字段。</p><ul><li>tokens(默认):Token 消耗图(statistics=sum),支持 Dimension = apikey/endpoint/model</li><li>search【待上线】:联网搜索调用次数(statistics=sum),仅支持 Dimension = model</li><li>其他值返回 InvalidParameter。</li></ul><p>枚举值:</p><ul><li>tokens: tokens</li></ul>
1825
+ * <p>指标族切换字段。</p><ul><li>tokens(默认):Token 用量消耗(statistics=sum),支持 Dimension = apikey/endpoint/model</li><li>search:联网搜索调用次数(statistics=sum),仅支持 Dimension = model</li><li>apikey_usage: APIKey 锚定用量统计(某 APIKey 下按模型或接入点展开)(statistics=sum),支持 Dimension = endpoint/model</li><li>其他值返回 InvalidParameter。</li></ul>
1806
1826
  */
1807
1827
  MetricType?: string;
1828
+ /**
1829
+ * <p>锚定对象,用于缩小统计范围「在哪个具体对象之内」,MetricType 为 apikey_usage 时必填。<br>各 MetricType 是否支持/如何使用 Anchor,见 MetricType 字段说明。</p>
1830
+ */
1831
+ Anchor?: string;
1808
1832
  /**
1809
1833
  * <p>维度过滤值。空字符串表示查询全部对象,非空时仅查询指定单个对象(如指定 APIKey ID)。最大 256 字符。</p>
1810
1834
  */
@@ -1821,6 +1845,10 @@ export interface DescribeUsageRankListRequest {
1821
1845
  * <p>是否返回全量结果。</p><ul><li>false(默认):按 Offset 分页返回 TopList(每页 10 条),每个对象包含<br>Series 时序点用于绘制曲线。</li><li>true:忽略 Offset,返回全量对象列表,不返回 Series(CSV 导出场景)。</li></ul>
1822
1846
  */
1823
1847
  ShowAll?: boolean;
1848
+ /**
1849
+ * <p>排序指标键(可选),具体值见响应 MetricKeys。为空时按 <code>MetricKeys[0]</code> 降序排序(tokens/apikey_usage 族为 TotalToken,search 族为 SearchRequestCount)。非法值返回 InvalidParameter。</p>
1850
+ */
1851
+ SortKey?: string;
1824
1852
  }
1825
1853
  /**
1826
1854
  * CreateGlossaryEntries请求参数结构体