/** * Peak/off-peak rule data for supported providers. * * Rules are DATA, not code: which days are peak days comes from * `peakWeekdays`, read on the billing calendar (calendarOffsetMinutes), not * on UTC. Vendors change these rules; each schedule carries its source URL * and the date it was last verified against (see README). */ export interface PeakWindow { /** Billing-calendar wall-clock start, "HH:mm" (inclusive). */ start: string; /** Billing-calendar wall-clock end, "HH:mm" (exclusive). */ end: string; } export interface PeakSchedule { id: string; label: string; shortLabel: string; /** Billing calendar as a fixed UTC offset in minutes (UTC+8 → 480). */ calendarOffsetMinutes: number; /** Peak windows in billing-calendar wall time. */ windows: PeakWindow[]; /** ISO weekdays (1=Mon..7=Sun) on the billing calendar on which peak windows run. */ peakWeekdays: number[]; /** * Instant (ISO) from which non-peak weekdays are entirely off-peak. * Before this instant the weekday axis does not apply (pre-rule billing * was window-only). null = the weekday axis always applies. */ weekendOffPeakFrom: string | null; offPeakMultiplier: number; /** Human note shown by /peak. */ offPeakNote: string; /** Where the rule is published. */ source: string; } /** DeepSeek API pricing. Verified 2026-08-28. */ export const DEEPSEEK: PeakSchedule = { id: "deepseek", label: "DeepSeek", shortLabel: "DS", calendarOffsetMinutes: 480, windows: [ { start: "09:00", end: "12:00" }, { start: "14:00", end: "18:00" }, ], peakWeekdays: [1, 2, 3, 4, 5], weekendOffPeakFrom: "2026-08-22T16:00:00Z", offPeakMultiplier: 0.5, offPeakNote: "off-peak = 50% of peak rates; weekends fully off-peak since Aug 23, 2026", source: "https://api-docs.deepseek.com/quick_start/pricing/", }; /** Z.AI GLM Coding Plan. Verified 2026-08-28. */ export const GLM: PeakSchedule = { id: "glm", label: "GLM Coding Plan", shortLabel: "GLM", calendarOffsetMinutes: 480, windows: [{ start: "14:00", end: "18:00" }], peakWeekdays: [1, 2, 3, 4, 5], weekendOffPeakFrom: null, offPeakMultiplier: 0.5, offPeakNote: "legacy V2 plans: GLM-5.3 burns 1x off-peak / 3x peak, GLM-5.3-Flash 0.4x / 1.2x; new credit plans: off-peak = 50% of the standard credit rate (peak: Mon-Fri 14:00-18:00 UTC+8)", source: "https://docs.z.ai/devpack/overview", }; export const SCHEDULES: PeakSchedule[] = [DEEPSEEK, GLM];