计量中心
说明:
- 以下接口对应控制台「计量中心」:订阅与额度、积分消耗、操作记录。
- 品牌消耗详情页复用积分消耗与记录接口,传入
brand_id即可按品牌查询。
用量类型 quota_type 说明:
| quota_type | 含义 |
|---|---|
| article_generate | AI文章生成 |
| article_publish | 辅助发文 |
| content_tracking | 内容追踪 |
| task_run | AI回答采集 |
| task_scoring | AI回答分析 |
| prompt_recommend | 用户提问智能推荐 |
| video_generate | AI视频生成 |
| max_brand | 品牌数量 |
| max_member | 团队成员数量 |
| max_prompt | 用户提问数量 |
| max_competitor | 竞品数量 |
实际返回的用量类型以当前套餐及已开通能力为准。
获取当前周期用量
- 请求方法:POST
- 请求路径:
/geo/billing/report/usage
说明:
- 该接口用于获取计量中心顶部的额度卡片:品牌、成员、提问、竞品等容量,以及当前周期用量。
- 不传
brand_id或传入0时查询团队范围;传入品牌ID时查询该品牌相关用量。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| brand_id | string | 品牌ID;不传或传 0 表示团队范围 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| plan | object | 当前周期用量 |
| plan.valid_from | int64 | 当前周期开始时间,Unix秒时间戳 |
| plan.valid_until | int64 | 当前周期结束时间,Unix秒时间戳 |
| plan.quotas | object 数组 | 各类用量汇总 |
| plan.quotas.quota_type | string | 用量类型 |
| plan.quotas.total_amount | int | 当前额度 |
| plan.quotas.used_amount | int | 当前已使用量 |
| plan.quotas.reset_time | int64 | 下次重置时间,Unix秒时间戳 |
| credit | object | 积分概况 |
| credit.team_id | string | 团队ID |
| credit.total_amount | int | 当前可用积分 |
| credit.used_amount | int | 已确认消耗的积分 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"plan": {
"valid_from": "1780243200",
"valid_until": "1782835199",
"quotas": [
{
"quota_type": "article_generate",
"total_amount": 800,
"used_amount": 126,
"reset_time": "1782835199"
},
{
"quota_type": "content_tracking",
"total_amount": 500,
"used_amount": 42,
"reset_time": "1782835199"
}
]
},
"credit": {
"team_id": "team_test_001",
"total_amount": 13300,
"used_amount": 1700
}
}
}获取订阅信息
- 请求方法:POST
- 请求路径:
/geo/billing/subscription/get
说明:
- 该接口用于获取计量中心顶部的套餐名称、订阅状态、计费周期和到期时间。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| plan_id | string | 套餐ID |
| plan_name | string | 套餐名称 |
| tier | string | 套餐等级 |
| status | int | 订阅状态:1-生效中,2-资源超限暂停,3-已过期,4-已取消 |
| started_at | int64 | 订阅开始时间,Unix秒时间戳 |
| expired_at | int64 | 订阅到期时间,Unix秒时间戳 |
| billing_period | int | 计费周期:1-月付,2-年付 |
| billing_amount | int | 计费时长,配合 billing_period 使用 |
| current_cycle_start | int64 | 当前计费周期开始时间,Unix秒时间戳 |
| current_cycle_end | int64 | 当前计费周期结束时间,Unix秒时间戳 |
| is_trial | bool | 是否试用:true-是,false-否 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"plan_id": "plan_test_001",
"plan_name": "专业版",
"tier": "pro",
"status": 1,
"started_at": "1780243200",
"expired_at": "1811779199",
"billing_period": 1,
"billing_amount": 1,
"current_cycle_start": "1780243200",
"current_cycle_end": "1782835199",
"is_trial": false
}
}获取积分状态
- 请求方法:POST
- 请求路径:
/geo/billing/credit/status
说明:
- 该接口用于获取计量中心积分卡的当前可用积分、已确认消耗及积分明细。
credit_details.status=5的积分会出现在明细中,但不计入顶层total_amount。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| team_id | string | 团队ID |
| total_amount | int | 当前可用积分总量 |
| used_amount | int | 已确认消耗的积分 |
| credit_details | object 数组 | 积分明细 |
| credit_details.credit_id | string | 积分记录ID |
| credit_details.source_type | int | 积分来源:1-套餐发放,2-充值,3-人工调整 |
| credit_details.total_amount | int | 该笔积分当前可用数量 |
| credit_details.used_amount | int | 该笔积分已确认消耗 |
| credit_details.expire_time | int64 | 过期时间,Unix秒时间戳 |
| credit_details.status | int | 积分状态:1-可用,2-已用完,3-已过期,4-已关闭,5-冻结中 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"team_id": "team_test_001",
"total_amount": 13290,
"used_amount": 1710,
"credit_details": [
{
"credit_id": "credit_test_001",
"source_type": 1,
"total_amount": 10000,
"used_amount": 1200,
"expire_time": "1811779200",
"status": 1
}
]
}
}获取积分消耗占比
- 请求方法:POST
- 请求路径:
/geo/billing/credit/usage
说明:
- 该接口用于获取计量中心「积分消耗」中的类型占比。
- 不传
start_unix、end_unix时,默认查询当前计费周期。 - 不传
brand_id或传入0时查询团队范围;传入品牌ID时查询该品牌相关消耗。 - 不传
quota_types或传空数组时,查询全部用量类型。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| brand_id | string | 品牌ID;不传或传 0 表示团队范围 | 否 |
| start_unix | int64 | 开始时间,Unix秒时间戳 | 否 |
| end_unix | int64 | 结束时间,Unix秒时间戳 | 否 |
| quota_types | string 数组 | 用量类型列表 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| period_start | int64 | 统计开始时间,Unix秒时间戳 |
| period_end | int64 | 统计结束时间,Unix秒时间戳 |
| total_credit_used | int | 积分消耗总量 |
| total_quota_amount | int | 资源消耗总量 |
| usages | object 数组 | 按用量类型汇总的消耗列表 |
| usages.quota_type | string | 用量类型 |
| usages.quota_amount | int | 该类型资源消耗量 |
| usages.credit_used | int | 该类型积分消耗量 |
| usages.percent | float | 占积分消耗总量的百分比 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"period_start": "1780243200",
"period_end": "1782835199",
"total_credit_used": 1100,
"total_quota_amount": 83,
"usages": [
{
"quota_type": "article_generate",
"quota_amount": 80,
"credit_used": 800,
"percent": 72.73
},
{
"quota_type": "video_generate",
"quota_amount": 3,
"credit_used": 300,
"percent": 27.27
}
]
}
}获取积分消耗趋势
- 请求方法:POST
- 请求路径:
/geo/billing/credit/trend
说明:
- 该接口用于获取计量中心「积分消耗」中的按日趋势。
- 不传
start_unix、end_unix时,默认查询当前计费周期。 - 不传
brand_id或传入0时查询团队范围;传入品牌ID时查询该品牌相关消耗。 - 不传
quota_types或传空数组时,查询全部用量类型。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| brand_id | string | 品牌ID;不传或传 0 表示团队范围 | 否 |
| start_unix | int64 | 开始时间,Unix秒时间戳 | 否 |
| end_unix | int64 | 结束时间,Unix秒时间戳 | 否 |
| quota_types | string 数组 | 用量类型列表 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| period_start | int64 | 统计开始时间,Unix秒时间戳 |
| period_end | int64 | 统计结束时间,Unix秒时间戳 |
| trends | object 数组 | 每日消耗趋势 |
| trends.date | string | 日期,格式:YYYY-MM-DD |
| trends.quota_type | string | 用量类型 |
| trends.quota_amount | int | 当日资源消耗量 |
| trends.credit_used | int | 当日积分消耗量 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"period_start": "1780243200",
"period_end": "1782835199",
"trends": [
{
"date": "2026-08-30",
"quota_type": "article_generate",
"quota_amount": 5,
"credit_used": 50
}
]
}
}获取品牌积分消耗排行
- 请求方法:POST
- 请求路径:
/geo/billing/credit/rank
说明:
- 该接口用于获取计量中心积分卡「品牌消耗」下拉中的品牌排行。按消耗量从高到低返回,仅统计有品牌归属的消耗记录。
- 不传
start_unix、end_unix时,默认查询当前计费周期。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| start_unix | int64 | 开始时间,Unix秒时间戳 | 否 |
| end_unix | int64 | 结束时间,Unix秒时间戳 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| brand_id | string | 品牌ID |
| brand_name | string | 品牌名称 |
| credit_used | int | 积分消耗量 |
响应示例:
{
"code": 0,
"msg": "success",
"data": [
{
"brand_id": "brand_test_001",
"brand_name": "测试品牌A",
"credit_used": 1200
},
{
"brand_id": "brand_test_002",
"brand_name": "测试品牌B",
"credit_used": 860
}
]
}获取积分流水
- 请求方法:POST
- 请求路径:
/geo/billing/credit/bills
说明:
- 该接口用于获取计量中心「操作记录」中的积分流水。
- 不传
start_time、end_time时,默认查询当前计费周期。 - 不传
brand_id或传入0时查询团队范围;传入品牌ID时查询该品牌相关流水。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| brand_id | string | 品牌ID;不传或传 0 表示团队范围 | 否 |
| page | int | 页码;不传默认 1 | 否 |
| page_size | int | 每页数量 | 否 |
| start_time | int64 | 开始时间,Unix秒时间戳 | 否 |
| end_time | int64 | 结束时间,Unix秒时间戳 | 否 |
| keyword | string | 按操作人或事件名称搜索 | 否 |
| status | int | 流水状态:0-不筛选,1-冻结中,2-已确认 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| bills | object 数组 | 积分流水列表 |
| bills.bill_id | string | 流水ID |
| bills.team_id | string | 团队ID |
| bills.bill_type | string | 事件类型展示文案 |
| bills.credit_change | int | 积分变动值 |
| bills.is_pending | bool | 是否冻结中:true-冻结中,false-已确认 |
| bills.created_time | int64 | 创建时间,Unix秒时间戳 |
| bills.operator_name | string | 操作人名称 |
| bills.brand_name | string | 品牌名称 |
| total | int | 流水总数 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"bills": [
{
"bill_id": "bill_test_001",
"team_id": "team_test_001",
"bill_type": "文章生成",
"credit_change": -10,
"is_pending": false,
"created_time": "1780012800",
"operator_name": "test_user",
"brand_name": "测试品牌A"
}
],
"total": 1
}
}获取订阅日志
- 请求方法:POST
- 请求路径:
/geo/billing/logs/list
说明:
- 该接口用于获取计量中心「操作记录」中的订阅日志。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| page | int | 页码;不传默认 1 | 否 |
| page_size | int | 每页数量 | 否 |
| keyword | string | 按操作人或事件名称搜索 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| list | object 数组 | 订阅日志列表 |
| list.log_id | string | 日志ID |
| list.action | string | 事件标识 |
| list.action_text | string | 事件名称 |
| list.message | string | 事件说明 |
| list.operator_name | string | 操作人名称 |
| list.created_at | int64 | 创建时间,Unix秒时间戳 |
| total | int | 日志总数 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"list": [
{
"log_id": "log_test_001",
"action": "purchase",
"action_text": "分配套餐",
"message": "分配了专业版,有效期 30 天",
"operator_name": "test_user",
"created_at": "1780012800"
}
],
"total": 1
}
}获取配额记录
- 请求方法:POST
- 请求路径:
/geo/billing/quota/override/list
说明:
- 该接口用于获取计量中心「操作记录」中的配额记录。
请求参数:
| 入参 | 类型 | 含义 | 是否必填 |
|---|---|---|---|
| team_id | string | 团队ID | 是 |
| page | int | 页码;不传默认 1 | 否 |
| page_size | int | 每页数量 | 否 |
响应参数:
| 返回值 | 类型 | 含义 |
|---|---|---|
| list | object 数组 | 配额记录列表 |
| list.quota_type | string | 用量类型 |
| list.quota_limit | int | 调整后的额度 |
| list.reason | string | 调整原因 |
| list.created_at | int64 | 创建时间,Unix秒时间戳 |
| list.is_effective | bool | 当前是否生效:true-已生效,false-未生效 |
| total | int | 记录总数 |
响应示例:
{
"code": 0,
"msg": "success",
"data": {
"list": [
{
"quota_type": "max_brand",
"quota_limit": 5,
"reason": "扩容品牌数量",
"created_at": "1780012800",
"is_effective": true
}
],
"total": 1
}
}