计费与资源管理
计费接口按当前租户操作。钱包返回可用、预留、消耗和透支积分;积分数量使用字符串。列表分别提供积分流水、用量记录和资源预留。用量查询支持应用、环境和时间范围筛选。
estimate 根据人数、时长、分辨率、录制、AI、转码、存储和 CDN 参数返回预计积分及计价明细。购买套餐和资源包必须传入业务生成的 idempotencyKey;同一次购买重试使用同一键。套餐购买接口开通或更换套餐并发放赠送积分,当前服务端不校验支付。资源包接口将资源包发放到钱包。自动充值规则包括资源包、阈值、月度上限和启用状态。
billing.wallet
钱包余额。
GET /v1/billing/wallet
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.wallet() |
| Python | c.billing.wallet() |
| Java | c.billing.wallet() |
| Go | c.Billing.Wallet(ctx, &result) |
| PHP | $c->billing->wallet() |
无请求字段。
返回:WalletSummary。嵌套字段见共享类型。
billing.entitlements
租户权益。
GET /v1/billing/entitlements
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.entitlements() |
| Python | c.billing.entitlements() |
| Java | c.billing.entitlements() |
| Go | c.Billing.Entitlements(ctx, &result) |
| PHP | $c->billing->entitlements() |
无请求字段。
返回:EntitlementSnapshot。嵌套字段见共享类型。
billing.listPlans
套餐目录。
GET /v1/billing/plans
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.listPlans() |
| Python | c.billing.list_plans() |
| Java | c.billing.listPlans() |
| Go | c.Billing.ListPlans(ctx, &result) |
| PHP | $c->billing->listPlans() |
无请求字段。
返回:CatalogList<PlanCatalogItem>。嵌套字段见共享类型。
billing.listPackages
资源包目录。
GET /v1/billing/packages
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.listPackages() |
| Python | c.billing.list_packages() |
| Java | c.billing.listPackages() |
| Go | c.Billing.ListPackages(ctx, &result) |
| PHP | $c->billing->listPackages() |
无请求字段。
返回:CatalogList<ResourcePackageItem>。嵌套字段见共享类型。
billing.estimate
费用估算。
POST /v1/billing/estimate
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.estimate(input) |
| Python | c.billing.estimate(**input) |
| Java | c.billing.estimate(input) |
| Go | c.Billing.Estimate(ctx, input, &result) |
| PHP | $c->billing->estimate($input) |
输入:ClassroomEstimatePayload。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
onStageCount | 是 | number | 预计台上人数 |
audienceCount | 否 | number | undefined | 预计台下人数 |
durationMinutes | 是 | number | 持续时间,分钟;课堂创建范围 5–480 |
resolutionTier | 否 | string | undefined | 计价分辨率档位 |
recordMode | 否 | string | undefined | 录制模式 |
aiSubtitle | 否 | boolean | undefined | 计入 AI 字幕 |
aiSummary | 否 | boolean | undefined | 计入 AI 总结 |
transcodeMinutes | 否 | number | undefined | 转码分钟数 |
storageGbMonth | 否 | number | undefined | 存储 GB·月 |
cdnGb | 否 | number | undefined | CDN 下行 GB |
返回:ClassroomEstimateResult。嵌套字段见共享类型。
billing.listLedger
积分流水。
GET /v1/billing/ledger
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.listLedger(input) |
| Python | c.billing.list_ledger(**input) |
| Java | c.billing.listLedger(input) |
| Go | c.Billing.ListLedger(ctx, input, &result) |
| PHP | $c->billing->listLedger($input) |
输入:LedgerInput。 字段放在 URL 查询参数中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
type | 否 | string | undefined | 积分流水类型 |
status | 否 | string | undefined | 状态筛选或目标状态 |
page | 否 | number | undefined | 页码,从 1 开始 |
pageSize | 否 | number | undefined | 单页数量 |
返回:Paged<LedgerEntry>。嵌套字段见共享类型。
billing.listUsage
用量明细。
GET /v1/billing/usage
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.listUsage(input) |
| Python | c.billing.list_usage(**input) |
| Java | c.billing.listUsage(input) |
| Go | c.Billing.ListUsage(ctx, input, &result) |
| PHP | $c->billing->listUsage($input) |
输入:UsageInput。 字段放在 URL 查询参数中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
scope | 否 | "dashboard" | undefined | 用量统计范围;dashboard 使用仪表盘口径 |
appId | 否 | string | undefined | 目标应用 ID |
environment | 否 | AppEnvironment | undefined | 应用环境 |
from | 否 | string | undefined | 时间范围开始,ISO 8601 |
to | 否 | string | undefined | 时间范围结束,ISO 8601 |
type | 否 | string | undefined | 积分流水类型 |
status | 否 | string | undefined | 状态筛选或目标状态 |
page | 否 | number | undefined | 页码,从 1 开始 |
pageSize | 否 | number | undefined | 单页数量 |
返回:Paged<UsageRecord>。嵌套字段见共享类型。
billing.listReservations
资源预留。
GET /v1/billing/reservations
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.listReservations(input) |
| Python | c.billing.list_reservations(**input) |
| Java | c.billing.listReservations(input) |
| Go | c.Billing.ListReservations(ctx, input, &result) |
| PHP | $c->billing->listReservations($input) |
输入:ReservationsInput。 字段放在 URL 查询参数中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
status | 否 | string | undefined | 状态筛选或目标状态 |
page | 否 | number | undefined | 页码,从 1 开始 |
pageSize | 否 | number | undefined | 单页数量 |
返回:Paged<ReservationRecord>。嵌套字段见共享类型。
billing.purchasePlan
购买套餐。
POST /v1/billing/plans/purchase
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.purchasePlan(input) |
| Python | c.billing.purchase_plan(**input) |
| Java | c.billing.purchasePlan(input) |
| Go | c.Billing.PurchasePlan(ctx, input, &result) |
| PHP | $c->billing->purchasePlan($input) |
输入:PurchasePlanPayload。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
planKey | 是 | string | 套餐标识 |
period | 否 | string | undefined | 购买周期,未传时 monthly |
idempotencyKey | 是 | string | 业务生成的幂等键,同一购买重试复用 |
返回:PurchasePlanResult。嵌套字段见共享类型。
billing.purchasePackage
购买资源包。
POST /v1/billing/packages/purchase
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.purchasePackage(input) |
| Python | c.billing.purchase_package(**input) |
| Java | c.billing.purchasePackage(input) |
| Go | c.Billing.PurchasePackage(ctx, input, &result) |
| PHP | $c->billing->purchasePackage($input) |
输入:PurchasePackagePayload。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
packageKey | 是 | string | 资源包标识 |
idempotencyKey | 是 | string | 业务生成的幂等键,同一购买重试复用 |
返回:WalletSummary。嵌套字段见共享类型。
billing.getAutoRecharge
自动充值设置。
GET /v1/billing/auto-recharge
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.getAutoRecharge() |
| Python | c.billing.get_auto_recharge() |
| Java | c.billing.getAutoRecharge() |
| Go | c.Billing.GetAutoRecharge(ctx, &result) |
| PHP | $c->billing->getAutoRecharge() |
无请求字段。
返回:AutoRechargeRule。嵌套字段见共享类型。
billing.setAutoRecharge
保存自动充值设置。
POST /v1/billing/auto-recharge
鉴权:租户 Bearer Token。
| 语言 | 调用 |
|---|---|
| Node.js | c.billing.setAutoRecharge(input) |
| Python | c.billing.set_auto_recharge(**input) |
| Java | c.billing.setAutoRecharge(input) |
| Go | c.Billing.SetAutoRecharge(ctx, input, &result) |
| PHP | $c->billing->setAutoRecharge($input) |
输入:UpsertAutoRechargePayload。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
packageKey | 是 | string | 资源包标识 |
thresholdPoints | 是 | string | 自动充值积分阈值,字符串 |
monthlyLimit | 是 | number | 自动充值月度次数上限 |
enabled | 是 | boolean | 是否启用自动充值 |
返回:AutoRechargeRule。嵌套字段见共享类型。