@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
@@ -12,8 +12,10 @@ const higressChatModels: AIChatModelCard[] = [
12
12
  id: 'qwen-turbo',
13
13
  pricing: {
14
14
  currency: 'CNY',
15
- input: 0.3,
16
- output: 0.6,
15
+ units: [
16
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
17
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
18
+ ],
17
19
  },
18
20
  type: 'chat',
19
21
  },
@@ -28,8 +30,10 @@ const higressChatModels: AIChatModelCard[] = [
28
30
  id: 'qwen-plus',
29
31
  pricing: {
30
32
  currency: 'CNY',
31
- input: 0.8,
32
- output: 2,
33
+ units: [
34
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
35
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
36
+ ],
33
37
  },
34
38
  type: 'chat',
35
39
  },
@@ -45,8 +49,10 @@ const higressChatModels: AIChatModelCard[] = [
45
49
  id: 'qwen-max',
46
50
  pricing: {
47
51
  currency: 'CNY',
48
- input: 20,
49
- output: 60,
52
+ units: [
53
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
54
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
55
+ ],
50
56
  },
51
57
  type: 'chat',
52
58
  },
@@ -58,8 +64,10 @@ const higressChatModels: AIChatModelCard[] = [
58
64
  id: 'qwen-long',
59
65
  pricing: {
60
66
  currency: 'CNY',
61
- input: 0.5,
62
- output: 2,
67
+ units: [
68
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
69
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
70
+ ],
63
71
  },
64
72
  type: 'chat',
65
73
  },
@@ -75,8 +83,10 @@ const higressChatModels: AIChatModelCard[] = [
75
83
  id: 'qwen-vl-plus-latest',
76
84
  pricing: {
77
85
  currency: 'CNY',
78
- input: 8,
79
- output: 8,
86
+ units: [
87
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
88
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
89
+ ],
80
90
  },
81
91
  type: 'chat',
82
92
  },
@@ -92,8 +102,10 @@ const higressChatModels: AIChatModelCard[] = [
92
102
  id: 'qwen-vl-max-latest',
93
103
  pricing: {
94
104
  currency: 'CNY',
95
- input: 20,
96
- output: 20,
105
+ units: [
106
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
107
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
108
+ ],
97
109
  },
98
110
  type: 'chat',
99
111
  },
@@ -104,8 +116,10 @@ const higressChatModels: AIChatModelCard[] = [
104
116
  id: 'qwen-math-turbo-latest',
105
117
  pricing: {
106
118
  currency: 'CNY',
107
- input: 2,
108
- output: 6,
119
+ units: [
120
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
121
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
122
+ ],
109
123
  },
110
124
  type: 'chat',
111
125
  },
@@ -116,8 +130,10 @@ const higressChatModels: AIChatModelCard[] = [
116
130
  id: 'qwen-math-plus-latest',
117
131
  pricing: {
118
132
  currency: 'CNY',
119
- input: 4,
120
- output: 12,
133
+ units: [
134
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
135
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
136
+ ],
121
137
  },
122
138
  type: 'chat',
123
139
  },
@@ -128,8 +144,10 @@ const higressChatModels: AIChatModelCard[] = [
128
144
  id: 'qwen-coder-turbo-latest',
129
145
  pricing: {
130
146
  currency: 'CNY',
131
- input: 2,
132
- output: 6,
147
+ units: [
148
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
149
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
150
+ ],
133
151
  },
134
152
  type: 'chat',
135
153
  },
@@ -143,8 +161,10 @@ const higressChatModels: AIChatModelCard[] = [
143
161
  id: 'qwen2.5-7b-instruct',
144
162
  pricing: {
145
163
  currency: 'CNY',
146
- input: 1,
147
- output: 2,
164
+ units: [
165
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
166
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
167
+ ],
148
168
  },
149
169
  type: 'chat',
150
170
  },
@@ -158,8 +178,10 @@ const higressChatModels: AIChatModelCard[] = [
158
178
  id: 'qwen2.5-14b-instruct',
159
179
  pricing: {
160
180
  currency: 'CNY',
161
- input: 2,
162
- output: 6,
181
+ units: [
182
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
183
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
184
+ ],
163
185
  },
164
186
  type: 'chat',
165
187
  },
@@ -173,8 +195,10 @@ const higressChatModels: AIChatModelCard[] = [
173
195
  id: 'qwen2.5-32b-instruct',
174
196
  pricing: {
175
197
  currency: 'CNY',
176
- input: 3.5,
177
- output: 7,
198
+ units: [
199
+ { name: 'textInput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
200
+ { name: 'textOutput', rate: 7, strategy: 'fixed', unit: 'millionTokens' },
201
+ ],
178
202
  },
179
203
  type: 'chat',
180
204
  },
@@ -188,8 +212,10 @@ const higressChatModels: AIChatModelCard[] = [
188
212
  id: 'qwen2.5-72b-instruct',
189
213
  pricing: {
190
214
  currency: 'CNY',
191
- input: 4,
192
- output: 12,
215
+ units: [
216
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
217
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
218
+ ],
193
219
  },
194
220
  type: 'chat',
195
221
  },
@@ -200,8 +226,10 @@ const higressChatModels: AIChatModelCard[] = [
200
226
  id: 'qwen2.5-math-1.5b-instruct',
201
227
  pricing: {
202
228
  currency: 'CNY',
203
- input: 0,
204
- output: 0,
229
+ units: [
230
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
231
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
232
+ ],
205
233
  },
206
234
  type: 'chat',
207
235
  },
@@ -212,8 +240,10 @@ const higressChatModels: AIChatModelCard[] = [
212
240
  id: 'qwen2.5-math-7b-instruct',
213
241
  pricing: {
214
242
  currency: 'CNY',
215
- input: 1,
216
- output: 2,
243
+ units: [
244
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
245
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
246
+ ],
217
247
  },
218
248
  type: 'chat',
219
249
  },
@@ -224,8 +254,10 @@ const higressChatModels: AIChatModelCard[] = [
224
254
  id: 'qwen2.5-math-72b-instruct',
225
255
  pricing: {
226
256
  currency: 'CNY',
227
- input: 4,
228
- output: 12,
257
+ units: [
258
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
259
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
260
+ ],
229
261
  },
230
262
  type: 'chat',
231
263
  },
@@ -236,8 +268,10 @@ const higressChatModels: AIChatModelCard[] = [
236
268
  id: 'qwen2.5-coder-1.5b-instruct',
237
269
  pricing: {
238
270
  currency: 'CNY',
239
- input: 0,
240
- output: 0,
271
+ units: [
272
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
273
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
274
+ ],
241
275
  },
242
276
  type: 'chat',
243
277
  },
@@ -248,8 +282,10 @@ const higressChatModels: AIChatModelCard[] = [
248
282
  id: 'qwen2.5-coder-7b-instruct',
249
283
  pricing: {
250
284
  currency: 'CNY',
251
- input: 1,
252
- output: 2,
285
+ units: [
286
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
287
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
288
+ ],
253
289
  },
254
290
  type: 'chat',
255
291
  },
@@ -263,8 +299,10 @@ const higressChatModels: AIChatModelCard[] = [
263
299
  id: 'qwen-vl-v1',
264
300
  pricing: {
265
301
  currency: 'CNY',
266
- input: 0,
267
- output: 0,
302
+ units: [
303
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
304
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
305
+ ],
268
306
  },
269
307
  type: 'chat',
270
308
  },
@@ -278,8 +316,10 @@ const higressChatModels: AIChatModelCard[] = [
278
316
  id: 'qwen-vl-chat-v1',
279
317
  pricing: {
280
318
  currency: 'CNY',
281
- input: 0,
282
- output: 0,
319
+ units: [
320
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
321
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
322
+ ],
283
323
  },
284
324
  type: 'chat',
285
325
  },
@@ -332,8 +372,10 @@ const higressChatModels: AIChatModelCard[] = [
332
372
  maxOutput: 4096,
333
373
  pricing: {
334
374
  currency: 'CNY',
335
- input: 100,
336
- output: 100,
375
+ units: [
376
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
377
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
378
+ ],
337
379
  },
338
380
  type: 'chat',
339
381
  },
@@ -370,8 +412,10 @@ const higressChatModels: AIChatModelCard[] = [
370
412
  maxOutput: 8192,
371
413
  pricing: {
372
414
  currency: 'CNY',
373
- input: 12,
374
- output: 12,
415
+ units: [
416
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
417
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
418
+ ],
375
419
  },
376
420
  type: 'chat',
377
421
  },
@@ -385,8 +429,10 @@ const higressChatModels: AIChatModelCard[] = [
385
429
  maxOutput: 4096,
386
430
  pricing: {
387
431
  currency: 'CNY',
388
- input: 24,
389
- output: 24,
432
+ units: [
433
+ { name: 'textInput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
434
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
435
+ ],
390
436
  },
391
437
  type: 'chat',
392
438
  },
@@ -399,8 +445,10 @@ const higressChatModels: AIChatModelCard[] = [
399
445
  maxOutput: 8192,
400
446
  pricing: {
401
447
  currency: 'CNY',
402
- input: 8,
403
- output: 8,
448
+ units: [
449
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
450
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
451
+ ],
404
452
  },
405
453
  type: 'chat',
406
454
  },
@@ -412,8 +460,10 @@ const higressChatModels: AIChatModelCard[] = [
412
460
  id: 'yi-lightning',
413
461
  pricing: {
414
462
  currency: 'CNY',
415
- input: 0.99,
416
- output: 0.99,
463
+ units: [
464
+ { name: 'textInput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
465
+ { name: 'textOutput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
466
+ ],
417
467
  },
418
468
  type: 'chat',
419
469
  },
@@ -425,8 +475,10 @@ const higressChatModels: AIChatModelCard[] = [
425
475
  id: 'yi-spark',
426
476
  pricing: {
427
477
  currency: 'CNY',
428
- input: 1,
429
- output: 1,
478
+ units: [
479
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
480
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
481
+ ],
430
482
  },
431
483
  type: 'chat',
432
484
  },
@@ -438,8 +490,10 @@ const higressChatModels: AIChatModelCard[] = [
438
490
  id: 'yi-medium',
439
491
  pricing: {
440
492
  currency: 'CNY',
441
- input: 2.5,
442
- output: 2.5,
493
+ units: [
494
+ { name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
495
+ { name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
496
+ ],
443
497
  },
444
498
  type: 'chat',
445
499
  },
@@ -451,8 +505,10 @@ const higressChatModels: AIChatModelCard[] = [
451
505
  id: 'yi-medium-200k',
452
506
  pricing: {
453
507
  currency: 'CNY',
454
- input: 12,
455
- output: 12,
508
+ units: [
509
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
510
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
511
+ ],
456
512
  },
457
513
  type: 'chat',
458
514
  },
@@ -464,8 +520,10 @@ const higressChatModels: AIChatModelCard[] = [
464
520
  id: 'yi-large-turbo',
465
521
  pricing: {
466
522
  currency: 'CNY',
467
- input: 12,
468
- output: 12,
523
+ units: [
524
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
525
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
526
+ ],
469
527
  },
470
528
  type: 'chat',
471
529
  },
@@ -478,8 +536,10 @@ const higressChatModels: AIChatModelCard[] = [
478
536
  id: 'yi-large-rag',
479
537
  pricing: {
480
538
  currency: 'CNY',
481
- input: 25,
482
- output: 25,
539
+ units: [
540
+ { name: 'textInput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
541
+ { name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
542
+ ],
483
543
  },
484
544
  type: 'chat',
485
545
  },
@@ -495,8 +555,10 @@ const higressChatModels: AIChatModelCard[] = [
495
555
  id: 'yi-large-fc',
496
556
  pricing: {
497
557
  currency: 'CNY',
498
- input: 20,
499
- output: 20,
558
+ units: [
559
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
560
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
561
+ ],
500
562
  },
501
563
  type: 'chat',
502
564
  },
@@ -507,8 +569,10 @@ const higressChatModels: AIChatModelCard[] = [
507
569
  id: 'yi-large',
508
570
  pricing: {
509
571
  currency: 'CNY',
510
- input: 20,
511
- output: 20,
572
+ units: [
573
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
574
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
575
+ ],
512
576
  },
513
577
  type: 'chat',
514
578
  },
@@ -523,8 +587,10 @@ const higressChatModels: AIChatModelCard[] = [
523
587
  id: 'yi-vision',
524
588
  pricing: {
525
589
  currency: 'CNY',
526
- input: 6,
527
- output: 6,
590
+ units: [
591
+ { name: 'textInput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
592
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
593
+ ],
528
594
  },
529
595
  type: 'chat',
530
596
  },
@@ -535,8 +601,10 @@ const higressChatModels: AIChatModelCard[] = [
535
601
  id: 'yi-large-preview',
536
602
  pricing: {
537
603
  currency: 'CNY',
538
- input: 20,
539
- output: 20,
604
+ units: [
605
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
606
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
607
+ ],
540
608
  },
541
609
  type: 'chat',
542
610
  },
@@ -547,8 +615,10 @@ const higressChatModels: AIChatModelCard[] = [
547
615
  id: 'yi-lightning-lite',
548
616
  pricing: {
549
617
  currency: 'CNY',
550
- input: 0.99,
551
- output: 0.99,
618
+ units: [
619
+ { name: 'textInput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
620
+ { name: 'textOutput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
621
+ ],
552
622
  },
553
623
  type: 'chat',
554
624
  },
@@ -563,8 +633,10 @@ const higressChatModels: AIChatModelCard[] = [
563
633
  id: 'glm-4-flash',
564
634
  pricing: {
565
635
  currency: 'CNY',
566
- input: 0,
567
- output: 0,
636
+ units: [
637
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
638
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
639
+ ],
568
640
  },
569
641
  type: 'chat',
570
642
  },
@@ -579,8 +651,10 @@ const higressChatModels: AIChatModelCard[] = [
579
651
  id: 'glm-4-flashx',
580
652
  pricing: {
581
653
  currency: 'CNY',
582
- input: 0.1,
583
- output: 0.1,
654
+ units: [
655
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
656
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
657
+ ],
584
658
  },
585
659
  type: 'chat',
586
660
  },
@@ -594,8 +668,10 @@ const higressChatModels: AIChatModelCard[] = [
594
668
  id: 'glm-4-long',
595
669
  pricing: {
596
670
  currency: 'CNY',
597
- input: 1,
598
- output: 1,
671
+ units: [
672
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
673
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
674
+ ],
599
675
  },
600
676
  type: 'chat',
601
677
  },
@@ -610,8 +686,10 @@ const higressChatModels: AIChatModelCard[] = [
610
686
  id: 'glm-4-air',
611
687
  pricing: {
612
688
  currency: 'CNY',
613
- input: 1,
614
- output: 1,
689
+ units: [
690
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
691
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
692
+ ],
615
693
  },
616
694
  type: 'chat',
617
695
  },
@@ -626,8 +704,10 @@ const higressChatModels: AIChatModelCard[] = [
626
704
  id: 'glm-4-airx',
627
705
  pricing: {
628
706
  currency: 'CNY',
629
- input: 10,
630
- output: 10,
707
+ units: [
708
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
709
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
710
+ ],
631
711
  },
632
712
  type: 'chat',
633
713
  },
@@ -642,8 +722,10 @@ const higressChatModels: AIChatModelCard[] = [
642
722
  id: 'glm-4-alltools',
643
723
  pricing: {
644
724
  currency: 'CNY',
645
- input: 100,
646
- output: 100,
725
+ units: [
726
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
727
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
728
+ ],
647
729
  },
648
730
  type: 'chat',
649
731
  },
@@ -658,8 +740,10 @@ const higressChatModels: AIChatModelCard[] = [
658
740
  id: 'glm-4-plus',
659
741
  pricing: {
660
742
  currency: 'CNY',
661
- input: 50,
662
- output: 50,
743
+ units: [
744
+ { name: 'textInput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
745
+ { name: 'textOutput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
746
+ ],
663
747
  },
664
748
  type: 'chat',
665
749
  },
@@ -673,8 +757,10 @@ const higressChatModels: AIChatModelCard[] = [
673
757
  id: 'glm-4-0520',
674
758
  pricing: {
675
759
  currency: 'CNY',
676
- input: 100,
677
- output: 100,
760
+ units: [
761
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
762
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
763
+ ],
678
764
  },
679
765
  type: 'chat',
680
766
  },
@@ -688,8 +774,10 @@ const higressChatModels: AIChatModelCard[] = [
688
774
  id: 'glm-4',
689
775
  pricing: {
690
776
  currency: 'CNY',
691
- input: 100,
692
- output: 100,
777
+ units: [
778
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
779
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
780
+ ],
693
781
  },
694
782
  type: 'chat',
695
783
  },
@@ -704,8 +792,10 @@ const higressChatModels: AIChatModelCard[] = [
704
792
  id: 'glm-4v-plus',
705
793
  pricing: {
706
794
  currency: 'CNY',
707
- input: 10,
708
- output: 10,
795
+ units: [
796
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
797
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
798
+ ],
709
799
  },
710
800
  type: 'chat',
711
801
  },
@@ -719,8 +809,10 @@ const higressChatModels: AIChatModelCard[] = [
719
809
  id: 'glm-4v',
720
810
  pricing: {
721
811
  currency: 'CNY',
722
- input: 50,
723
- output: 50,
812
+ units: [
813
+ { name: 'textInput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
814
+ { name: 'textOutput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
815
+ ],
724
816
  },
725
817
  type: 'chat',
726
818
  },
@@ -731,8 +823,10 @@ const higressChatModels: AIChatModelCard[] = [
731
823
  id: 'charglm-3',
732
824
  pricing: {
733
825
  currency: 'CNY',
734
- input: 15,
735
- output: 15,
826
+ units: [
827
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
828
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
829
+ ],
736
830
  },
737
831
  type: 'chat',
738
832
  },
@@ -743,8 +837,10 @@ const higressChatModels: AIChatModelCard[] = [
743
837
  id: 'emohaa',
744
838
  pricing: {
745
839
  currency: 'CNY',
746
- input: 15,
747
- output: 15,
840
+ units: [
841
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
842
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
843
+ ],
748
844
  },
749
845
  type: 'chat',
750
846
  },
@@ -758,8 +854,10 @@ const higressChatModels: AIChatModelCard[] = [
758
854
  maxOutput: 7000,
759
855
  pricing: {
760
856
  currency: 'CNY',
761
- input: 5,
762
- output: 5,
857
+ units: [
858
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
859
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
860
+ ],
763
861
  },
764
862
  type: 'chat',
765
863
  },
@@ -776,8 +874,10 @@ const higressChatModels: AIChatModelCard[] = [
776
874
  maxOutput: 7000,
777
875
  pricing: {
778
876
  currency: 'CNY',
779
- input: 5,
780
- output: 5,
877
+ units: [
878
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
879
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
880
+ ],
781
881
  },
782
882
  type: 'chat',
783
883
  },
@@ -791,8 +891,10 @@ const higressChatModels: AIChatModelCard[] = [
791
891
  maxOutput: 7000,
792
892
  pricing: {
793
893
  currency: 'CNY',
794
- input: 2,
795
- output: 2,
894
+ units: [
895
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
896
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
897
+ ],
796
898
  },
797
899
  type: 'chat',
798
900
  },
@@ -806,8 +908,10 @@ const higressChatModels: AIChatModelCard[] = [
806
908
  maxOutput: 2048,
807
909
  pricing: {
808
910
  currency: 'CNY',
809
- input: 2,
810
- output: 2,
911
+ units: [
912
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
913
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
914
+ ],
811
915
  },
812
916
  type: 'chat',
813
917
  },
@@ -820,8 +924,10 @@ const higressChatModels: AIChatModelCard[] = [
820
924
  id: 'ERNIE-3.5-8K',
821
925
  pricing: {
822
926
  currency: 'CNY',
823
- input: 0.8,
824
- output: 2,
927
+ units: [
928
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
929
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
930
+ ],
825
931
  },
826
932
  type: 'chat',
827
933
  },
@@ -833,8 +939,10 @@ const higressChatModels: AIChatModelCard[] = [
833
939
  id: 'ERNIE-3.5-8K-Preview',
834
940
  pricing: {
835
941
  currency: 'CNY',
836
- input: 0.8,
837
- output: 2,
942
+ units: [
943
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
944
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
945
+ ],
838
946
  },
839
947
  type: 'chat',
840
948
  },
@@ -847,8 +955,10 @@ const higressChatModels: AIChatModelCard[] = [
847
955
  id: 'ERNIE-3.5-128K',
848
956
  pricing: {
849
957
  currency: 'CNY',
850
- input: 0.8,
851
- output: 2,
958
+ units: [
959
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
960
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
961
+ ],
852
962
  },
853
963
  type: 'chat',
854
964
  },
@@ -861,8 +971,10 @@ const higressChatModels: AIChatModelCard[] = [
861
971
  id: 'ERNIE-4.0-8K-Latest',
862
972
  pricing: {
863
973
  currency: 'CNY',
864
- input: 30,
865
- output: 90,
974
+ units: [
975
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
976
+ { name: 'textOutput', rate: 90, strategy: 'fixed', unit: 'millionTokens' },
977
+ ],
866
978
  },
867
979
  type: 'chat',
868
980
  },
@@ -874,8 +986,10 @@ const higressChatModels: AIChatModelCard[] = [
874
986
  id: 'ERNIE-4.0-8K-Preview',
875
987
  pricing: {
876
988
  currency: 'CNY',
877
- input: 30,
878
- output: 90,
989
+ units: [
990
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
991
+ { name: 'textOutput', rate: 90, strategy: 'fixed', unit: 'millionTokens' },
992
+ ],
879
993
  },
880
994
  type: 'chat',
881
995
  },
@@ -888,8 +1002,10 @@ const higressChatModels: AIChatModelCard[] = [
888
1002
  id: 'ERNIE-4.0-Turbo-8K-Latest',
889
1003
  pricing: {
890
1004
  currency: 'CNY',
891
- input: 20,
892
- output: 60,
1005
+ units: [
1006
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
1007
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1008
+ ],
893
1009
  },
894
1010
  type: 'chat',
895
1011
  },
@@ -901,8 +1017,10 @@ const higressChatModels: AIChatModelCard[] = [
901
1017
  id: 'ERNIE-4.0-Turbo-8K-Preview',
902
1018
  pricing: {
903
1019
  currency: 'CNY',
904
- input: 20,
905
- output: 60,
1020
+ units: [
1021
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
1022
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1023
+ ],
906
1024
  },
907
1025
  type: 'chat',
908
1026
  },
@@ -915,8 +1033,10 @@ const higressChatModels: AIChatModelCard[] = [
915
1033
  id: 'ERNIE-Lite-Pro-128K',
916
1034
  pricing: {
917
1035
  currency: 'CNY',
918
- input: 0.2,
919
- output: 0.4,
1036
+ units: [
1037
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
1038
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
1039
+ ],
920
1040
  },
921
1041
  type: 'chat',
922
1042
  },
@@ -929,8 +1049,10 @@ const higressChatModels: AIChatModelCard[] = [
929
1049
  id: 'ERNIE-Speed-Pro-128K',
930
1050
  pricing: {
931
1051
  currency: 'CNY',
932
- input: 0.3,
933
- output: 0.6,
1052
+ units: [
1053
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
1054
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
1055
+ ],
934
1056
  },
935
1057
  type: 'chat',
936
1058
  },
@@ -942,8 +1064,10 @@ const higressChatModels: AIChatModelCard[] = [
942
1064
  id: 'ERNIE-Speed-128K',
943
1065
  pricing: {
944
1066
  currency: 'CNY',
945
- input: 0,
946
- output: 0,
1067
+ units: [
1068
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
1069
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
1070
+ ],
947
1071
  },
948
1072
  type: 'chat',
949
1073
  },
@@ -955,8 +1079,10 @@ const higressChatModels: AIChatModelCard[] = [
955
1079
  id: 'ERNIE-Character-8K',
956
1080
  pricing: {
957
1081
  currency: 'CNY',
958
- input: 4,
959
- output: 8,
1082
+ units: [
1083
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
1084
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
1085
+ ],
960
1086
  },
961
1087
  type: 'chat',
962
1088
  },
@@ -970,8 +1096,10 @@ const higressChatModels: AIChatModelCard[] = [
970
1096
  maxOutput: 6000,
971
1097
  pricing: {
972
1098
  currency: 'CNY',
973
- input: 0,
974
- output: 0,
1099
+ units: [
1100
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
1101
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
1102
+ ],
975
1103
  },
976
1104
  type: 'chat',
977
1105
  },
@@ -985,8 +1113,10 @@ const higressChatModels: AIChatModelCard[] = [
985
1113
  maxOutput: 2000,
986
1114
  pricing: {
987
1115
  currency: 'CNY',
988
- input: 4.5,
989
- output: 5,
1116
+ units: [
1117
+ { name: 'textInput', rate: 4.5, strategy: 'fixed', unit: 'millionTokens' },
1118
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
1119
+ ],
990
1120
  },
991
1121
  type: 'chat',
992
1122
  },
@@ -1000,8 +1130,10 @@ const higressChatModels: AIChatModelCard[] = [
1000
1130
  maxOutput: 6000,
1001
1131
  pricing: {
1002
1132
  currency: 'CNY',
1003
- input: 15,
1004
- output: 60,
1133
+ units: [
1134
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1135
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1136
+ ],
1005
1137
  },
1006
1138
  type: 'chat',
1007
1139
  },
@@ -1018,8 +1150,10 @@ const higressChatModels: AIChatModelCard[] = [
1018
1150
  maxOutput: 4000,
1019
1151
  pricing: {
1020
1152
  currency: 'CNY',
1021
- input: 15,
1022
- output: 50,
1153
+ units: [
1154
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1155
+ { name: 'textOutput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
1156
+ ],
1023
1157
  },
1024
1158
  type: 'chat',
1025
1159
  },
@@ -1036,8 +1170,10 @@ const higressChatModels: AIChatModelCard[] = [
1036
1170
  maxOutput: 4000,
1037
1171
  pricing: {
1038
1172
  currency: 'CNY',
1039
- input: 30,
1040
- output: 100,
1173
+ units: [
1174
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1175
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
1176
+ ],
1041
1177
  },
1042
1178
  type: 'chat',
1043
1179
  },
@@ -1063,8 +1199,10 @@ const higressChatModels: AIChatModelCard[] = [
1063
1199
  maxOutput: 4000,
1064
1200
  pricing: {
1065
1201
  currency: 'CNY',
1066
- input: 18,
1067
- output: 18,
1202
+ units: [
1203
+ { name: 'textInput', rate: 18, strategy: 'fixed', unit: 'millionTokens' },
1204
+ { name: 'textOutput', rate: 18, strategy: 'fixed', unit: 'millionTokens' },
1205
+ ],
1068
1206
  },
1069
1207
  type: 'chat',
1070
1208
  },
@@ -1077,8 +1215,10 @@ const higressChatModels: AIChatModelCard[] = [
1077
1215
  maxOutput: 4000,
1078
1216
  pricing: {
1079
1217
  currency: 'CNY',
1080
- input: 4,
1081
- output: 8,
1218
+ units: [
1219
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
1220
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
1221
+ ],
1082
1222
  },
1083
1223
  type: 'chat',
1084
1224
  },
@@ -1094,8 +1234,10 @@ const higressChatModels: AIChatModelCard[] = [
1094
1234
  maxOutput: 4000,
1095
1235
  pricing: {
1096
1236
  currency: 'CNY',
1097
- input: 4,
1098
- output: 8,
1237
+ units: [
1238
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
1239
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
1240
+ ],
1099
1241
  },
1100
1242
  type: 'chat',
1101
1243
  },
@@ -1108,8 +1250,10 @@ const higressChatModels: AIChatModelCard[] = [
1108
1250
  maxOutput: 4000,
1109
1251
  pricing: {
1110
1252
  currency: 'CNY',
1111
- input: 4,
1112
- output: 8,
1253
+ units: [
1254
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
1255
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
1256
+ ],
1113
1257
  },
1114
1258
  type: 'chat',
1115
1259
  },
@@ -1124,8 +1268,10 @@ const higressChatModels: AIChatModelCard[] = [
1124
1268
  id: 'step-1-flash',
1125
1269
  pricing: {
1126
1270
  currency: 'CNY',
1127
- input: 1,
1128
- output: 4,
1271
+ units: [
1272
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
1273
+ { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
1274
+ ],
1129
1275
  },
1130
1276
  type: 'chat',
1131
1277
  },
@@ -1140,8 +1286,10 @@ const higressChatModels: AIChatModelCard[] = [
1140
1286
  id: 'step-1-8k',
1141
1287
  pricing: {
1142
1288
  currency: 'CNY',
1143
- input: 5,
1144
- output: 20,
1289
+ units: [
1290
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
1291
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
1292
+ ],
1145
1293
  },
1146
1294
  type: 'chat',
1147
1295
  },
@@ -1156,8 +1304,10 @@ const higressChatModels: AIChatModelCard[] = [
1156
1304
  id: 'step-1-32k',
1157
1305
  pricing: {
1158
1306
  currency: 'CNY',
1159
- input: 15,
1160
- output: 70,
1307
+ units: [
1308
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1309
+ { name: 'textOutput', rate: 70, strategy: 'fixed', unit: 'millionTokens' },
1310
+ ],
1161
1311
  },
1162
1312
  type: 'chat',
1163
1313
  },
@@ -1172,8 +1322,10 @@ const higressChatModels: AIChatModelCard[] = [
1172
1322
  id: 'step-1-128k',
1173
1323
  pricing: {
1174
1324
  currency: 'CNY',
1175
- input: 40,
1176
- output: 200,
1325
+ units: [
1326
+ { name: 'textInput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
1327
+ { name: 'textOutput', rate: 200, strategy: 'fixed', unit: 'millionTokens' },
1328
+ ],
1177
1329
  },
1178
1330
  type: 'chat',
1179
1331
  },
@@ -1187,8 +1339,10 @@ const higressChatModels: AIChatModelCard[] = [
1187
1339
  id: 'step-1-256k',
1188
1340
  pricing: {
1189
1341
  currency: 'CNY',
1190
- input: 95,
1191
- output: 300,
1342
+ units: [
1343
+ { name: 'textInput', rate: 95, strategy: 'fixed', unit: 'millionTokens' },
1344
+ { name: 'textOutput', rate: 300, strategy: 'fixed', unit: 'millionTokens' },
1345
+ ],
1192
1346
  },
1193
1347
  type: 'chat',
1194
1348
  },
@@ -1203,8 +1357,10 @@ const higressChatModels: AIChatModelCard[] = [
1203
1357
  id: 'step-2-16k',
1204
1358
  pricing: {
1205
1359
  currency: 'CNY',
1206
- input: 38,
1207
- output: 120,
1360
+ units: [
1361
+ { name: 'textInput', rate: 38, strategy: 'fixed', unit: 'millionTokens' },
1362
+ { name: 'textOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
1363
+ ],
1208
1364
  },
1209
1365
  type: 'chat',
1210
1366
  },
@@ -1220,8 +1376,10 @@ const higressChatModels: AIChatModelCard[] = [
1220
1376
  id: 'step-1v-8k',
1221
1377
  pricing: {
1222
1378
  currency: 'CNY',
1223
- input: 5,
1224
- output: 20,
1379
+ units: [
1380
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
1381
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
1382
+ ],
1225
1383
  },
1226
1384
  type: 'chat',
1227
1385
  },
@@ -1237,8 +1395,10 @@ const higressChatModels: AIChatModelCard[] = [
1237
1395
  id: 'step-1v-32k',
1238
1396
  pricing: {
1239
1397
  currency: 'CNY',
1240
- input: 15,
1241
- output: 70,
1398
+ units: [
1399
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1400
+ { name: 'textOutput', rate: 70, strategy: 'fixed', unit: 'millionTokens' },
1401
+ ],
1242
1402
  },
1243
1403
  type: 'chat',
1244
1404
  },
@@ -1253,8 +1413,10 @@ const higressChatModels: AIChatModelCard[] = [
1253
1413
  id: 'step-1.5v-mini',
1254
1414
  pricing: {
1255
1415
  currency: 'CNY',
1256
- input: 8,
1257
- output: 35,
1416
+ units: [
1417
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
1418
+ { name: 'textOutput', rate: 35, strategy: 'fixed', unit: 'millionTokens' },
1419
+ ],
1258
1420
  },
1259
1421
  type: 'chat',
1260
1422
  },
@@ -1327,8 +1489,10 @@ const higressChatModels: AIChatModelCard[] = [
1327
1489
  id: 'o1-mini',
1328
1490
  maxOutput: 65_536,
1329
1491
  pricing: {
1330
- input: 3,
1331
- output: 12,
1492
+ units: [
1493
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
1494
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
1495
+ ],
1332
1496
  },
1333
1497
  releasedAt: '2024-09-12',
1334
1498
  type: 'chat',
@@ -1342,8 +1506,10 @@ const higressChatModels: AIChatModelCard[] = [
1342
1506
  id: 'o1-preview',
1343
1507
  maxOutput: 32_768,
1344
1508
  pricing: {
1345
- input: 15,
1346
- output: 60,
1509
+ units: [
1510
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1511
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1512
+ ],
1347
1513
  },
1348
1514
  releasedAt: '2024-09-12',
1349
1515
  type: 'chat',
@@ -1361,8 +1527,10 @@ const higressChatModels: AIChatModelCard[] = [
1361
1527
  id: 'gpt-4o-mini',
1362
1528
  maxOutput: 16_385,
1363
1529
  pricing: {
1364
- input: 0.15,
1365
- output: 0.6,
1530
+ units: [
1531
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
1532
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
1533
+ ],
1366
1534
  },
1367
1535
  type: 'chat',
1368
1536
  },
@@ -1378,8 +1546,10 @@ const higressChatModels: AIChatModelCard[] = [
1378
1546
  enabled: true,
1379
1547
  id: 'gpt-4o',
1380
1548
  pricing: {
1381
- input: 2.5,
1382
- output: 10,
1549
+ units: [
1550
+ { name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
1551
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1552
+ ],
1383
1553
  },
1384
1554
  type: 'chat',
1385
1555
  },
@@ -1394,8 +1564,10 @@ const higressChatModels: AIChatModelCard[] = [
1394
1564
  displayName: 'GPT-4o 0806',
1395
1565
  id: 'gpt-4o-2024-08-06',
1396
1566
  pricing: {
1397
- input: 2.5,
1398
- output: 10,
1567
+ units: [
1568
+ { name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
1569
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1570
+ ],
1399
1571
  },
1400
1572
  type: 'chat',
1401
1573
  },
@@ -1410,8 +1582,10 @@ const higressChatModels: AIChatModelCard[] = [
1410
1582
  displayName: 'GPT-4o 0513',
1411
1583
  id: 'gpt-4o-2024-05-13',
1412
1584
  pricing: {
1413
- input: 5,
1414
- output: 15,
1585
+ units: [
1586
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
1587
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1588
+ ],
1415
1589
  },
1416
1590
  type: 'chat',
1417
1591
  },
@@ -1426,8 +1600,10 @@ const higressChatModels: AIChatModelCard[] = [
1426
1600
  enabled: true,
1427
1601
  id: 'chatgpt-4o-latest',
1428
1602
  pricing: {
1429
- input: 5,
1430
- output: 15,
1603
+ units: [
1604
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
1605
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
1606
+ ],
1431
1607
  },
1432
1608
  type: 'chat',
1433
1609
  },
@@ -1442,8 +1618,10 @@ const higressChatModels: AIChatModelCard[] = [
1442
1618
  displayName: 'GPT-4 Turbo',
1443
1619
  id: 'gpt-4-turbo',
1444
1620
  pricing: {
1445
- input: 10,
1446
- output: 30,
1621
+ units: [
1622
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1623
+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1624
+ ],
1447
1625
  },
1448
1626
  type: 'chat',
1449
1627
  },
@@ -1458,8 +1636,10 @@ const higressChatModels: AIChatModelCard[] = [
1458
1636
  displayName: 'GPT-4 Turbo Vision 0409',
1459
1637
  id: 'gpt-4-turbo-2024-04-09',
1460
1638
  pricing: {
1461
- input: 10,
1462
- output: 30,
1639
+ units: [
1640
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1641
+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1642
+ ],
1463
1643
  },
1464
1644
  type: 'chat',
1465
1645
  },
@@ -1473,8 +1653,10 @@ const higressChatModels: AIChatModelCard[] = [
1473
1653
  displayName: 'GPT-4 Turbo Preview',
1474
1654
  id: 'gpt-4-turbo-preview',
1475
1655
  pricing: {
1476
- input: 10,
1477
- output: 30,
1656
+ units: [
1657
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1658
+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1659
+ ],
1478
1660
  },
1479
1661
  type: 'chat',
1480
1662
  },
@@ -1488,8 +1670,10 @@ const higressChatModels: AIChatModelCard[] = [
1488
1670
  displayName: 'GPT-4 Turbo Preview 0125',
1489
1671
  id: 'gpt-4-0125-preview',
1490
1672
  pricing: {
1491
- input: 10,
1492
- output: 30,
1673
+ units: [
1674
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1675
+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1676
+ ],
1493
1677
  },
1494
1678
  type: 'chat',
1495
1679
  },
@@ -1503,8 +1687,10 @@ const higressChatModels: AIChatModelCard[] = [
1503
1687
  displayName: 'GPT-4 Turbo Preview 1106',
1504
1688
  id: 'gpt-4-1106-preview',
1505
1689
  pricing: {
1506
- input: 10,
1507
- output: 30,
1690
+ units: [
1691
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1692
+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1693
+ ],
1508
1694
  },
1509
1695
  type: 'chat',
1510
1696
  },
@@ -1518,8 +1704,10 @@ const higressChatModels: AIChatModelCard[] = [
1518
1704
  displayName: 'GPT-4',
1519
1705
  id: 'gpt-4',
1520
1706
  pricing: {
1521
- input: 30,
1522
- output: 60,
1707
+ units: [
1708
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1709
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1710
+ ],
1523
1711
  },
1524
1712
  type: 'chat',
1525
1713
  },
@@ -1533,8 +1721,10 @@ const higressChatModels: AIChatModelCard[] = [
1533
1721
  displayName: 'GPT-4 0613',
1534
1722
  id: 'gpt-4-0613',
1535
1723
  pricing: {
1536
- input: 30,
1537
- output: 60,
1724
+ units: [
1725
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
1726
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1727
+ ],
1538
1728
  },
1539
1729
  type: 'chat',
1540
1730
  },
@@ -1548,8 +1738,10 @@ const higressChatModels: AIChatModelCard[] = [
1548
1738
  displayName: 'GPT-4 32K',
1549
1739
  id: 'gpt-4-32k',
1550
1740
  pricing: {
1551
- input: 60,
1552
- output: 120,
1741
+ units: [
1742
+ { name: 'textInput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1743
+ { name: 'textOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
1744
+ ],
1553
1745
  },
1554
1746
  type: 'chat',
1555
1747
  },
@@ -1563,8 +1755,10 @@ const higressChatModels: AIChatModelCard[] = [
1563
1755
  displayName: 'GPT-4 32K 0613',
1564
1756
  id: 'gpt-4-32k-0613',
1565
1757
  pricing: {
1566
- input: 60,
1567
- output: 120,
1758
+ units: [
1759
+ { name: 'textInput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
1760
+ { name: 'textOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
1761
+ ],
1568
1762
  },
1569
1763
  type: 'chat',
1570
1764
  },
@@ -1578,8 +1772,10 @@ const higressChatModels: AIChatModelCard[] = [
1578
1772
  displayName: 'GPT-3.5 Turbo',
1579
1773
  id: 'gpt-3.5-turbo',
1580
1774
  pricing: {
1581
- input: 0.5,
1582
- output: 1.5,
1775
+ units: [
1776
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
1777
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
1778
+ ],
1583
1779
  },
1584
1780
  type: 'chat',
1585
1781
  },
@@ -1593,8 +1789,10 @@ const higressChatModels: AIChatModelCard[] = [
1593
1789
  displayName: 'GPT-3.5 Turbo 0125',
1594
1790
  id: 'gpt-3.5-turbo-0125',
1595
1791
  pricing: {
1596
- input: 0.5,
1597
- output: 1.5,
1792
+ units: [
1793
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
1794
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
1795
+ ],
1598
1796
  },
1599
1797
  type: 'chat',
1600
1798
  },
@@ -1608,8 +1806,10 @@ const higressChatModels: AIChatModelCard[] = [
1608
1806
  displayName: 'GPT-3.5 Turbo 1106',
1609
1807
  id: 'gpt-3.5-turbo-1106',
1610
1808
  pricing: {
1611
- input: 1,
1612
- output: 2,
1809
+ units: [
1810
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
1811
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
1812
+ ],
1613
1813
  },
1614
1814
  type: 'chat',
1615
1815
  },
@@ -1620,8 +1820,10 @@ const higressChatModels: AIChatModelCard[] = [
1620
1820
  displayName: 'GPT-3.5 Turbo Instruct',
1621
1821
  id: 'gpt-3.5-turbo-instruct',
1622
1822
  pricing: {
1623
- input: 1.5,
1624
- output: 2,
1823
+ units: [
1824
+ { name: 'textInput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
1825
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
1826
+ ],
1625
1827
  },
1626
1828
  type: 'chat',
1627
1829
  },
@@ -1957,8 +2159,10 @@ const higressChatModels: AIChatModelCard[] = [
1957
2159
  id: 'llama-3.2-11b-vision-preview',
1958
2160
  maxOutput: 8192,
1959
2161
  pricing: {
1960
- input: 0.05,
1961
- output: 0.08,
2162
+ units: [
2163
+ { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
2164
+ { name: 'textOutput', rate: 0.08, strategy: 'fixed', unit: 'millionTokens' },
2165
+ ],
1962
2166
  },
1963
2167
  type: 'chat',
1964
2168
  },
@@ -1974,8 +2178,10 @@ const higressChatModels: AIChatModelCard[] = [
1974
2178
  id: 'llama-3.2-90b-vision-preview',
1975
2179
  maxOutput: 8192,
1976
2180
  pricing: {
1977
- input: 0.59,
1978
- output: 0.79,
2181
+ units: [
2182
+ { name: 'textInput', rate: 0.59, strategy: 'fixed', unit: 'millionTokens' },
2183
+ { name: 'textOutput', rate: 0.79, strategy: 'fixed', unit: 'millionTokens' },
2184
+ ],
1979
2185
  },
1980
2186
  type: 'chat',
1981
2187
  },
@@ -1991,8 +2197,10 @@ const higressChatModels: AIChatModelCard[] = [
1991
2197
  id: 'llama-3.1-8b-instant',
1992
2198
  maxOutput: 8192,
1993
2199
  pricing: {
1994
- input: 0.05,
1995
- output: 0.08,
2200
+ units: [
2201
+ { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
2202
+ { name: 'textOutput', rate: 0.08, strategy: 'fixed', unit: 'millionTokens' },
2203
+ ],
1996
2204
  },
1997
2205
  type: 'chat',
1998
2206
  },
@@ -2008,8 +2216,10 @@ const higressChatModels: AIChatModelCard[] = [
2008
2216
  id: 'llama-3.1-70b-versatile',
2009
2217
  maxOutput: 8192,
2010
2218
  pricing: {
2011
- input: 0.59,
2012
- output: 0.79,
2219
+ units: [
2220
+ { name: 'textInput', rate: 0.59, strategy: 'fixed', unit: 'millionTokens' },
2221
+ { name: 'textOutput', rate: 0.79, strategy: 'fixed', unit: 'millionTokens' },
2222
+ ],
2013
2223
  },
2014
2224
  type: 'chat',
2015
2225
  },
@@ -2022,8 +2232,10 @@ const higressChatModels: AIChatModelCard[] = [
2022
2232
  displayName: 'Llama 3 Groq 8B Tool Use (Preview)',
2023
2233
  id: 'llama3-groq-8b-8192-tool-use-preview',
2024
2234
  pricing: {
2025
- input: 0.19,
2026
- output: 0.19,
2235
+ units: [
2236
+ { name: 'textInput', rate: 0.19, strategy: 'fixed', unit: 'millionTokens' },
2237
+ { name: 'textOutput', rate: 0.19, strategy: 'fixed', unit: 'millionTokens' },
2238
+ ],
2027
2239
  },
2028
2240
  type: 'chat',
2029
2241
  },
@@ -2036,8 +2248,10 @@ const higressChatModels: AIChatModelCard[] = [
2036
2248
  displayName: 'Llama 3 Groq 70B Tool Use (Preview)',
2037
2249
  id: 'llama3-groq-70b-8192-tool-use-preview',
2038
2250
  pricing: {
2039
- input: 0.89,
2040
- output: 0.89,
2251
+ units: [
2252
+ { name: 'textInput', rate: 0.89, strategy: 'fixed', unit: 'millionTokens' },
2253
+ { name: 'textOutput', rate: 0.89, strategy: 'fixed', unit: 'millionTokens' },
2254
+ ],
2041
2255
  },
2042
2256
  type: 'chat',
2043
2257
  },
@@ -2050,8 +2264,10 @@ const higressChatModels: AIChatModelCard[] = [
2050
2264
  displayName: 'Meta Llama 3 8B',
2051
2265
  id: 'llama3-8b-8192',
2052
2266
  pricing: {
2053
- input: 0.05,
2054
- output: 0.08,
2267
+ units: [
2268
+ { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
2269
+ { name: 'textOutput', rate: 0.08, strategy: 'fixed', unit: 'millionTokens' },
2270
+ ],
2055
2271
  },
2056
2272
  type: 'chat',
2057
2273
  },
@@ -2064,8 +2280,10 @@ const higressChatModels: AIChatModelCard[] = [
2064
2280
  displayName: 'Meta Llama 3 70B',
2065
2281
  id: 'llama3-70b-8192',
2066
2282
  pricing: {
2067
- input: 0.59,
2068
- output: 0.79,
2283
+ units: [
2284
+ { name: 'textInput', rate: 0.59, strategy: 'fixed', unit: 'millionTokens' },
2285
+ { name: 'textOutput', rate: 0.79, strategy: 'fixed', unit: 'millionTokens' },
2286
+ ],
2069
2287
  },
2070
2288
  type: 'chat',
2071
2289
  },
@@ -2079,8 +2297,10 @@ const higressChatModels: AIChatModelCard[] = [
2079
2297
  enabled: true,
2080
2298
  id: 'gemma2-9b-it',
2081
2299
  pricing: {
2082
- input: 0.2,
2083
- output: 0.2,
2300
+ units: [
2301
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
2302
+ { name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
2303
+ ],
2084
2304
  },
2085
2305
  type: 'chat',
2086
2306
  },
@@ -2093,8 +2313,10 @@ const higressChatModels: AIChatModelCard[] = [
2093
2313
  displayName: 'Gemma 7B',
2094
2314
  id: 'gemma-7b-it',
2095
2315
  pricing: {
2096
- input: 0.07,
2097
- output: 0.07,
2316
+ units: [
2317
+ { name: 'textInput', rate: 0.07, strategy: 'fixed', unit: 'millionTokens' },
2318
+ { name: 'textOutput', rate: 0.07, strategy: 'fixed', unit: 'millionTokens' },
2319
+ ],
2098
2320
  },
2099
2321
  type: 'chat',
2100
2322
  },
@@ -2107,8 +2329,10 @@ const higressChatModels: AIChatModelCard[] = [
2107
2329
  displayName: 'Mixtral 8x7B',
2108
2330
  id: 'mixtral-8x7b-32768',
2109
2331
  pricing: {
2110
- input: 0.24,
2111
- output: 0.24,
2332
+ units: [
2333
+ { name: 'textInput', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
2334
+ { name: 'textOutput', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
2335
+ ],
2112
2336
  },
2113
2337
  type: 'chat',
2114
2338
  },
@@ -2133,9 +2357,11 @@ const higressChatModels: AIChatModelCard[] = [
2133
2357
  enabled: true,
2134
2358
  id: 'deepseek-chat',
2135
2359
  pricing: {
2136
- cachedInput: 0.014,
2137
- input: 0.14,
2138
- output: 0.28,
2360
+ units: [
2361
+ { name: 'textInput_cacheRead', rate: 0.014, strategy: 'fixed', unit: 'millionTokens' },
2362
+ { name: 'textInput', rate: 0.14, strategy: 'fixed', unit: 'millionTokens' },
2363
+ { name: 'textOutput', rate: 0.28, strategy: 'fixed', unit: 'millionTokens' },
2364
+ ],
2139
2365
  },
2140
2366
  releasedAt: '2024-09-05',
2141
2367
  type: 'chat',
@@ -2152,10 +2378,17 @@ const higressChatModels: AIChatModelCard[] = [
2152
2378
  id: 'claude-3-5-haiku-20241022',
2153
2379
  maxOutput: 8192,
2154
2380
  pricing: {
2155
- cachedInput: 0.1,
2156
- input: 1,
2157
- output: 5,
2158
- writeCacheInput: 1.25,
2381
+ units: [
2382
+ { name: 'textInput_cacheRead', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
2383
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
2384
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
2385
+ {
2386
+ lookup: { prices: { '5m': 1.25 }, pricingParams: ['ttl'] },
2387
+ name: 'textInput_cacheWrite',
2388
+ strategy: 'lookup',
2389
+ unit: 'millionTokens',
2390
+ },
2391
+ ],
2159
2392
  },
2160
2393
  releasedAt: '2024-11-05',
2161
2394
  type: 'chat',
@@ -2173,10 +2406,17 @@ const higressChatModels: AIChatModelCard[] = [
2173
2406
  id: 'claude-3-5-sonnet-20241022',
2174
2407
  maxOutput: 8192,
2175
2408
  pricing: {
2176
- cachedInput: 0.3,
2177
- input: 3,
2178
- output: 15,
2179
- writeCacheInput: 3.75,
2409
+ units: [
2410
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2411
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
2412
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
2413
+ {
2414
+ lookup: { prices: { '5m': 3.75 }, pricingParams: ['ttl'] },
2415
+ name: 'textInput_cacheWrite',
2416
+ strategy: 'lookup',
2417
+ unit: 'millionTokens',
2418
+ },
2419
+ ],
2180
2420
  },
2181
2421
  releasedAt: '2024-10-22',
2182
2422
  type: 'chat',
@@ -2193,10 +2433,17 @@ const higressChatModels: AIChatModelCard[] = [
2193
2433
  id: 'claude-3-5-sonnet-20240620',
2194
2434
  maxOutput: 8192,
2195
2435
  pricing: {
2196
- cachedInput: 0.3,
2197
- input: 3,
2198
- output: 15,
2199
- writeCacheInput: 3.75,
2436
+ units: [
2437
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2438
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
2439
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
2440
+ {
2441
+ lookup: { prices: { '5m': 3.75 }, pricingParams: ['ttl'] },
2442
+ name: 'textInput_cacheWrite',
2443
+ strategy: 'lookup',
2444
+ unit: 'millionTokens',
2445
+ },
2446
+ ],
2200
2447
  },
2201
2448
  releasedAt: '2024-06-20',
2202
2449
  type: 'chat',
@@ -2213,8 +2460,10 @@ const higressChatModels: AIChatModelCard[] = [
2213
2460
  id: 'claude-3-haiku-20240307',
2214
2461
  maxOutput: 4096,
2215
2462
  pricing: {
2216
- input: 0.25,
2217
- output: 1.25,
2463
+ units: [
2464
+ { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
2465
+ { name: 'textOutput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
2466
+ ],
2218
2467
  },
2219
2468
  releasedAt: '2024-03-07',
2220
2469
  type: 'chat',
@@ -2231,8 +2480,10 @@ const higressChatModels: AIChatModelCard[] = [
2231
2480
  id: 'claude-3-sonnet-20240229',
2232
2481
  maxOutput: 4096,
2233
2482
  pricing: {
2234
- input: 3,
2235
- output: 15,
2483
+ units: [
2484
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
2485
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
2486
+ ],
2236
2487
  },
2237
2488
  releasedAt: '2024-02-29',
2238
2489
  type: 'chat',
@@ -2250,8 +2501,10 @@ const higressChatModels: AIChatModelCard[] = [
2250
2501
  id: 'claude-3-opus-20240229',
2251
2502
  maxOutput: 4096,
2252
2503
  pricing: {
2253
- input: 15,
2254
- output: 75,
2504
+ units: [
2505
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
2506
+ { name: 'textOutput', rate: 75, strategy: 'fixed', unit: 'millionTokens' },
2507
+ ],
2255
2508
  },
2256
2509
  releasedAt: '2024-02-29',
2257
2510
  type: 'chat',
@@ -2264,8 +2517,10 @@ const higressChatModels: AIChatModelCard[] = [
2264
2517
  id: 'claude-2.1',
2265
2518
  maxOutput: 4096,
2266
2519
  pricing: {
2267
- input: 8,
2268
- output: 24,
2520
+ units: [
2521
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
2522
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
2523
+ ],
2269
2524
  },
2270
2525
  releasedAt: '2023-11-21',
2271
2526
  type: 'chat',
@@ -2278,8 +2533,10 @@ const higressChatModels: AIChatModelCard[] = [
2278
2533
  id: 'claude-2.0',
2279
2534
  maxOutput: 4096,
2280
2535
  pricing: {
2281
- input: 8,
2282
- output: 24,
2536
+ units: [
2537
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
2538
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
2539
+ ],
2283
2540
  },
2284
2541
  releasedAt: '2023-07-11',
2285
2542
  type: 'chat',
@@ -2297,9 +2554,11 @@ const higressChatModels: AIChatModelCard[] = [
2297
2554
  id: 'gemini-1.5-flash-latest',
2298
2555
  maxOutput: 8192,
2299
2556
  pricing: {
2300
- cachedInput: 0.018_75,
2301
- input: 0.075,
2302
- output: 0.3,
2557
+ units: [
2558
+ { name: 'textInput_cacheRead', rate: 0.018, strategy: 'fixed', unit: 'millionTokens' },
2559
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
2560
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2561
+ ],
2303
2562
  },
2304
2563
  type: 'chat',
2305
2564
  },
@@ -2315,9 +2574,11 @@ const higressChatModels: AIChatModelCard[] = [
2315
2574
  id: 'gemini-1.5-flash-002',
2316
2575
  maxOutput: 8192,
2317
2576
  pricing: {
2318
- cachedInput: 0.018_75,
2319
- input: 0.075,
2320
- output: 0.3,
2577
+ units: [
2578
+ { name: 'textInput_cacheRead', rate: 0.018, strategy: 'fixed', unit: 'millionTokens' },
2579
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
2580
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2581
+ ],
2321
2582
  },
2322
2583
  releasedAt: '2024-09-25',
2323
2584
  type: 'chat',
@@ -2333,9 +2594,11 @@ const higressChatModels: AIChatModelCard[] = [
2333
2594
  id: 'gemini-1.5-flash-001',
2334
2595
  maxOutput: 8192,
2335
2596
  pricing: {
2336
- cachedInput: 0.018_75,
2337
- input: 0.075,
2338
- output: 0.3,
2597
+ units: [
2598
+ { name: 'textInput_cacheRead', rate: 0.018, strategy: 'fixed', unit: 'millionTokens' },
2599
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
2600
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2601
+ ],
2339
2602
  },
2340
2603
  type: 'chat',
2341
2604
  },
@@ -2350,9 +2613,11 @@ const higressChatModels: AIChatModelCard[] = [
2350
2613
  id: 'gemini-1.5-flash-exp-0827',
2351
2614
  maxOutput: 8192,
2352
2615
  pricing: {
2353
- cachedInput: 0.018_75,
2354
- input: 0.075,
2355
- output: 0.3,
2616
+ units: [
2617
+ { name: 'textInput_cacheRead', rate: 0.018, strategy: 'fixed', unit: 'millionTokens' },
2618
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
2619
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2620
+ ],
2356
2621
  },
2357
2622
  releasedAt: '2024-08-27',
2358
2623
  type: 'chat',
@@ -2369,9 +2634,11 @@ const higressChatModels: AIChatModelCard[] = [
2369
2634
  id: 'gemini-1.5-flash-8b',
2370
2635
  maxOutput: 8192,
2371
2636
  pricing: {
2372
- cachedInput: 0.02,
2373
- input: 0.075,
2374
- output: 0.3,
2637
+ units: [
2638
+ { name: 'textInput_cacheRead', rate: 0.02, strategy: 'fixed', unit: 'millionTokens' },
2639
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
2640
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2641
+ ],
2375
2642
  },
2376
2643
  releasedAt: '2024-10-03',
2377
2644
  type: 'chat',
@@ -2388,9 +2655,11 @@ const higressChatModels: AIChatModelCard[] = [
2388
2655
  id: 'gemini-1.5-flash-8b-exp-0924',
2389
2656
  maxOutput: 8192,
2390
2657
  pricing: {
2391
- cachedInput: 0.018_75,
2392
- input: 0.075,
2393
- output: 0.3,
2658
+ units: [
2659
+ { name: 'textInput_cacheRead', rate: 0.018, strategy: 'fixed', unit: 'millionTokens' },
2660
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
2661
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
2662
+ ],
2394
2663
  },
2395
2664
  releasedAt: '2024-09-24',
2396
2665
  type: 'chat',
@@ -2408,9 +2677,11 @@ const higressChatModels: AIChatModelCard[] = [
2408
2677
  id: 'gemini-1.5-pro-latest',
2409
2678
  maxOutput: 8192,
2410
2679
  pricing: {
2411
- cachedInput: 0.875,
2412
- input: 3.5,
2413
- output: 10.5,
2680
+ units: [
2681
+ { name: 'textInput_cacheRead', rate: 0.875, strategy: 'fixed', unit: 'millionTokens' },
2682
+ { name: 'textInput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
2683
+ { name: 'textOutput', rate: 10.5, strategy: 'fixed', unit: 'millionTokens' },
2684
+ ],
2414
2685
  },
2415
2686
  releasedAt: '2024-02-15',
2416
2687
  type: 'chat',
@@ -2428,9 +2699,11 @@ const higressChatModels: AIChatModelCard[] = [
2428
2699
  id: 'gemini-1.5-pro-002',
2429
2700
  maxOutput: 8192,
2430
2701
  pricing: {
2431
- cachedInput: 0.315,
2432
- input: 1.25,
2433
- output: 2.5,
2702
+ units: [
2703
+ { name: 'textInput_cacheRead', rate: 0.315, strategy: 'fixed', unit: 'millionTokens' },
2704
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
2705
+ { name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
2706
+ ],
2434
2707
  },
2435
2708
  releasedAt: '2024-09-24',
2436
2709
  type: 'chat',
@@ -2446,9 +2719,11 @@ const higressChatModels: AIChatModelCard[] = [
2446
2719
  id: 'gemini-1.5-pro-001',
2447
2720
  maxOutput: 8192,
2448
2721
  pricing: {
2449
- cachedInput: 0.875,
2450
- input: 3.5,
2451
- output: 10.5,
2722
+ units: [
2723
+ { name: 'textInput_cacheRead', rate: 0.875, strategy: 'fixed', unit: 'millionTokens' },
2724
+ { name: 'textInput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
2725
+ { name: 'textOutput', rate: 10.5, strategy: 'fixed', unit: 'millionTokens' },
2726
+ ],
2452
2727
  },
2453
2728
  releasedAt: '2024-02-15',
2454
2729
  type: 'chat',
@@ -2464,9 +2739,11 @@ const higressChatModels: AIChatModelCard[] = [
2464
2739
  id: 'gemini-1.5-pro-exp-0827',
2465
2740
  maxOutput: 8192,
2466
2741
  pricing: {
2467
- cachedInput: 0.875,
2468
- input: 3.5,
2469
- output: 10.5,
2742
+ units: [
2743
+ { name: 'textInput_cacheRead', rate: 0.875, strategy: 'fixed', unit: 'millionTokens' },
2744
+ { name: 'textInput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
2745
+ { name: 'textOutput', rate: 10.5, strategy: 'fixed', unit: 'millionTokens' },
2746
+ ],
2470
2747
  },
2471
2748
  releasedAt: '2024-08-27',
2472
2749
  type: 'chat',
@@ -2482,9 +2759,11 @@ const higressChatModels: AIChatModelCard[] = [
2482
2759
  id: 'gemini-1.5-pro-exp-0801',
2483
2760
  maxOutput: 8192,
2484
2761
  pricing: {
2485
- cachedInput: 0.875,
2486
- input: 3.5,
2487
- output: 10.5,
2762
+ units: [
2763
+ { name: 'textInput_cacheRead', rate: 0.875, strategy: 'fixed', unit: 'millionTokens' },
2764
+ { name: 'textInput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
2765
+ { name: 'textOutput', rate: 10.5, strategy: 'fixed', unit: 'millionTokens' },
2766
+ ],
2488
2767
  },
2489
2768
  releasedAt: '2024-08-01',
2490
2769
  type: 'chat',
@@ -2496,8 +2775,10 @@ const higressChatModels: AIChatModelCard[] = [
2496
2775
  id: 'gemini-1.0-pro-latest',
2497
2776
  maxOutput: 2048,
2498
2777
  pricing: {
2499
- input: 0.5,
2500
- output: 1.5,
2778
+ units: [
2779
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
2780
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
2781
+ ],
2501
2782
  },
2502
2783
  releasedAt: '2023-12-06',
2503
2784
  type: 'chat',
@@ -2513,8 +2794,10 @@ const higressChatModels: AIChatModelCard[] = [
2513
2794
  id: 'gemini-1.0-pro-001',
2514
2795
  maxOutput: 2048,
2515
2796
  pricing: {
2516
- input: 0.5,
2517
- output: 1.5,
2797
+ units: [
2798
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
2799
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
2800
+ ],
2518
2801
  },
2519
2802
  releasedAt: '2023-12-06',
2520
2803
  type: 'chat',
@@ -2526,8 +2809,10 @@ const higressChatModels: AIChatModelCard[] = [
2526
2809
  id: 'gemini-1.0-pro-002',
2527
2810
  maxOutput: 2048,
2528
2811
  pricing: {
2529
- input: 0.5,
2530
- output: 1.5,
2812
+ units: [
2813
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
2814
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
2815
+ ],
2531
2816
  },
2532
2817
  releasedAt: '2023-12-06',
2533
2818
  type: 'chat',
@@ -2543,8 +2828,10 @@ const higressChatModels: AIChatModelCard[] = [
2543
2828
  enabled: true,
2544
2829
  id: 'open-mistral-nemo',
2545
2830
  pricing: {
2546
- input: 0.15,
2547
- output: 0.15,
2831
+ units: [
2832
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
2833
+ { name: 'textOutput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
2834
+ ],
2548
2835
  },
2549
2836
  type: 'chat',
2550
2837
  },
@@ -2558,8 +2845,10 @@ const higressChatModels: AIChatModelCard[] = [
2558
2845
  enabled: true,
2559
2846
  id: 'mistral-small-latest',
2560
2847
  pricing: {
2561
- input: 0.2,
2562
- output: 0.6,
2848
+ units: [
2849
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
2850
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
2851
+ ],
2563
2852
  },
2564
2853
  type: 'chat',
2565
2854
  },
@@ -2574,8 +2863,10 @@ const higressChatModels: AIChatModelCard[] = [
2574
2863
  enabled: true,
2575
2864
  id: 'mistral-large-latest',
2576
2865
  pricing: {
2577
- input: 2,
2578
- output: 6,
2866
+ units: [
2867
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
2868
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
2869
+ ],
2579
2870
  },
2580
2871
  type: 'chat',
2581
2872
  },
@@ -2585,8 +2876,10 @@ const higressChatModels: AIChatModelCard[] = [
2585
2876
  displayName: 'Codestral',
2586
2877
  id: 'codestral-latest',
2587
2878
  pricing: {
2588
- input: 0.2,
2589
- output: 0.6,
2879
+ units: [
2880
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
2881
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
2882
+ ],
2590
2883
  },
2591
2884
  type: 'chat',
2592
2885
  },
@@ -2601,8 +2894,10 @@ const higressChatModels: AIChatModelCard[] = [
2601
2894
  enabled: true,
2602
2895
  id: 'pixtral-12b-2409',
2603
2896
  pricing: {
2604
- input: 0.15,
2605
- output: 0.15,
2897
+ units: [
2898
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
2899
+ { name: 'textOutput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
2900
+ ],
2606
2901
  },
2607
2902
  type: 'chat',
2608
2903
  },
@@ -2612,8 +2907,10 @@ const higressChatModels: AIChatModelCard[] = [
2612
2907
  displayName: 'Ministral 3B',
2613
2908
  id: 'ministral-3b-latest',
2614
2909
  pricing: {
2615
- input: 0.04,
2616
- output: 0.04,
2910
+ units: [
2911
+ { name: 'textInput', rate: 0.04, strategy: 'fixed', unit: 'millionTokens' },
2912
+ { name: 'textOutput', rate: 0.04, strategy: 'fixed', unit: 'millionTokens' },
2913
+ ],
2617
2914
  },
2618
2915
  type: 'chat',
2619
2916
  },
@@ -2623,8 +2920,10 @@ const higressChatModels: AIChatModelCard[] = [
2623
2920
  displayName: 'Ministral 8B',
2624
2921
  id: 'ministral-8b-latest',
2625
2922
  pricing: {
2626
- input: 0.1,
2627
- output: 0.1,
2923
+ units: [
2924
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
2925
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
2926
+ ],
2628
2927
  },
2629
2928
  type: 'chat',
2630
2929
  },
@@ -2635,8 +2934,10 @@ const higressChatModels: AIChatModelCard[] = [
2635
2934
  displayName: 'Mistral 7B',
2636
2935
  id: 'open-mistral-7b',
2637
2936
  pricing: {
2638
- input: 0.25,
2639
- output: 0.25,
2937
+ units: [
2938
+ { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
2939
+ { name: 'textOutput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
2940
+ ],
2640
2941
  },
2641
2942
  type: 'chat',
2642
2943
  },
@@ -2647,8 +2948,10 @@ const higressChatModels: AIChatModelCard[] = [
2647
2948
  displayName: 'Mixtral 8x7B',
2648
2949
  id: 'open-mixtral-8x7b',
2649
2950
  pricing: {
2650
- input: 0.7,
2651
- output: 0.7,
2951
+ units: [
2952
+ { name: 'textInput', rate: 0.7, strategy: 'fixed', unit: 'millionTokens' },
2953
+ { name: 'textOutput', rate: 0.7, strategy: 'fixed', unit: 'millionTokens' },
2954
+ ],
2652
2955
  },
2653
2956
  type: 'chat',
2654
2957
  },
@@ -2662,8 +2965,10 @@ const higressChatModels: AIChatModelCard[] = [
2662
2965
  displayName: 'Mixtral 8x22B',
2663
2966
  id: 'open-mixtral-8x22b',
2664
2967
  pricing: {
2665
- input: 2,
2666
- output: 6,
2968
+ units: [
2969
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
2970
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
2971
+ ],
2667
2972
  },
2668
2973
  type: 'chat',
2669
2974
  },
@@ -2674,8 +2979,10 @@ const higressChatModels: AIChatModelCard[] = [
2674
2979
  displayName: 'Codestral Mamba',
2675
2980
  id: 'open-codestral-mamba',
2676
2981
  pricing: {
2677
- input: 0.15,
2678
- output: 0.15,
2982
+ units: [
2983
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
2984
+ { name: 'textOutput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
2985
+ ],
2679
2986
  },
2680
2987
  type: 'chat',
2681
2988
  },