feat(models): 模型目录与计费 - 按展示名分组并隔离管理员积分成本

This commit is contained in:
ddCat
2026-09-19 09:54:27 +08:00
parent 5ad05efb58
commit 237f2e2a6e
49 changed files with 802 additions and 276 deletions

View File

@@ -87,6 +87,8 @@ export type ApiCallLog = {
videoSeconds: number;
providerRequestId?: string;
estimatedCostMicros: number;
creditCostConfigured?: boolean;
creditCostMicrocredits?: number;
costAvailable: boolean;
currency?: string;
errorCode?: string;

View File

@@ -153,7 +153,7 @@ export type ModelQuoteRequest = {
intent: ModelRequestIntent;
};
export type ModelCatalogSource = "frontend" | "system";
export type ModelCatalogSource = "system";
export type PublicChannelCatalog = {
id: string;
@@ -199,7 +199,7 @@ export type ModelCatalogResponse = {
channels?: PublicChannelCatalog[];
};
// 统一模型目录接口 - 根据 frontendModelsEnabled 开关返回前台模型或系统渠道模型
// 创作目录直接读取系统渠道模型,不使用逻辑模型及其功能开关。
export function getModelCatalog() {
return http.get<ModelCatalogResponse>("/model-catalog");
}

View File

@@ -74,6 +74,8 @@ export type ChannelModel = {
};
export type ChannelModelPriceTier = {
/** 仅管理员模型编辑接口返回,不能复制到用户模型目录。 */
costPricing?: CreditCostPricing;
id: string;
channelModelId: string;
selector: Record<string, string>;
@@ -93,6 +95,14 @@ export type ChannelModelPriceTier = {
updatedAt: string;
};
export type CreditCostPricing = {
configured: boolean;
unitPriceMicrocredits: number;
inputTokenPriceMicrocredits: number;
outputTokenPriceMicrocredits: number;
cachedTokenPriceMicrocredits: number;
};
// 系统渠道模型的写入合同。标量价格只用于兼容旧管理请求;新的后台界面只提交 priceTiers。
export type ChannelModelMutation = {
modelKey: string;