@lobehub/chat 1.111.1 → 1.111.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/.cursor/rules/code-review.mdc +2 -19
  2. package/.cursor/rules/cursor-ux.mdc +0 -72
  3. package/.cursor/rules/project-introduce.mdc +5 -5
  4. package/.cursor/rules/react-component.mdc +92 -73
  5. package/.cursor/rules/rules-attach.mdc +28 -61
  6. package/.cursor/rules/system-role.mdc +8 -20
  7. package/.cursor/rules/typescript.mdc +55 -14
  8. package/CHANGELOG.md +52 -0
  9. package/changelog/v1.json +14 -0
  10. package/locales/ar/models.json +21 -3
  11. package/locales/bg-BG/models.json +21 -3
  12. package/locales/de-DE/models.json +21 -3
  13. package/locales/en-US/models.json +21 -3
  14. package/locales/es-ES/models.json +21 -3
  15. package/locales/fa-IR/models.json +21 -3
  16. package/locales/fr-FR/models.json +21 -3
  17. package/locales/it-IT/models.json +21 -3
  18. package/locales/ja-JP/models.json +21 -3
  19. package/locales/ko-KR/models.json +21 -3
  20. package/locales/nl-NL/models.json +21 -3
  21. package/locales/pl-PL/models.json +21 -3
  22. package/locales/pt-BR/models.json +21 -3
  23. package/locales/ru-RU/models.json +21 -3
  24. package/locales/tr-TR/models.json +21 -3
  25. package/locales/vi-VN/models.json +21 -3
  26. package/locales/zh-CN/models.json +21 -3
  27. package/locales/zh-TW/models.json +21 -3
  28. package/package.json +1 -1
  29. package/packages/types/src/aiModel.ts +67 -46
  30. package/packages/types/src/hotkey.ts +2 -0
  31. package/packages/types/src/llm.ts +3 -3
  32. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/PinList/index.tsx +3 -3
  33. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.test.tsx +1 -0
  34. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +11 -2
  35. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/index.tsx +2 -2
  36. package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -2
  37. package/src/app/[variants]/(main)/chat/_layout/Desktop/SessionPanel.tsx +2 -2
  38. package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Overview/ProviderList/index.tsx +23 -12
  39. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Overview/ModelList/index.tsx +23 -10
  40. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +21 -12
  41. package/src/components/Thinking/index.tsx +53 -13
  42. package/src/config/aiModels/ai21.ts +8 -4
  43. package/src/config/aiModels/ai360.ts +28 -14
  44. package/src/config/aiModels/aihubmix.ts +174 -86
  45. package/src/config/aiModels/anthropic.ts +97 -38
  46. package/src/config/aiModels/azure.ts +54 -32
  47. package/src/config/aiModels/azureai.ts +63 -37
  48. package/src/config/aiModels/baichuan.ts +24 -12
  49. package/src/config/aiModels/bedrock.ts +60 -30
  50. package/src/config/aiModels/cohere.ts +60 -30
  51. package/src/config/aiModels/deepseek.ts +10 -6
  52. package/src/config/aiModels/fireworksai.ts +88 -44
  53. package/src/config/aiModels/giteeai.ts +1 -1
  54. package/src/config/aiModels/github.ts +44 -26
  55. package/src/config/aiModels/google.ts +119 -68
  56. package/src/config/aiModels/groq.ts +48 -24
  57. package/src/config/aiModels/higress.ts +617 -310
  58. package/src/config/aiModels/hunyuan.ts +105 -54
  59. package/src/config/aiModels/infiniai.ts +104 -52
  60. package/src/config/aiModels/internlm.ts +16 -8
  61. package/src/config/aiModels/jina.ts +4 -2
  62. package/src/config/aiModels/minimax.ts +11 -10
  63. package/src/config/aiModels/mistral.ts +40 -20
  64. package/src/config/aiModels/moonshot.ts +42 -22
  65. package/src/config/aiModels/novita.ts +196 -98
  66. package/src/config/aiModels/openai.ts +270 -137
  67. package/src/config/aiModels/openrouter.ts +205 -100
  68. package/src/config/aiModels/perplexity.ts +36 -6
  69. package/src/config/aiModels/ppio.ts +76 -38
  70. package/src/config/aiModels/qwen.ts +257 -133
  71. package/src/config/aiModels/sambanova.ts +56 -28
  72. package/src/config/aiModels/sensenova.ts +100 -50
  73. package/src/config/aiModels/siliconcloud.ts +224 -112
  74. package/src/config/aiModels/stepfun.ts +44 -22
  75. package/src/config/aiModels/taichu.ts +8 -4
  76. package/src/config/aiModels/tencentcloud.ts +12 -6
  77. package/src/config/aiModels/upstage.ts +8 -4
  78. package/src/config/aiModels/v0.ts +15 -12
  79. package/src/config/aiModels/vertexai.ts +49 -27
  80. package/src/config/aiModels/volcengine.ts +110 -51
  81. package/src/config/aiModels/wenxin.ts +179 -73
  82. package/src/config/aiModels/xai.ts +33 -19
  83. package/src/config/aiModels/zeroone.ts +48 -24
  84. package/src/config/aiModels/zhipu.ts +118 -69
  85. package/src/config/modelProviders/ai21.ts +0 -8
  86. package/src/config/modelProviders/ai360.ts +0 -20
  87. package/src/config/modelProviders/anthropic.ts +0 -56
  88. package/src/config/modelProviders/baichuan.ts +0 -30
  89. package/src/config/modelProviders/bedrock.ts +0 -74
  90. package/src/config/modelProviders/deepseek.ts +0 -13
  91. package/src/config/modelProviders/fireworksai.ts +0 -88
  92. package/src/config/modelProviders/google.ts +0 -59
  93. package/src/config/modelProviders/groq.ts +0 -48
  94. package/src/config/modelProviders/higress.ts +0 -727
  95. package/src/config/modelProviders/hunyuan.ts +0 -45
  96. package/src/config/modelProviders/infiniai.ts +0 -60
  97. package/src/config/modelProviders/internlm.ts +0 -8
  98. package/src/config/modelProviders/mistral.ts +0 -48
  99. package/src/config/modelProviders/modelscope.ts +2 -1
  100. package/src/config/modelProviders/openai.ts +5 -100
  101. package/src/config/modelProviders/openrouter.ts +0 -77
  102. package/src/config/modelProviders/ppio.ts +0 -95
  103. package/src/config/modelProviders/qwen.ts +0 -165
  104. package/src/config/modelProviders/sensenova.ts +0 -45
  105. package/src/config/modelProviders/siliconcloud.ts +0 -266
  106. package/src/config/modelProviders/stepfun.ts +0 -60
  107. package/src/config/modelProviders/taichu.ts +0 -10
  108. package/src/config/modelProviders/wenxin.ts +0 -90
  109. package/src/config/modelProviders/xai.ts +0 -16
  110. package/src/config/modelProviders/zeroone.ts +0 -60
  111. package/src/config/modelProviders/zhipu.ts +0 -80
  112. package/src/const/hotkeys.ts +6 -0
  113. package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +4 -3
  114. package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +25 -15
  115. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +7 -5
  116. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +6 -5
  117. package/src/hooks/useHotkeys/chatScope.ts +2 -2
  118. package/src/hooks/useHotkeys/globalScope.ts +16 -4
  119. package/src/hooks/usePinnedAgentState.ts +21 -0
  120. package/src/hooks/useSwitchSession.ts +1 -1
  121. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.test.ts +54 -8
  122. package/src/locales/default/hotkey.ts +4 -0
  123. package/src/server/routers/lambda/agent.ts +2 -2
  124. package/src/server/routers/lambda/config/__snapshots__/index.test.ts.snap +0 -28
  125. package/src/server/services/discover/index.ts +7 -6
  126. package/src/server/services/user/index.ts +1 -2
  127. package/src/utils/__snapshots__/parseModels.test.ts.snap +28 -4
  128. package/src/utils/_deprecated/__snapshots__/parseModels.test.ts.snap +0 -8
  129. package/src/utils/parseModels.test.ts +60 -9
  130. package/src/utils/pricing.test.ts +183 -0
  131. package/src/utils/pricing.ts +90 -0
@@ -13,8 +13,10 @@ const ai360ChatModels: AIChatModelCard[] = [
13
13
  id: '360zhinao2-o1',
14
14
  pricing: {
15
15
  currency: 'CNY',
16
- input: 4,
17
- output: 10,
16
+ units: [
17
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
18
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
19
+ ],
18
20
  },
19
21
  type: 'chat',
20
22
  },
@@ -29,8 +31,10 @@ const ai360ChatModels: AIChatModelCard[] = [
29
31
  id: '360gpt2-o1',
30
32
  pricing: {
31
33
  currency: 'CNY',
32
- input: 4,
33
- output: 10,
34
+ units: [
35
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
36
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
37
+ ],
34
38
  },
35
39
  type: 'chat',
36
40
  },
@@ -46,8 +50,10 @@ const ai360ChatModels: AIChatModelCard[] = [
46
50
  id: '360gpt2-pro',
47
51
  pricing: {
48
52
  currency: 'CNY',
49
- input: 2,
50
- output: 5,
53
+ units: [
54
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
55
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
56
+ ],
51
57
  },
52
58
  settings: {
53
59
  searchImpl: 'params',
@@ -65,8 +71,10 @@ const ai360ChatModels: AIChatModelCard[] = [
65
71
  id: '360gpt-pro',
66
72
  pricing: {
67
73
  currency: 'CNY',
68
- input: 2,
69
- output: 5,
74
+ units: [
75
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
76
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
77
+ ],
70
78
  },
71
79
  settings: {
72
80
  searchImpl: 'params',
@@ -80,8 +88,10 @@ const ai360ChatModels: AIChatModelCard[] = [
80
88
  id: '360gpt-pro-trans',
81
89
  pricing: {
82
90
  currency: 'CNY',
83
- input: 2,
84
- output: 5,
91
+ units: [
92
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
93
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
94
+ ],
85
95
  },
86
96
  type: 'chat',
87
97
  },
@@ -93,8 +103,10 @@ const ai360ChatModels: AIChatModelCard[] = [
93
103
  id: '360gpt-turbo',
94
104
  pricing: {
95
105
  currency: 'CNY',
96
- input: 1,
97
- output: 2,
106
+ units: [
107
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
108
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
109
+ ],
98
110
  },
99
111
  type: 'chat',
100
112
  },
@@ -109,8 +121,10 @@ const ai360ChatModels: AIChatModelCard[] = [
109
121
  id: '360/deepseek-r1',
110
122
  pricing: {
111
123
  currency: 'CNY',
112
- input: 4,
113
- output: 16,
124
+ units: [
125
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
126
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
127
+ ],
114
128
  },
115
129
  type: 'chat',
116
130
  },
@@ -17,9 +17,11 @@ const aihubmixModels: AIChatModelCard[] = [
17
17
  id: 'gpt-5',
18
18
  maxOutput: 128_000,
19
19
  pricing: {
20
- cachedInput: 0.13,
21
- input: 1.25,
22
- output: 10,
20
+ units: [
21
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
22
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
23
+ { name: 'textInput_cacheRead', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
24
+ ],
23
25
  },
24
26
  releasedAt: '2025-08-07',
25
27
  settings: {
@@ -43,9 +45,11 @@ const aihubmixModels: AIChatModelCard[] = [
43
45
  id: 'gpt-5-mini',
44
46
  maxOutput: 128_000,
45
47
  pricing: {
46
- cachedInput: 0.03,
47
- input: 0.25,
48
- output: 2,
48
+ units: [
49
+ { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
50
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
51
+ { name: 'textInput_cacheRead', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
52
+ ],
49
53
  },
50
54
  releasedAt: '2025-08-07',
51
55
  settings: {
@@ -67,9 +71,11 @@ const aihubmixModels: AIChatModelCard[] = [
67
71
  id: 'gpt-5-nano',
68
72
  maxOutput: 128_000,
69
73
  pricing: {
70
- cachedInput: 0.01,
71
- input: 0.05,
72
- output: 0.4,
74
+ units: [
75
+ { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
76
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
77
+ { name: 'textInput_cacheRead', rate: 0.01, strategy: 'fixed', unit: 'millionTokens' },
78
+ ],
73
79
  },
74
80
  releasedAt: '2025-08-07',
75
81
  type: 'chat',
@@ -86,9 +92,11 @@ const aihubmixModels: AIChatModelCard[] = [
86
92
  id: 'gpt-5-chat-latest',
87
93
  maxOutput: 128_000,
88
94
  pricing: {
89
- cachedInput: 0.13,
90
- input: 1.25,
91
- output: 10,
95
+ units: [
96
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
97
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
98
+ { name: 'textInput_cacheRead', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
99
+ ],
92
100
  },
93
101
  releasedAt: '2025-08-07',
94
102
  type: 'chat',
@@ -108,9 +116,11 @@ const aihubmixModels: AIChatModelCard[] = [
108
116
  id: 'o4-mini',
109
117
  maxOutput: 100_000,
110
118
  pricing: {
111
- cachedInput: 0.275,
112
- input: 1.1,
113
- output: 4.4,
119
+ units: [
120
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
121
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
122
+ { name: 'textInput_cacheRead', rate: 0.275, strategy: 'fixed', unit: 'millionTokens' },
123
+ ],
114
124
  },
115
125
  releasedAt: '2025-04-17',
116
126
  settings: {
@@ -133,9 +143,11 @@ const aihubmixModels: AIChatModelCard[] = [
133
143
  id: 'o4-mini-deep-research',
134
144
  maxOutput: 100_000,
135
145
  pricing: {
136
- cachedInput: 0.5,
137
- input: 2,
138
- output: 8,
146
+ units: [
147
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
148
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
149
+ { name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
150
+ ],
139
151
  },
140
152
  releasedAt: '2025-06-26',
141
153
  settings: {
@@ -158,8 +170,10 @@ const aihubmixModels: AIChatModelCard[] = [
158
170
  id: 'o3-pro',
159
171
  maxOutput: 100_000,
160
172
  pricing: {
161
- input: 20,
162
- output: 80,
173
+ units: [
174
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
175
+ { name: 'textOutput', rate: 80, strategy: 'fixed', unit: 'millionTokens' },
176
+ ],
163
177
  },
164
178
  releasedAt: '2025-06-10',
165
179
  settings: {
@@ -183,9 +197,11 @@ const aihubmixModels: AIChatModelCard[] = [
183
197
  id: 'o3',
184
198
  maxOutput: 100_000,
185
199
  pricing: {
186
- cachedInput: 0.5,
187
- input: 2,
188
- output: 8,
200
+ units: [
201
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
202
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
203
+ { name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
204
+ ],
189
205
  },
190
206
  releasedAt: '2025-04-16',
191
207
  settings: {
@@ -208,9 +224,11 @@ const aihubmixModels: AIChatModelCard[] = [
208
224
  id: 'o3-deep-research',
209
225
  maxOutput: 100_000,
210
226
  pricing: {
211
- cachedInput: 2.5,
212
- input: 10,
213
- output: 40,
227
+ units: [
228
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
229
+ { name: 'textOutput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
230
+ { name: 'textInput_cacheRead', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
231
+ ],
214
232
  },
215
233
  releasedAt: '2025-06-26',
216
234
  settings: {
@@ -231,9 +249,11 @@ const aihubmixModels: AIChatModelCard[] = [
231
249
  id: 'gpt-4.1',
232
250
  maxOutput: 32_768,
233
251
  pricing: {
234
- cachedInput: 0.5,
235
- input: 2,
236
- output: 8,
252
+ units: [
253
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
254
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
255
+ { name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
256
+ ],
237
257
  },
238
258
  releasedAt: '2025-04-14',
239
259
  settings: {
@@ -254,9 +274,11 @@ const aihubmixModels: AIChatModelCard[] = [
254
274
  id: 'gpt-4.1-mini',
255
275
  maxOutput: 32_768,
256
276
  pricing: {
257
- cachedInput: 0.1,
258
- input: 0.4,
259
- output: 1.6,
277
+ units: [
278
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
279
+ { name: 'textOutput', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
280
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
281
+ ],
260
282
  },
261
283
  releasedAt: '2025-04-14',
262
284
  settings: {
@@ -275,9 +297,11 @@ const aihubmixModels: AIChatModelCard[] = [
275
297
  id: 'gpt-4.1-nano',
276
298
  maxOutput: 32_768,
277
299
  pricing: {
278
- cachedInput: 0.025,
279
- input: 0.1,
280
- output: 0.4,
300
+ units: [
301
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
302
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
303
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
304
+ ],
281
305
  },
282
306
  releasedAt: '2025-04-14',
283
307
  type: 'chat',
@@ -292,8 +316,10 @@ const aihubmixModels: AIChatModelCard[] = [
292
316
  displayName: 'ChatGPT-4o',
293
317
  id: 'chatgpt-4o-latest',
294
318
  pricing: {
295
- input: 5,
296
- output: 15,
319
+ units: [
320
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
321
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
322
+ ],
297
323
  },
298
324
  type: 'chat',
299
325
  },
@@ -309,9 +335,11 @@ const aihubmixModels: AIChatModelCard[] = [
309
335
  enabled: true,
310
336
  id: 'grok-3',
311
337
  pricing: {
312
- cachedInput: 0.75,
313
- input: 3,
314
- output: 15,
338
+ units: [
339
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
340
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
341
+ { name: 'textInput_cacheRead', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
342
+ ],
315
343
  },
316
344
  releasedAt: '2025-04-03',
317
345
  settings: {
@@ -332,8 +360,10 @@ const aihubmixModels: AIChatModelCard[] = [
332
360
  enabled: true,
333
361
  id: 'grok-3-mini',
334
362
  pricing: {
335
- input: 0.3,
336
- output: 0.5,
363
+ units: [
364
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
365
+ { name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
366
+ ],
337
367
  },
338
368
  releasedAt: '2025-04-03',
339
369
  settings: {
@@ -357,10 +387,17 @@ const aihubmixModels: AIChatModelCard[] = [
357
387
  id: 'claude-opus-4-1-20250805',
358
388
  maxOutput: 32_000,
359
389
  pricing: {
360
- cachedInput: 1.5,
361
- input: 16.5,
362
- output: 82.5,
363
- writeCacheInput: 18.75,
390
+ units: [
391
+ { name: 'textInput', rate: 16.5, strategy: 'fixed', unit: 'millionTokens' },
392
+ { name: 'textOutput', rate: 82.5, strategy: 'fixed', unit: 'millionTokens' },
393
+ { name: 'textInput_cacheRead', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
394
+ {
395
+ lookup: { prices: { '5m': 20.625 }, pricingParams: ['ttl'] },
396
+ name: 'textInput_cacheWrite',
397
+ strategy: 'lookup',
398
+ unit: 'millionTokens',
399
+ },
400
+ ],
364
401
  },
365
402
  releasedAt: '2025-08-05',
366
403
  settings: {
@@ -383,10 +420,17 @@ const aihubmixModels: AIChatModelCard[] = [
383
420
  id: 'claude-opus-4-20250514',
384
421
  maxOutput: 32_000,
385
422
  pricing: {
386
- cachedInput: 1.5,
387
- input: 16.8,
388
- output: 84,
389
- writeCacheInput: 18.75,
423
+ units: [
424
+ { name: 'textInput', rate: 16.8, strategy: 'fixed', unit: 'millionTokens' },
425
+ { name: 'textOutput', rate: 84, strategy: 'fixed', unit: 'millionTokens' },
426
+ { name: 'textInput_cacheRead', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
427
+ {
428
+ lookup: { prices: { '5m': 20.625 }, pricingParams: ['ttl'] },
429
+ name: 'textInput_cacheWrite',
430
+ strategy: 'lookup',
431
+ unit: 'millionTokens',
432
+ },
433
+ ],
390
434
  },
391
435
  releasedAt: '2025-05-23',
392
436
  settings: {
@@ -410,10 +454,17 @@ const aihubmixModels: AIChatModelCard[] = [
410
454
  id: 'claude-sonnet-4-20250514',
411
455
  maxOutput: 64_000,
412
456
  pricing: {
413
- cachedInput: 0.3,
414
- input: 3.3,
415
- output: 16.5,
416
- writeCacheInput: 3.75,
457
+ units: [
458
+ { name: 'textInput', rate: 3.3, strategy: 'fixed', unit: 'millionTokens' },
459
+ { name: 'textOutput', rate: 16.5, strategy: 'fixed', unit: 'millionTokens' },
460
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
461
+ {
462
+ lookup: { prices: { '5m': 4.125 }, pricingParams: ['ttl'] },
463
+ name: 'textInput_cacheWrite',
464
+ strategy: 'lookup',
465
+ unit: 'millionTokens',
466
+ },
467
+ ],
417
468
  },
418
469
  releasedAt: '2025-05-23',
419
470
  settings: {
@@ -436,10 +487,17 @@ const aihubmixModels: AIChatModelCard[] = [
436
487
  id: 'claude-3-7-sonnet-20250219',
437
488
  maxOutput: 64_000,
438
489
  pricing: {
439
- cachedInput: 0.3,
440
- input: 3.3,
441
- output: 16.5,
442
- writeCacheInput: 3.75,
490
+ units: [
491
+ { name: 'textInput', rate: 3.3, strategy: 'fixed', unit: 'millionTokens' },
492
+ { name: 'textOutput', rate: 16.5, strategy: 'fixed', unit: 'millionTokens' },
493
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
494
+ {
495
+ lookup: { prices: { '5m': 4.125 }, pricingParams: ['ttl'] },
496
+ name: 'textInput_cacheWrite',
497
+ strategy: 'lookup',
498
+ unit: 'millionTokens',
499
+ },
500
+ ],
443
501
  },
444
502
  releasedAt: '2025-02-24',
445
503
  settings: {
@@ -460,10 +518,17 @@ const aihubmixModels: AIChatModelCard[] = [
460
518
  id: 'claude-3-5-haiku-20241022',
461
519
  maxOutput: 8192,
462
520
  pricing: {
463
- cachedInput: 0.1,
464
- input: 1.1,
465
- output: 5.5,
466
- writeCacheInput: 1.25,
521
+ units: [
522
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
523
+ { name: 'textOutput', rate: 5.5, strategy: 'fixed', unit: 'millionTokens' },
524
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
525
+ {
526
+ lookup: { prices: { '5m': 1.1 }, pricingParams: ['ttl'] },
527
+ name: 'textInput_cacheWrite',
528
+ strategy: 'lookup',
529
+ unit: 'millionTokens',
530
+ },
531
+ ],
467
532
  },
468
533
  releasedAt: '2024-11-05',
469
534
  settings: {
@@ -483,8 +548,10 @@ const aihubmixModels: AIChatModelCard[] = [
483
548
  enabled: true,
484
549
  id: 'DeepSeek-R1',
485
550
  pricing: {
486
- input: 0.546,
487
- output: 2.184,
551
+ units: [
552
+ { name: 'textInput', rate: 0.546, strategy: 'fixed', unit: 'millionTokens' },
553
+ { name: 'textOutput', rate: 2.184, strategy: 'fixed', unit: 'millionTokens' },
554
+ ],
488
555
  },
489
556
  type: 'chat',
490
557
  },
@@ -499,8 +566,10 @@ const aihubmixModels: AIChatModelCard[] = [
499
566
  displayName: 'DeepSeek R1 0528 (Azure)',
500
567
  id: 'azure-DeepSeek-R1-0528',
501
568
  pricing: {
502
- input: 0.4,
503
- output: 1.6,
569
+ units: [
570
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
571
+ { name: 'textOutput', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
572
+ ],
504
573
  },
505
574
  type: 'chat',
506
575
  },
@@ -514,8 +583,10 @@ const aihubmixModels: AIChatModelCard[] = [
514
583
  enabled: true,
515
584
  id: 'DeepSeek-V3',
516
585
  pricing: {
517
- input: 0.272,
518
- output: 1.088,
586
+ units: [
587
+ { name: 'textInput', rate: 0.272, strategy: 'fixed', unit: 'millionTokens' },
588
+ { name: 'textOutput', rate: 1.088, strategy: 'fixed', unit: 'millionTokens' },
589
+ ],
519
590
  },
520
591
  type: 'chat',
521
592
  },
@@ -529,8 +600,10 @@ const aihubmixModels: AIChatModelCard[] = [
529
600
  displayName: 'DeepSeek V3 (Fast)',
530
601
  id: 'DeepSeek-V3-Fast',
531
602
  pricing: {
532
- input: 0.55,
533
- output: 2.2,
603
+ units: [
604
+ { name: 'textInput', rate: 0.55, strategy: 'fixed', unit: 'millionTokens' },
605
+ { name: 'textOutput', rate: 2.2, strategy: 'fixed', unit: 'millionTokens' },
606
+ ],
534
607
  },
535
608
  type: 'chat',
536
609
  },
@@ -549,8 +622,10 @@ const aihubmixModels: AIChatModelCard[] = [
549
622
  id: 'gemini-2.5-pro',
550
623
  maxOutput: 65_536,
551
624
  pricing: {
552
- input: 1.25, // prompts <= 200k tokens
553
- output: 10, // prompts <= 200k tokens
625
+ units: [
626
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
627
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
628
+ ],
554
629
  },
555
630
  releasedAt: '2025-06-17',
556
631
  settings: {
@@ -574,9 +649,11 @@ const aihubmixModels: AIChatModelCard[] = [
574
649
  id: 'gemini-2.5-flash',
575
650
  maxOutput: 65_536,
576
651
  pricing: {
577
- cachedInput: 0.075,
578
- input: 0.3,
579
- output: 2.5,
652
+ units: [
653
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
654
+ { name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
655
+ { name: 'textInput_cacheRead', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
656
+ ],
580
657
  },
581
658
  releasedAt: '2025-06-17',
582
659
  settings: {
@@ -599,9 +676,11 @@ const aihubmixModels: AIChatModelCard[] = [
599
676
  id: 'gemini-2.5-flash-lite',
600
677
  maxOutput: 65_536,
601
678
  pricing: {
602
- cachedInput: 0.025,
603
- input: 0.1,
604
- output: 0.4,
679
+ units: [
680
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
681
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
682
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
683
+ ],
605
684
  },
606
685
  releasedAt: '2025-07-22',
607
686
  settings: {
@@ -626,8 +705,10 @@ const aihubmixModels: AIChatModelCard[] = [
626
705
  organization: 'Qwen',
627
706
  pricing: {
628
707
  currency: 'CNY',
629
- input: 0.28,
630
- output: 2.8,
708
+ units: [
709
+ { name: 'textInput', rate: 0.28, strategy: 'fixed', unit: 'millionTokens' },
710
+ { name: 'textOutput', rate: 2.8, strategy: 'fixed', unit: 'millionTokens' },
711
+ ],
631
712
  },
632
713
  releasedAt: '2025-07-25',
633
714
  type: 'chat',
@@ -646,8 +727,10 @@ const aihubmixModels: AIChatModelCard[] = [
646
727
  organization: 'Qwen',
647
728
  pricing: {
648
729
  currency: 'CNY',
649
- input: 0.28,
650
- output: 1.12,
730
+ units: [
731
+ { name: 'textInput', rate: 0.28, strategy: 'fixed', unit: 'millionTokens' },
732
+ { name: 'textOutput', rate: 1.12, strategy: 'fixed', unit: 'millionTokens' },
733
+ ],
651
734
  },
652
735
  releasedAt: '2025-07-22',
653
736
  type: 'chat',
@@ -667,8 +750,10 @@ const aihubmixModels: AIChatModelCard[] = [
667
750
  organization: 'Qwen',
668
751
  pricing: {
669
752
  currency: 'CNY',
670
- input: 0.12,
671
- output: 1.2,
753
+ units: [
754
+ { name: 'textInput', rate: 0.12, strategy: 'fixed', unit: 'millionTokens' },
755
+ { name: 'textOutput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
756
+ ],
672
757
  },
673
758
  releasedAt: '2025-07-30',
674
759
  type: 'chat',
@@ -686,8 +771,11 @@ const aihubmixModels: AIChatModelCard[] = [
686
771
  maxOutput: 32_768,
687
772
  organization: 'Qwen',
688
773
  pricing: {
689
- input: 0.12,
690
- output: 0.48,
774
+ currency: 'CNY',
775
+ units: [
776
+ { name: 'textInput', rate: 0.12, strategy: 'fixed', unit: 'millionTokens' },
777
+ { name: 'textOutput', rate: 0.48, strategy: 'fixed', unit: 'millionTokens' },
778
+ ],
691
779
  },
692
780
  releasedAt: '2025-07-29',
693
781
  type: 'chat',