feat(usage): add automatic models.dev pricing sync (#5734)

* feat(usage): persist model pricing in local config

* feat(usage): sync selected models.dev pricing on startup

* fix(usage): address models.dev sync review feedback

* fix(usage): harden local pricing synchronization
This commit is contained in:
Thefool
2026-07-28 23:37:55 +08:00
committed by GitHub
parent ff3bc242cc
commit 12b972a66e
20 changed files with 2672 additions and 195 deletions
+14
View File
@@ -67,6 +67,20 @@ export interface ModelPricing {
cacheCreationCostPerMillion: string;
}
export interface ModelsDevSyncConfig {
autoSyncEnabled: boolean;
includeCommonModels: boolean;
selectedModelKeys: string[];
excludedCommonModelKeys: string[];
lastSyncAt: number | null;
lastSyncError: string | null;
}
export interface ModelsDevSyncState {
config: ModelsDevSyncConfig;
configPath: string;
}
export interface UsageSummary {
totalRequests: number;
totalCost: string;