@lobehub/chat 1.111.0 → 1.111.2

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 (101) 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 +50 -0
  9. package/changelog/v1.json +14 -0
  10. package/package.json +1 -1
  11. package/packages/types/src/aiModel.ts +67 -46
  12. package/packages/types/src/llm.ts +3 -3
  13. package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Overview/ProviderList/index.tsx +23 -12
  14. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Overview/ModelList/index.tsx +23 -10
  15. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +21 -12
  16. package/src/config/aiModels/ai21.ts +8 -4
  17. package/src/config/aiModels/ai360.ts +28 -14
  18. package/src/config/aiModels/aihubmix.ts +174 -86
  19. package/src/config/aiModels/anthropic.ts +97 -38
  20. package/src/config/aiModels/azure.ts +54 -32
  21. package/src/config/aiModels/azureai.ts +63 -37
  22. package/src/config/aiModels/baichuan.ts +24 -12
  23. package/src/config/aiModels/bedrock.ts +60 -30
  24. package/src/config/aiModels/cohere.ts +60 -30
  25. package/src/config/aiModels/deepseek.ts +10 -6
  26. package/src/config/aiModels/fal.ts +43 -6
  27. package/src/config/aiModels/fireworksai.ts +88 -44
  28. package/src/config/aiModels/giteeai.ts +1 -1
  29. package/src/config/aiModels/github.ts +44 -26
  30. package/src/config/aiModels/google.ts +119 -68
  31. package/src/config/aiModels/groq.ts +48 -24
  32. package/src/config/aiModels/higress.ts +617 -310
  33. package/src/config/aiModels/hunyuan.ts +105 -54
  34. package/src/config/aiModels/infiniai.ts +104 -52
  35. package/src/config/aiModels/internlm.ts +16 -8
  36. package/src/config/aiModels/jina.ts +4 -2
  37. package/src/config/aiModels/minimax.ts +11 -10
  38. package/src/config/aiModels/mistral.ts +40 -20
  39. package/src/config/aiModels/moonshot.ts +42 -22
  40. package/src/config/aiModels/novita.ts +196 -98
  41. package/src/config/aiModels/openai.ts +270 -137
  42. package/src/config/aiModels/openrouter.ts +205 -100
  43. package/src/config/aiModels/perplexity.ts +36 -6
  44. package/src/config/aiModels/ppio.ts +76 -38
  45. package/src/config/aiModels/qwen.ts +257 -133
  46. package/src/config/aiModels/sambanova.ts +56 -28
  47. package/src/config/aiModels/sensenova.ts +100 -50
  48. package/src/config/aiModels/siliconcloud.ts +224 -112
  49. package/src/config/aiModels/stepfun.ts +44 -22
  50. package/src/config/aiModels/taichu.ts +8 -4
  51. package/src/config/aiModels/tencentcloud.ts +12 -6
  52. package/src/config/aiModels/upstage.ts +8 -4
  53. package/src/config/aiModels/v0.ts +15 -12
  54. package/src/config/aiModels/vertexai.ts +49 -27
  55. package/src/config/aiModels/volcengine.ts +110 -51
  56. package/src/config/aiModels/wenxin.ts +179 -73
  57. package/src/config/aiModels/xai.ts +33 -19
  58. package/src/config/aiModels/zeroone.ts +48 -24
  59. package/src/config/aiModels/zhipu.ts +118 -69
  60. package/src/config/modelProviders/ai21.ts +0 -8
  61. package/src/config/modelProviders/ai360.ts +0 -20
  62. package/src/config/modelProviders/anthropic.ts +0 -56
  63. package/src/config/modelProviders/baichuan.ts +0 -30
  64. package/src/config/modelProviders/bedrock.ts +0 -74
  65. package/src/config/modelProviders/deepseek.ts +0 -13
  66. package/src/config/modelProviders/fireworksai.ts +0 -88
  67. package/src/config/modelProviders/google.ts +0 -59
  68. package/src/config/modelProviders/groq.ts +0 -48
  69. package/src/config/modelProviders/higress.ts +0 -727
  70. package/src/config/modelProviders/hunyuan.ts +0 -45
  71. package/src/config/modelProviders/infiniai.ts +0 -60
  72. package/src/config/modelProviders/internlm.ts +0 -8
  73. package/src/config/modelProviders/mistral.ts +0 -48
  74. package/src/config/modelProviders/modelscope.ts +2 -1
  75. package/src/config/modelProviders/openai.ts +5 -100
  76. package/src/config/modelProviders/openrouter.ts +0 -77
  77. package/src/config/modelProviders/ppio.ts +0 -95
  78. package/src/config/modelProviders/qwen.ts +0 -165
  79. package/src/config/modelProviders/sensenova.ts +0 -45
  80. package/src/config/modelProviders/siliconcloud.ts +0 -266
  81. package/src/config/modelProviders/stepfun.ts +0 -60
  82. package/src/config/modelProviders/taichu.ts +0 -10
  83. package/src/config/modelProviders/wenxin.ts +0 -90
  84. package/src/config/modelProviders/xai.ts +0 -16
  85. package/src/config/modelProviders/zeroone.ts +0 -60
  86. package/src/config/modelProviders/zhipu.ts +0 -80
  87. package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +4 -3
  88. package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +25 -15
  89. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +7 -5
  90. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +6 -5
  91. package/src/libs/model-runtime/fal/index.ts +8 -2
  92. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.test.ts +54 -8
  93. package/src/server/routers/lambda/agent.ts +2 -2
  94. package/src/server/routers/lambda/config/__snapshots__/index.test.ts.snap +0 -28
  95. package/src/server/services/discover/index.ts +7 -6
  96. package/src/server/services/user/index.ts +1 -2
  97. package/src/utils/__snapshots__/parseModels.test.ts.snap +28 -4
  98. package/src/utils/_deprecated/__snapshots__/parseModels.test.ts.snap +0 -8
  99. package/src/utils/parseModels.test.ts +60 -9
  100. package/src/utils/pricing.test.ts +183 -0
  101. package/src/utils/pricing.ts +90 -0
@@ -16,10 +16,17 @@ const anthropicChatModels: AIChatModelCard[] = [
16
16
  id: 'claude-opus-4-1-20250805',
17
17
  maxOutput: 32_000,
18
18
  pricing: {
19
- cachedInput: 1.5,
20
- input: 15,
21
- output: 75,
22
- writeCacheInput: 18.75,
19
+ units: [
20
+ { name: 'textInput_cacheRead', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
21
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
22
+ { name: 'textOutput', rate: 75, strategy: 'fixed', unit: 'millionTokens' },
23
+ {
24
+ lookup: { prices: { '1h': 30, '5m': 18.75 }, pricingParams: ['ttl'] },
25
+ name: 'textInput_cacheWrite',
26
+ strategy: 'lookup',
27
+ unit: 'millionTokens',
28
+ },
29
+ ],
23
30
  },
24
31
  releasedAt: '2025-08-05',
25
32
  settings: {
@@ -42,10 +49,17 @@ const anthropicChatModels: AIChatModelCard[] = [
42
49
  id: 'claude-opus-4-20250514',
43
50
  maxOutput: 32_000,
44
51
  pricing: {
45
- cachedInput: 1.5,
46
- input: 15,
47
- output: 75,
48
- writeCacheInput: 18.75,
52
+ units: [
53
+ { name: 'textInput_cacheRead', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
54
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
55
+ { name: 'textOutput', rate: 75, strategy: 'fixed', unit: 'millionTokens' },
56
+ {
57
+ lookup: { prices: { '1h': 30, '5m': 18.75 }, pricingParams: ['ttl'] },
58
+ name: 'textInput_cacheWrite',
59
+ strategy: 'lookup',
60
+ unit: 'millionTokens',
61
+ },
62
+ ],
49
63
  },
50
64
  releasedAt: '2025-05-23',
51
65
  settings: {
@@ -69,10 +83,17 @@ const anthropicChatModels: AIChatModelCard[] = [
69
83
  id: 'claude-sonnet-4-20250514',
70
84
  maxOutput: 64_000,
71
85
  pricing: {
72
- cachedInput: 0.3,
73
- input: 3,
74
- output: 15,
75
- writeCacheInput: 3.75,
86
+ units: [
87
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
88
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
89
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
90
+ {
91
+ lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
92
+ name: 'textInput_cacheWrite',
93
+ strategy: 'lookup',
94
+ unit: 'millionTokens',
95
+ },
96
+ ],
76
97
  },
77
98
  releasedAt: '2025-05-23',
78
99
  settings: {
@@ -96,10 +117,17 @@ const anthropicChatModels: AIChatModelCard[] = [
96
117
  id: 'claude-3-7-sonnet-20250219',
97
118
  maxOutput: 64_000,
98
119
  pricing: {
99
- cachedInput: 0.3,
100
- input: 3,
101
- output: 15,
102
- writeCacheInput: 3.75,
120
+ units: [
121
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
122
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
123
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
124
+ {
125
+ lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
126
+ name: 'textInput_cacheWrite',
127
+ strategy: 'lookup',
128
+ unit: 'millionTokens',
129
+ },
130
+ ],
103
131
  },
104
132
  releasedAt: '2025-02-24',
105
133
  settings: {
@@ -121,10 +149,17 @@ const anthropicChatModels: AIChatModelCard[] = [
121
149
  id: 'claude-3-5-sonnet-20241022',
122
150
  maxOutput: 8192,
123
151
  pricing: {
124
- cachedInput: 0.3,
125
- input: 3,
126
- output: 15,
127
- writeCacheInput: 3.75,
152
+ units: [
153
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
154
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
155
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
156
+ {
157
+ lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
158
+ name: 'textInput_cacheWrite',
159
+ strategy: 'lookup',
160
+ unit: 'millionTokens',
161
+ },
162
+ ],
128
163
  },
129
164
  releasedAt: '2024-10-22',
130
165
  settings: {
@@ -145,10 +180,17 @@ const anthropicChatModels: AIChatModelCard[] = [
145
180
  id: 'claude-3-5-sonnet-20240620',
146
181
  maxOutput: 8192,
147
182
  pricing: {
148
- cachedInput: 0.3,
149
- input: 3,
150
- output: 15,
151
- writeCacheInput: 3.75,
183
+ units: [
184
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
185
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
186
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
187
+ {
188
+ lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
189
+ name: 'textInput_cacheWrite',
190
+ strategy: 'lookup',
191
+ unit: 'millionTokens',
192
+ },
193
+ ],
152
194
  },
153
195
  releasedAt: '2024-06-20',
154
196
  settings: {
@@ -170,10 +212,17 @@ const anthropicChatModels: AIChatModelCard[] = [
170
212
  id: 'claude-3-5-haiku-20241022',
171
213
  maxOutput: 8192,
172
214
  pricing: {
173
- cachedInput: 0.1,
174
- input: 1,
175
- output: 5,
176
- writeCacheInput: 1.25,
215
+ units: [
216
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
217
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
218
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
219
+ {
220
+ lookup: { prices: { '1h': 1.6, '5m': 1 }, pricingParams: ['ttl'] },
221
+ name: 'textInput_cacheWrite',
222
+ strategy: 'lookup',
223
+ unit: 'millionTokens',
224
+ },
225
+ ],
177
226
  },
178
227
  releasedAt: '2024-11-05',
179
228
  settings: {
@@ -193,8 +242,10 @@ const anthropicChatModels: AIChatModelCard[] = [
193
242
  id: 'claude-3-haiku-20240307',
194
243
  maxOutput: 4096,
195
244
  pricing: {
196
- input: 0.25,
197
- output: 1.25,
245
+ units: [
246
+ { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
247
+ { name: 'textOutput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
248
+ ],
198
249
  },
199
250
  releasedAt: '2024-03-07',
200
251
  settings: {
@@ -214,8 +265,10 @@ const anthropicChatModels: AIChatModelCard[] = [
214
265
  id: 'claude-3-sonnet-20240229', // 弃用日期 2025年7月21日
215
266
  maxOutput: 4096,
216
267
  pricing: {
217
- input: 3,
218
- output: 15,
268
+ units: [
269
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
270
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
271
+ ],
219
272
  },
220
273
  releasedAt: '2024-02-29',
221
274
  type: 'chat',
@@ -232,8 +285,10 @@ const anthropicChatModels: AIChatModelCard[] = [
232
285
  id: 'claude-3-opus-20240229',
233
286
  maxOutput: 4096,
234
287
  pricing: {
235
- input: 15,
236
- output: 75,
288
+ units: [
289
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
290
+ { name: 'textOutput', rate: 75, strategy: 'fixed', unit: 'millionTokens' },
291
+ ],
237
292
  },
238
293
  releasedAt: '2024-02-29',
239
294
  settings: {
@@ -249,8 +304,10 @@ const anthropicChatModels: AIChatModelCard[] = [
249
304
  id: 'claude-2.1', // 弃用日期 2025年7月21日
250
305
  maxOutput: 4096,
251
306
  pricing: {
252
- input: 8,
253
- output: 24,
307
+ units: [
308
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
309
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
310
+ ],
254
311
  },
255
312
  releasedAt: '2023-11-21',
256
313
  type: 'chat',
@@ -263,8 +320,10 @@ const anthropicChatModels: AIChatModelCard[] = [
263
320
  id: 'claude-2.0', // 弃用日期 2025年7月21日
264
321
  maxOutput: 4096,
265
322
  pricing: {
266
- input: 8,
267
- output: 24,
323
+ units: [
324
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
325
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
326
+ ],
268
327
  },
269
328
  releasedAt: '2023-07-11',
270
329
  type: 'chat',
@@ -18,9 +18,11 @@ const azureChatModels: AIChatModelCard[] = [
18
18
  id: 'o3',
19
19
  maxOutput: 100_000,
20
20
  pricing: {
21
- cachedInput: 2.5,
22
- input: 10,
23
- output: 40,
21
+ units: [
22
+ { name: 'textInput_cacheRead', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
23
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
24
+ { name: 'textOutput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
25
+ ],
24
26
  },
25
27
  releasedAt: '2025-04-17',
26
28
  type: 'chat',
@@ -42,9 +44,11 @@ const azureChatModels: AIChatModelCard[] = [
42
44
  id: 'o4-mini',
43
45
  maxOutput: 100_000,
44
46
  pricing: {
45
- cachedInput: 0.275,
46
- input: 1.1,
47
- output: 4.4,
47
+ units: [
48
+ { name: 'textInput_cacheRead', rate: 0.275, strategy: 'fixed', unit: 'millionTokens' },
49
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
50
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
51
+ ],
48
52
  },
49
53
  releasedAt: '2025-04-17',
50
54
  type: 'chat',
@@ -64,9 +68,11 @@ const azureChatModels: AIChatModelCard[] = [
64
68
  id: 'gpt-4.1',
65
69
  maxOutput: 32_768,
66
70
  pricing: {
67
- cachedInput: 0.5,
68
- input: 2,
69
- output: 8,
71
+ units: [
72
+ { name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
73
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
74
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
75
+ ],
70
76
  },
71
77
  releasedAt: '2025-04-14',
72
78
  type: 'chat',
@@ -87,9 +93,11 @@ const azureChatModels: AIChatModelCard[] = [
87
93
  id: 'gpt-4.1-mini',
88
94
  maxOutput: 32_768,
89
95
  pricing: {
90
- cachedInput: 0.1,
91
- input: 0.4,
92
- output: 1.6,
96
+ units: [
97
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
98
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
99
+ { name: 'textOutput', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
100
+ ],
93
101
  },
94
102
  releasedAt: '2025-04-14',
95
103
  type: 'chat',
@@ -109,9 +117,11 @@ const azureChatModels: AIChatModelCard[] = [
109
117
  id: 'gpt-4.1-nano',
110
118
  maxOutput: 32_768,
111
119
  pricing: {
112
- cachedInput: 0.025,
113
- input: 0.1,
114
- output: 0.4,
120
+ units: [
121
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
122
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
123
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
124
+ ],
115
125
  },
116
126
  releasedAt: '2025-04-14',
117
127
  type: 'chat',
@@ -131,9 +141,11 @@ const azureChatModels: AIChatModelCard[] = [
131
141
  id: 'o3-mini',
132
142
  maxOutput: 100_000,
133
143
  pricing: {
134
- cachedInput: 0.55,
135
- input: 1.1,
136
- output: 4.4,
144
+ units: [
145
+ { name: 'textInput_cacheRead', rate: 0.55, strategy: 'fixed', unit: 'millionTokens' },
146
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
147
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
148
+ ],
137
149
  },
138
150
  releasedAt: '2025-01-31',
139
151
  type: 'chat',
@@ -152,9 +164,11 @@ const azureChatModels: AIChatModelCard[] = [
152
164
  id: 'o1-mini',
153
165
  maxOutput: 65_536,
154
166
  pricing: {
155
- cachedInput: 0.55,
156
- input: 1.1,
157
- output: 4.4,
167
+ units: [
168
+ { name: 'textInput_cacheRead', rate: 0.55, strategy: 'fixed', unit: 'millionTokens' },
169
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
170
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
171
+ ],
158
172
  },
159
173
  releasedAt: '2024-09-12',
160
174
  type: 'chat',
@@ -173,9 +187,11 @@ const azureChatModels: AIChatModelCard[] = [
173
187
  id: 'o1',
174
188
  maxOutput: 100_000,
175
189
  pricing: {
176
- cachedInput: 7.5,
177
- input: 15,
178
- output: 60,
190
+ units: [
191
+ { name: 'textInput_cacheRead', rate: 7.5, strategy: 'fixed', unit: 'millionTokens' },
192
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
193
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
194
+ ],
179
195
  },
180
196
  releasedAt: '2024-12-17',
181
197
  type: 'chat',
@@ -194,8 +210,10 @@ const azureChatModels: AIChatModelCard[] = [
194
210
  id: 'o1-preview',
195
211
  maxOutput: 32_768,
196
212
  pricing: {
197
- input: 15,
198
- output: 60,
213
+ units: [
214
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
215
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
216
+ ],
199
217
  },
200
218
  releasedAt: '2024-09-12',
201
219
  type: 'chat',
@@ -216,9 +234,11 @@ const azureChatModels: AIChatModelCard[] = [
216
234
  id: 'gpt-4o',
217
235
  maxOutput: 4096,
218
236
  pricing: {
219
- cachedInput: 1.25,
220
- input: 2.5,
221
- output: 10,
237
+ units: [
238
+ { name: 'textInput_cacheRead', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
239
+ { name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
240
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
241
+ ],
222
242
  },
223
243
  releasedAt: '2024-05-13',
224
244
  type: 'chat',
@@ -252,9 +272,11 @@ const azureChatModels: AIChatModelCard[] = [
252
272
  id: 'gpt-4o-mini',
253
273
  maxOutput: 4096,
254
274
  pricing: {
255
- cachedInput: 0.075,
256
- input: 0.15,
257
- output: 0.6,
275
+ units: [
276
+ { name: 'textInput_cacheRead', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
277
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
278
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
279
+ ],
258
280
  },
259
281
  type: 'chat',
260
282
  },
@@ -9,8 +9,10 @@ const azureChatModels: AIChatModelCard[] = [
9
9
  displayName: 'DeepSeek R1',
10
10
  id: 'DeepSeek-R1',
11
11
  pricing: {
12
- input: 1.35,
13
- output: 5.4,
12
+ units: [
13
+ { name: 'textInput', rate: 1.35, strategy: 'fixed', unit: 'millionTokens' },
14
+ { name: 'textOutput', rate: 5.4, strategy: 'fixed', unit: 'millionTokens' },
15
+ ],
14
16
  },
15
17
  type: 'chat',
16
18
  },
@@ -22,8 +24,10 @@ const azureChatModels: AIChatModelCard[] = [
22
24
  displayName: 'DeepSeek V3',
23
25
  id: 'DeepSeek-V3',
24
26
  pricing: {
25
- input: 1.14,
26
- output: 4.56,
27
+ units: [
28
+ { name: 'textInput', rate: 1.14, strategy: 'fixed', unit: 'millionTokens' },
29
+ { name: 'textOutput', rate: 4.56, strategy: 'fixed', unit: 'millionTokens' },
30
+ ],
27
31
  },
28
32
  type: 'chat',
29
33
  },
@@ -40,9 +44,11 @@ const azureChatModels: AIChatModelCard[] = [
40
44
  id: 'o3',
41
45
  maxOutput: 100_000,
42
46
  pricing: {
43
- cachedInput: 2.5,
44
- input: 10,
45
- output: 40,
47
+ units: [
48
+ { name: 'textInput_cacheRead', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
49
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
50
+ { name: 'textOutput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
51
+ ],
46
52
  },
47
53
  releasedAt: '2025-04-17',
48
54
  type: 'chat',
@@ -60,9 +66,11 @@ const azureChatModels: AIChatModelCard[] = [
60
66
  id: 'o4-mini',
61
67
  maxOutput: 100_000,
62
68
  pricing: {
63
- cachedInput: 0.275,
64
- input: 1.1,
65
- output: 4.4,
69
+ units: [
70
+ { name: 'textInput_cacheRead', rate: 0.275, strategy: 'fixed', unit: 'millionTokens' },
71
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
72
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
73
+ ],
66
74
  },
67
75
  releasedAt: '2025-04-17',
68
76
  type: 'chat',
@@ -79,9 +87,11 @@ const azureChatModels: AIChatModelCard[] = [
79
87
  id: 'gpt-4.1',
80
88
  maxOutput: 32_768,
81
89
  pricing: {
82
- cachedInput: 0.5,
83
- input: 2,
84
- output: 8,
90
+ units: [
91
+ { name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
92
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
93
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
94
+ ],
85
95
  },
86
96
  releasedAt: '2025-04-14',
87
97
  type: 'chat',
@@ -99,9 +109,11 @@ const azureChatModels: AIChatModelCard[] = [
99
109
  id: 'gpt-4.1-mini',
100
110
  maxOutput: 32_768,
101
111
  pricing: {
102
- cachedInput: 0.1,
103
- input: 0.4,
104
- output: 1.6,
112
+ units: [
113
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
114
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
115
+ { name: 'textOutput', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
116
+ ],
105
117
  },
106
118
  releasedAt: '2025-04-14',
107
119
  type: 'chat',
@@ -118,9 +130,11 @@ const azureChatModels: AIChatModelCard[] = [
118
130
  id: 'gpt-4.1-nano',
119
131
  maxOutput: 32_768,
120
132
  pricing: {
121
- cachedInput: 0.025,
122
- input: 0.1,
123
- output: 0.4,
133
+ units: [
134
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
135
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
136
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
137
+ ],
124
138
  },
125
139
  releasedAt: '2025-04-14',
126
140
  type: 'chat',
@@ -135,9 +149,11 @@ const azureChatModels: AIChatModelCard[] = [
135
149
  displayName: 'GPT 4.5 Preview',
136
150
  id: 'gpt-4.5-preview',
137
151
  pricing: {
138
- cachedInput: 37.5,
139
- input: 75,
140
- output: 150,
152
+ units: [
153
+ { name: 'textInput_cacheRead', rate: 37.5, strategy: 'fixed', unit: 'millionTokens' },
154
+ { name: 'textInput', rate: 75, strategy: 'fixed', unit: 'millionTokens' },
155
+ { name: 'textOutput', rate: 150, strategy: 'fixed', unit: 'millionTokens' },
156
+ ],
141
157
  },
142
158
  releasedAt: '2025-02-27',
143
159
  type: 'chat',
@@ -153,9 +169,11 @@ const azureChatModels: AIChatModelCard[] = [
153
169
  displayName: 'o3-mini',
154
170
  id: 'o3-mini',
155
171
  pricing: {
156
- cachedInput: 0.55,
157
- input: 1.1,
158
- output: 4.4,
172
+ units: [
173
+ { name: 'textInput_cacheRead', rate: 0.55, strategy: 'fixed', unit: 'millionTokens' },
174
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
175
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
176
+ ],
159
177
  },
160
178
  releasedAt: '2025-01-31',
161
179
  type: 'chat',
@@ -170,9 +188,11 @@ const azureChatModels: AIChatModelCard[] = [
170
188
  displayName: 'o1-mini',
171
189
  id: 'o1-mini',
172
190
  pricing: {
173
- cachedInput: 0.55,
174
- input: 1.1,
175
- output: 4.4,
191
+ units: [
192
+ { name: 'textInput_cacheRead', rate: 0.55, strategy: 'fixed', unit: 'millionTokens' },
193
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
194
+ { name: 'textOutput', rate: 4.4, strategy: 'fixed', unit: 'millionTokens' },
195
+ ],
176
196
  },
177
197
  releasedAt: '2024-09-12',
178
198
  type: 'chat',
@@ -187,9 +207,11 @@ const azureChatModels: AIChatModelCard[] = [
187
207
  displayName: 'o1',
188
208
  id: 'o1',
189
209
  pricing: {
190
- cachedInput: 7.5,
191
- input: 15,
192
- output: 60,
210
+ units: [
211
+ { name: 'textInput_cacheRead', rate: 7.5, strategy: 'fixed', unit: 'millionTokens' },
212
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
213
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
214
+ ],
193
215
  },
194
216
  releasedAt: '2024-12-17',
195
217
  type: 'chat',
@@ -206,9 +228,11 @@ const azureChatModels: AIChatModelCard[] = [
206
228
  id: 'gpt-4o',
207
229
  maxOutput: 4096,
208
230
  pricing: {
209
- cachedInput: 1.25,
210
- input: 2.5,
211
- output: 10,
231
+ units: [
232
+ { name: 'textInput_cacheRead', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
233
+ { name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
234
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
235
+ ],
212
236
  },
213
237
  releasedAt: '2024-05-13',
214
238
  type: 'chat',
@@ -224,9 +248,11 @@ const azureChatModels: AIChatModelCard[] = [
224
248
  id: 'gpt-4o-mini',
225
249
  maxOutput: 16_384,
226
250
  pricing: {
227
- cachedInput: 0.075,
228
- input: 0.15,
229
- output: 0.6,
251
+ units: [
252
+ { name: 'textInput_cacheRead', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
253
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
254
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
255
+ ],
230
256
  },
231
257
  type: 'chat',
232
258
  },
@@ -15,8 +15,10 @@ const baichuanChatModels: AIChatModelCard[] = [
15
15
  maxOutput: 4096,
16
16
  pricing: {
17
17
  currency: 'CNY',
18
- input: 100,
19
- output: 100,
18
+ units: [
19
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
20
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
21
+ ],
20
22
  },
21
23
  settings: {
22
24
  searchImpl: 'params',
@@ -37,8 +39,10 @@ const baichuanChatModels: AIChatModelCard[] = [
37
39
  maxOutput: 4096,
38
40
  pricing: {
39
41
  currency: 'CNY',
40
- input: 15,
41
- output: 15,
42
+ units: [
43
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
44
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
45
+ ],
42
46
  },
43
47
  settings: {
44
48
  searchImpl: 'params',
@@ -59,8 +63,10 @@ const baichuanChatModels: AIChatModelCard[] = [
59
63
  maxOutput: 4096,
60
64
  pricing: {
61
65
  currency: 'CNY',
62
- input: 0.98,
63
- output: 0.98,
66
+ units: [
67
+ { name: 'textInput', rate: 0.98, strategy: 'fixed', unit: 'millionTokens' },
68
+ { name: 'textOutput', rate: 0.98, strategy: 'fixed', unit: 'millionTokens' },
69
+ ],
64
70
  },
65
71
  settings: {
66
72
  searchImpl: 'params',
@@ -80,8 +86,10 @@ const baichuanChatModels: AIChatModelCard[] = [
80
86
  maxOutput: 8192,
81
87
  pricing: {
82
88
  currency: 'CNY',
83
- input: 12,
84
- output: 12,
89
+ units: [
90
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
91
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
92
+ ],
85
93
  },
86
94
  settings: {
87
95
  searchImpl: 'params',
@@ -97,8 +105,10 @@ const baichuanChatModels: AIChatModelCard[] = [
97
105
  maxOutput: 4096,
98
106
  pricing: {
99
107
  currency: 'CNY',
100
- input: 24,
101
- output: 24,
108
+ units: [
109
+ { name: 'textInput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
110
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
111
+ ],
102
112
  },
103
113
  type: 'chat',
104
114
  },
@@ -111,8 +121,10 @@ const baichuanChatModels: AIChatModelCard[] = [
111
121
  maxOutput: 8192,
112
122
  pricing: {
113
123
  currency: 'CNY',
114
- input: 8,
115
- output: 8,
124
+ units: [
125
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
126
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
127
+ ],
116
128
  },
117
129
  type: 'chat',
118
130
  },