同时有pro+paygo套餐,接口不返回用量数据。 https://www.88code.org/api/usage ```json { "code": 0, "data": { "apiKey": null, "claudeAccountId": null, "concurrencyLimit": null, "createdAt": "2025-12-26 17:58:52", "createdBy": null, "creditLimit": null, "currentConcurrency": null, "currentCredits": null, "dailyCost": null, "description": "Claude Code", "employeeId": 51120, "enableModelRestriction": null, "expiresAt": null, "geminiAccountId": null, "id": 57715, "isActive": true, "keyId": "d969d9a459e7444681a9cdbf2c93b946", "lastUsedAt": "2026-01-04 22:42:08", "maskedApiKey": null, "name": "cc", "openaiAccountId": null, "permissions": null, "prefix": "88_", "restrictedModels": null, "subscriptionEntityList": null, "subscriptionId": null, "subscriptionName": null, "totalCost": 296.295528, "totalRequests": 4509, "totalTokens": 216080709, "updatedAt": "2026-01-04 22:42:07", "usage": null }, "dataType": 1, "level": null, "msg": "操作成功", "ok": true } ```
Activity
johnnyee commentedon Jan 5, 2026
问题确认
我已验证这个问题,确实存在。
验证结果
调用
/api/usage接口(传入 model 参数):{ "creditLimit": null, "currentCredits": null, "subscriptionEntityList": null, ... }调用
/api/subscription接口可以正常返回订阅数据,包含currentCredits和subscriptionPlan.creditLimit。根本原因
88code 的 Usage API 已经不再返回用量字段(
creditLimit、currentCredits、subscriptionEntityList全是 null),只返回基础的 key 统计信息。解决方案
byebyecode 需要修改逻辑:从
/api/subscription接口获取用量数据,而不是依赖/api/usage的这些字段。我会提交一个 PR 来修复这个问题。
johnnyee commentedon Jan 5, 2026
补充说明
刚才说"从 subscription API 获取数据"的方案不太可行,因为:
/api/usage的subscriptionEntityList返回的是当前扣费相关的套餐,按扣费优先级排列,可以直接判断"正在扣哪个套餐"/api/subscription返回的是全部历史订阅(已过期、已禁用、未开始、活跃中混在一起),无法准确判断当前扣费顺序结论
这应该是 88code API 的 bug 或变更,需要 88code 官方修复
/api/usage接口,恢复返回subscriptionEntityList、creditLimit、currentCredits字段。建议向 88code 反馈这个问题。
fix: 当 /api/usage 返回无效数据时,fallback 到 /api/subscription
johnnyee commentedon Jan 5, 2026
问题已修复 ✅
已提交 PR #27 修复此问题。
解决方案
当
/api/usage返回无效数据时,自动 fallback 到/api/subscription获取用量数据:优势
感谢反馈!
docs: 更新 CLAUDE.md,添加 Issue #26 修复记录