feat: add selectable routing groups and composite billing

Support per-model provider enablement and compact model editing. Capture request-time billing factors, charge customer costs separately, and preserve historical statistics without backfills.
This commit is contained in:
elky
2026-10-07 14:49:57 +08:00
parent 310098a853
commit 911c7f8875
110 changed files with 6524 additions and 559 deletions
+6
View File
@@ -39,6 +39,12 @@ export interface UsageRecord {
total_tokens: number
cost: number
actual_cost?: number
/** Combined customer billing multiplier captured for this request. */
billing_multiplier?: number | null
routing_group_id?: string | null
routing_group_name?: string | null
/** Captured customer charge. Null means unavailable and must not be recalculated. */
billing_cost?: number | null
response_time_ms?: number | null
first_byte_time_ms?: number | null // 首字时间 (TTFB)
end_to_end_time_ms?: number | null // 客户端从请求进入网关到完成的总耗时