查询服务调用详情
更新时间:2025-07-16
接口描述
本接口用于查询服务调用详情。
鉴权说明
调用本文API,使用“基于安全认证AK/SK”进行签名计算鉴权,即使用安全认证中的Access Key ID 和 Secret Access Key进行鉴权,具体鉴权认证机制参考HTTP调用鉴权说明。
请求结构
POST /v2/service?Action=DescribeServiceStats HTTP/1.1
Host: qianfan.baidubce.com
Authorization: authorization string
Content-Type: application/json
{
"serviceId": ["svco-tv5t4zpkj3za"],
"appId": ["1483416575"],
"startTime": "2025-03-30T16:00:00Z",
"endTime": "2025-03-31T15:59:00Z",
"interval": 86400,
"protocolVersion":2
}请求头域
除公共头域外,无其它特殊头域。
请求参数
- Query参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Action | string | 是 | 方法名称,固定值DescribeServiceStats |
- Body参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| serviceId | List<string> | 是 | 服务ID,说明: (1)不填写该字段,默认查询全部服务ID (2)可以通过任一方式获取: 方式一:通过调用接口创建服务,返回参数serviceId获取 方式二:通过千帆控制台-在线推理-我的服务页面,点击某服务详情查看,如下图所示: ![]() |
| appId | List<string> | 否 | 应用ID,说明: (1)不填写该字段,默认查询全部应用 (2)通过控制台-系统管理与统计-应用接入页面,查看AppID,如下图所示: ![]() |
| startTime | string | 是 | 查询起始时间,格式如2025-03-30T16:00:00Z |
| endTime | string | 是 | 查询终止时间,格式如2025-03-31T15:59:00Z |
| Interval | Integer | 是 | 时间粒度,可选值: · 86400:按天 · 3600:按小时 · 60:按分钟 |
| protocolVersion | int | 否 | 服务版本,可选值如下: · 1 · 2 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
| 名称 | 类型 | 描述 |
|---|---|---|
| requestId | string | 请求ID |
| result | object | 请求结果 |
result说明
| 名称 | 类型 | 描述 |
|---|---|---|
| startTime | string | 查询起始时间 |
| endTime | string | 查询终止时间 |
| serviceList | List<object> | 服务列表 |
serviceList说明
| 名称 | 类型 | 描述 |
|---|---|---|
| serviceId | string | 服务ID |
| serviceName | string | 服务名 |
| appList | List<object> | app列表 |
appList说明
| 名称 | 类型 | 描述 |
|---|---|---|
| appId | string | appID |
| metrics | List<object> | 监控指标,返回入参指定的指标结果 |
metrics说明
| 名称 | 类型 | 描述 |
|---|---|---|
| tpm | List<object> | TPM使用情况,仅时间粒度为分钟时展示 |
| rpm | List<object> | RPM使用情况,仅时间粒度为分钟时展示 |
| timeToFirstTokenP99 | int | 首Tokens时延P99分位(ms) |
| timeToFirstTokenP90 | int | 首Tokens时延P90分位(ms) |
| timeToFirstTokenP50 | int | 首Tokens时延P50分位(ms) |
| latencyP99 | int | 整句时延P99分位(ms) |
| latencyP90 | int | 整句时延P90分位(ms) |
| latencyP50 | int | 整句时延P50分位(ms) |
| outputTokensPerSecondP99 | float | OTPS P99分位(tokens/s) |
| outputTokensPerSecondP90 | float | OTPS P90分位(tokens/s) |
| outputTokensPerSecondP50 | float | OTPS P50分位(tokens/s) |
| inputTokensTotal | float | 输入token数(千tokens) |
| outputTokensTotal | float | 输出token数(千tokens) |
| tokensTotal | float | 总token数(千tokens) |
| succeedCallTotal | int | 调用成功次数 |
| failureCallTotal | int | 调用失败次数 |
| callTotal | int | 调用总次数 |
| searchCountTotal | int | 搜索触发次数,说明:模型触发此功能时,返回该字段 |
| searchTokensTotal | float | 搜索膨胀Tokens数(千tokens),说明:模型触发此功能时,返回该字段 |
| cachedCountTotal | int | Prompt cache触发次数,说明:模型触发此功能时,返回该字段 |
| cachedTokensTotal | float | Prompt cache Tokens数(千tokens),说明:模型触发此功能时,返回该字段 |
| chatfileplusCountTotal | int | ChatfilePlus触发次数,说明:模型触发此功能时,返回该字段 |
| chatfileplusTokensTotal | float | ChatfilePlus触发tokens数(千tokens),说明:模型触发此功能时,返回该字段 |
| successQpsAvg | float | 单位时间内成功请求的平均QPS |
| successQpsMax | int | 单位时间内成功请求的最大QPS |
| failureQpsAvg | float | 单位时间内失败请求的平均QPS |
| failureQpsMax | int | 单位时间内失败请求的最大QPS |
tpm说明
| 名称 | 类型 | 描述 |
|---|---|---|
| timestamp | int | 时间戳,只展示有变化的时间点及数据 |
| tpmRateLimit | int | TPM限额 |
rpm说明
| 名称 | 类型 | 描述 |
|---|---|---|
| timestamp | int | 时间戳,只展示有变化的时间点和数据 |
| rpmRateLimit | int | RPM限额 |
| rpm | int | RPM实际使用量 |
请求示例
curl --location 'https://qianfan.baidubce.com/v2/service?Action=DescribeServiceStats' \
--header 'Authorization: bce-auth-v1/047ab241bad24xxx28b1ac/2024-01-10T08:39:09Z/180000/host;x-bce-date/eae9855604cxxxxe03cfcbaff' \
--header 'x-bce-date: 2024-01-10T08:37:40Z' \
--header 'Content-Type: application/json' \
--data '{
"serviceId": ["svco-tv5t4zpkj3za"],
"appId": ["1483416575"],
"startTime": "2025-03-30T16:00:00Z",
"endTime": "2025-03-31T15:59:00Z",
"interval": 86400,
"protocolVersion":2
}'响应示例
{
"requestId": "1bef3f87-c5b2-4419-936b-50f9884f10d4",
"result": {
"startTime": "2025-03-30T16:00:00Z",
"endTime": "2025-03-31T15:59:00Z",
"serviceList": [
{
"serviceId": "svco-tv5t4zpkj3da",
"serviceName": "sunyueru0506",
"appList": [
{
"appId": "1483416575",
"metrics": [
{
"timeStamp": 1746002820,
"tpm": [],
"rpm": [],
"timeToFirstTokenP99": 0,
"timeToFirstTokenP90": 0,
"timeToFirstTokenP50": 0,
"latencyP99": 11416,
"latencyP90": 11416,
"latencyP50": 11416,
"outputTokensPerSecondP99": 0,
"outputTokensPerSecondP90": 0,
"outputTokensPerSecondP50": 0,
"inputTokensTotal": 555.555,
"outputTokensTotal": 22.222,
"tokensTotal": 577.777,
"succeedCallTotal": 880,
"failureCallTotal": 120,
"callTotal": 1000,
"searchCountTotal": 50,
"searchTokensTotal": 525.525,
"cachedCountTotal": 0,
"cachedTokensTotal": 0,
"chatfileplusCountTotal": 6,
"chatfileplusTokensTotal": 6.666,
"successQpsAvg": 0.5,
"successQpsMax": 15,
"failureQpsAvg": 0.1,
"failureQpsMax": 3
}
]
}
]
}
]
}
}错误码
若请求错误,服务器将返回的JSON文本包含以下参数:
| 名称 | 描述 |
|---|---|
| requestId | 请求ID |
| code | 错误码 |
| message | 错误描述信息,帮助理解和解决发生的错误 |
例如错误返回:
{
"requestId":"6ba7b810-xxxc04fd430c8",
"code":"AccessDenied",
"message":"Access denied."
}更多相关错误码,请查看错误码说明。


