Repository navigation
Feat/usage api alignment v2 - #128
Merged
Merged
Conversation
- 删除 listModelUsage、listToolUsage 及相关类型和接口
- 新增 getUsageSummary 及其请求和响应类型支持多维度统一查询
- 请求参数 scope 改为 dimension,时间范围改为带时区的 RFC 3339 字符串格式
- 移除分页和名称筛选,明细数据一次性返回 total、models 和 tools 三视图
- 指标结构统一为 { value, unit },支持空指标值为 null,响应无数据时 data_updated_at 返回 null
- 更新文档示例和导出接口,所有用量查询适配百炼官方 Usage API 新规范
- 增加请求参数验证,防止维度与参数不匹配情况发生
- 单元测试覆盖新的接口调用和错误验证,兼容性提升
…into feat/usage-api-alignment-v2
- summary 路由边界识别 ApiError.statusCode 与 UserError,百炼 404/400 不再塌缩成 500 - 请求 schema 按 dimension 分支(strict),空白 id、毫秒时间戳、跨维度字段统一 400 且零上游调用 - SDK 请求类型按维度定义分支,OpenAPI oneOf 与生成的 webui 客户端类型同步表达必填与禁止字段 - 时间校验先验真实日历日期,2026-02-30 不再被 Date.parse 静默滚月后放行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Type
Surface area
Checklist
bun run verify:fullpassesBehavior / risk
Validation