Merge pull request #2582 from wucm667/feat/channel-pricing-sync-models

feat(channels): 模型定价支持一键同步最新模型
This commit is contained in:
Wesley Liddick
2026-05-20 08:43:10 +08:00
committed by GitHub
10 changed files with 252 additions and 12 deletions
+15 -1
View File
@@ -164,5 +164,19 @@ export async function getModelDefaultPricing(model: string): Promise<ModelDefaul
return data
}
const channelsAPI = { list, getById, create, update, remove, getModelDefaultPricing }
export interface SyncPricingModelsResult {
models: string[]
}
/**
* Fetch the latest model names from the LiteLLM pricing catalog for the given platform
*/
export async function syncPricingModels(platform: string): Promise<SyncPricingModelsResult> {
const { data } = await apiClient.get<SyncPricingModelsResult>('/admin/channels/pricing/sync-models', {
params: { platform }
})
return data
}
const channelsAPI = { list, getById, create, update, remove, getModelDefaultPricing, syncPricingModels }
export default channelsAPI