feat(billing): 火山方舟视频计费 - 支持真实 Token 预授权与结算

Refs #228

Co-authored-by: MasterChiefCN <49179444+MasterChiefCN@users.noreply.github.com>
This commit is contained in:
ddCatandMasterChiefCN committed 2026-08-15 12:58:05 +08:00
1 parent 91ac4bd501
commit f319e19f41
11 files changed
+362 -36

No files matched your search

+4
View File
@@ -88,6 +88,10 @@ export function modelProtocolCapability(value?: string) {
return modelProtocolDefinition(value)?.capability;
}
export function modelProtocolSupportsTokenBilling(capability?: string, protocol?: string) {
return capability === "text" || (capability === "video" && protocol === "volcengine-ark-video");
}
export function protocolForModelCatalog(endpointTypes: string[] = []): ModelProtocol | undefined {
const normalized = new Set(endpointTypes.map((value) => value.trim().toLowerCase()));
if (normalized.has("openai-chat") || normalized.has("chat-completion") || normalized.has("chat")) return "chat-completion";