@blitzreels/contracts 0.2.13 → 0.2.15

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 (78) hide show
  1. package/dist/ai-credit-costs.d.ts +6 -15
  2. package/dist/ai-credit-costs.d.ts.map +1 -1
  3. package/dist/ai-credit-costs.js +22 -40
  4. package/dist/ai-credit-costs.js.map +1 -1
  5. package/dist/carousel-recipe.d.ts +0 -2
  6. package/dist/carousel-recipe.d.ts.map +1 -1
  7. package/dist/carousel-recipe.js +11 -4
  8. package/dist/carousel-recipe.js.map +1 -1
  9. package/dist/clip-batch-estimate.d.ts +5 -0
  10. package/dist/clip-batch-estimate.d.ts.map +1 -1
  11. package/dist/clip-batch-estimate.js +7 -2
  12. package/dist/clip-batch-estimate.js.map +1 -1
  13. package/dist/creative-composition-edit.d.ts +198 -198
  14. package/dist/creative-learning-contract.js +1 -1
  15. package/dist/creative-learning-contract.js.map +1 -1
  16. package/dist/creative-map-contract.js +1 -1
  17. package/dist/creative-map-contract.js.map +1 -1
  18. package/dist/creative-style-contract.d.ts +70 -70
  19. package/dist/creative-style-contract.d.ts.map +1 -1
  20. package/dist/creative-style-contract.js +10 -4
  21. package/dist/creative-style-contract.js.map +1 -1
  22. package/dist/credit-units.d.ts +10 -0
  23. package/dist/credit-units.d.ts.map +1 -0
  24. package/dist/credit-units.js +26 -0
  25. package/dist/credit-units.js.map +1 -0
  26. package/dist/editor-command-contract.d.ts +132 -132
  27. package/dist/generation-image-size.d.ts +2 -2
  28. package/dist/generation-image-size.d.ts.map +1 -1
  29. package/dist/generation-image-size.js +4 -2
  30. package/dist/generation-image-size.js.map +1 -1
  31. package/dist/generation-resolution.d.ts.map +1 -1
  32. package/dist/generation-resolution.js +18 -19
  33. package/dist/generation-resolution.js.map +1 -1
  34. package/dist/index.d.ts +6 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +6 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/knowledge-research-contract.js +4 -4
  39. package/dist/knowledge-research-contract.js.map +1 -1
  40. package/dist/metered-operations.d.ts +1189 -0
  41. package/dist/metered-operations.d.ts.map +1 -0
  42. package/dist/metered-operations.js +1051 -0
  43. package/dist/metered-operations.js.map +1 -0
  44. package/dist/model-prices.d.ts +424 -0
  45. package/dist/model-prices.d.ts.map +1 -0
  46. package/dist/model-prices.js +658 -0
  47. package/dist/model-prices.js.map +1 -0
  48. package/dist/output-assessment-contract.d.ts +48 -0
  49. package/dist/output-assessment-contract.d.ts.map +1 -0
  50. package/dist/output-assessment-contract.js +51 -0
  51. package/dist/output-assessment-contract.js.map +1 -0
  52. package/dist/plan-limits.d.ts +4 -1
  53. package/dist/plan-limits.d.ts.map +1 -1
  54. package/dist/plan-limits.js +32 -17
  55. package/dist/plan-limits.js.map +1 -1
  56. package/dist/popular-generation-models.d.ts +20 -0
  57. package/dist/popular-generation-models.d.ts.map +1 -0
  58. package/dist/popular-generation-models.js +58 -0
  59. package/dist/popular-generation-models.js.map +1 -0
  60. package/dist/publishing-contract.d.ts +153 -0
  61. package/dist/publishing-contract.d.ts.map +1 -1
  62. package/dist/publishing-contract.js +22 -3
  63. package/dist/publishing-contract.js.map +1 -1
  64. package/dist/recipe-operation-contract.d.ts +3 -0
  65. package/dist/recipe-operation-contract.d.ts.map +1 -1
  66. package/dist/recipe-operation-contract.js +1 -0
  67. package/dist/recipe-operation-contract.js.map +1 -1
  68. package/dist/social-analytics-contract.d.ts +417 -0
  69. package/dist/social-analytics-contract.d.ts.map +1 -0
  70. package/dist/social-analytics-contract.js +141 -0
  71. package/dist/social-analytics-contract.js.map +1 -0
  72. package/dist/video-transformation.d.ts +12 -12
  73. package/dist/video-transformation.d.ts.map +1 -1
  74. package/dist/video-transformation.js +7 -6
  75. package/dist/video-transformation.js.map +1 -1
  76. package/dist/web-capture-contract.js +1 -1
  77. package/dist/web-capture-contract.js.map +1 -1
  78. package/package.json +2 -2
@@ -0,0 +1,1051 @@
1
+ import { CLIPPING_CREDITS_PER_USD, GENERATION_CREDITS_PER_USD, roundCreditDebit, } from "./credit-units.js";
2
+ import { MODEL_PRICES, resolveModelPrice, } from "./model-prices.js";
3
+ export const METERED_OPERATIONS = {
4
+ faceless_production: {
5
+ label: "Faceless production estimate",
6
+ ledgerType: "faceless_story",
7
+ pricing: { kind: "faceless" },
8
+ },
9
+ usd_dispatch_scoped_hosted_work: {
10
+ label: "dispatch scoped hosted work",
11
+ ledgerType: "other",
12
+ pricing: {
13
+ kind: "included",
14
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
15
+ },
16
+ usdBudget: "usd_dispatch_scoped_hosted_work",
17
+ },
18
+ usd_wait_visual_batch: {
19
+ label: "wait visual batch",
20
+ ledgerType: "other",
21
+ pricing: {
22
+ kind: "included",
23
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
24
+ },
25
+ usdBudget: "usd_wait_visual_batch",
26
+ },
27
+ usd_execute_hosted_work: {
28
+ label: "execute hosted work",
29
+ ledgerType: "other",
30
+ pricing: {
31
+ kind: "included",
32
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
33
+ },
34
+ usdBudget: "usd_execute_hosted_work",
35
+ },
36
+ usd_settle_hosted_work: {
37
+ label: "settle hosted work",
38
+ ledgerType: "other",
39
+ pricing: {
40
+ kind: "included",
41
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
42
+ },
43
+ usdBudget: "usd_settle_hosted_work",
44
+ },
45
+ usd_budget_social_provider_request: {
46
+ label: "budget social provider request",
47
+ ledgerType: "other",
48
+ pricing: {
49
+ kind: "included",
50
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
51
+ },
52
+ usdBudget: "usd_budget_social_provider_request",
53
+ },
54
+ usd_bill_social_provider_request: {
55
+ label: "bill social provider request",
56
+ ledgerType: "other",
57
+ pricing: {
58
+ kind: "included",
59
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
60
+ },
61
+ usdBudget: "usd_bill_social_provider_request",
62
+ },
63
+ usd_dispatch_hosted_work: {
64
+ label: "dispatch hosted work",
65
+ ledgerType: "other",
66
+ pricing: {
67
+ kind: "included",
68
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
69
+ },
70
+ usdBudget: "usd_dispatch_hosted_work",
71
+ },
72
+ usd_run_budgeted_social_metadata: {
73
+ label: "run budgeted social metadata",
74
+ ledgerType: "other",
75
+ pricing: {
76
+ kind: "included",
77
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
78
+ },
79
+ usdBudget: "usd_run_budgeted_social_metadata",
80
+ },
81
+ usd_record_hosted_work_failure: {
82
+ label: "record hosted work failure",
83
+ ledgerType: "other",
84
+ pricing: {
85
+ kind: "included",
86
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
87
+ },
88
+ usdBudget: "usd_record_hosted_work_failure",
89
+ },
90
+ usd_claim_export_spending: {
91
+ label: "claim export spending",
92
+ ledgerType: "other",
93
+ pricing: {
94
+ kind: "included",
95
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
96
+ },
97
+ usdBudget: "usd_claim_export_spending",
98
+ },
99
+ usd_settle_export_spending: {
100
+ label: "settle export spending",
101
+ ledgerType: "other",
102
+ pricing: {
103
+ kind: "included",
104
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
105
+ },
106
+ usdBudget: "usd_settle_export_spending",
107
+ },
108
+ usd_claim_audio_spending: {
109
+ label: "claim audio spending",
110
+ ledgerType: "other",
111
+ pricing: {
112
+ kind: "included",
113
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
114
+ },
115
+ usdBudget: "usd_claim_audio_spending",
116
+ },
117
+ usd_settle_audio_spending: {
118
+ label: "settle audio spending",
119
+ ledgerType: "other",
120
+ pricing: {
121
+ kind: "included",
122
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
123
+ },
124
+ usdBudget: "usd_settle_audio_spending",
125
+ },
126
+ usd_with_creative_job_spend_context: {
127
+ label: "with creative job spend context",
128
+ ledgerType: "other",
129
+ pricing: {
130
+ kind: "included",
131
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
132
+ },
133
+ usdBudget: "usd_with_creative_job_spend_context",
134
+ },
135
+ usd_claim_visual_spending: {
136
+ label: "claim visual spending",
137
+ ledgerType: "other",
138
+ pricing: {
139
+ kind: "included",
140
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
141
+ },
142
+ usdBudget: "usd_claim_visual_spending",
143
+ },
144
+ usd_settle_visual_spending: {
145
+ label: "settle visual spending",
146
+ ledgerType: "other",
147
+ pricing: {
148
+ kind: "included",
149
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
150
+ },
151
+ usdBudget: "usd_settle_visual_spending",
152
+ },
153
+ usd_queue_budgeted_export: {
154
+ label: "queue budgeted export",
155
+ ledgerType: "other",
156
+ pricing: {
157
+ kind: "included",
158
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
159
+ },
160
+ usdBudget: "usd_queue_budgeted_export",
161
+ },
162
+ usd_claim_hosted_transcription_request: {
163
+ label: "claim hosted transcription request",
164
+ ledgerType: "other",
165
+ pricing: {
166
+ kind: "included",
167
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
168
+ },
169
+ usdBudget: "usd_claim_hosted_transcription_request",
170
+ },
171
+ usd_run_admitted_video_review: {
172
+ label: "run admitted video review",
173
+ ledgerType: "other",
174
+ pricing: {
175
+ kind: "included",
176
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
177
+ },
178
+ usdBudget: "usd_run_admitted_video_review",
179
+ },
180
+ usd_run_budgeted_preview: {
181
+ label: "run budgeted preview",
182
+ ledgerType: "other",
183
+ pricing: {
184
+ kind: "included",
185
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
186
+ },
187
+ usdBudget: "usd_run_budgeted_preview",
188
+ },
189
+ usd_wait_visual_task: {
190
+ label: "wait visual task",
191
+ ledgerType: "other",
192
+ pricing: {
193
+ kind: "included",
194
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
195
+ },
196
+ usdBudget: "usd_wait_visual_task",
197
+ },
198
+ usd_reconcile_visual_dispatch: {
199
+ label: "reconcile visual dispatch",
200
+ ledgerType: "other",
201
+ pricing: {
202
+ kind: "included",
203
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
204
+ },
205
+ usdBudget: "usd_reconcile_visual_dispatch",
206
+ },
207
+ usd_trigger_visual_task: {
208
+ label: "trigger visual task",
209
+ ledgerType: "other",
210
+ pricing: {
211
+ kind: "included",
212
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
213
+ },
214
+ usdBudget: "usd_trigger_visual_task",
215
+ },
216
+ usd_execute_social_download: {
217
+ label: "execute social download",
218
+ ledgerType: "other",
219
+ pricing: {
220
+ kind: "included",
221
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
222
+ },
223
+ usdBudget: "usd_execute_social_download",
224
+ },
225
+ usd_expose_creative_spend: {
226
+ label: "expose creative spend",
227
+ ledgerType: "other",
228
+ pricing: {
229
+ kind: "included",
230
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
231
+ },
232
+ usdBudget: "usd_expose_creative_spend",
233
+ },
234
+ usd_reconcile_creative_spend: {
235
+ label: "reconcile creative spend",
236
+ ledgerType: "other",
237
+ pricing: {
238
+ kind: "included",
239
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
240
+ },
241
+ usdBudget: "usd_reconcile_creative_spend",
242
+ },
243
+ usd_reserve_creative_spend: {
244
+ label: "reserve creative spend",
245
+ ledgerType: "other",
246
+ pricing: {
247
+ kind: "included",
248
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
249
+ },
250
+ usdBudget: "usd_reserve_creative_spend",
251
+ },
252
+ usd_cover_narration_spending: {
253
+ label: "cover narration spending",
254
+ ledgerType: "other",
255
+ pricing: {
256
+ kind: "included",
257
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
258
+ },
259
+ usdBudget: "usd_cover_narration_spending",
260
+ },
261
+ usd_settle_narration_spending: {
262
+ label: "settle narration spending",
263
+ ledgerType: "other",
264
+ pricing: {
265
+ kind: "included",
266
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
267
+ },
268
+ usdBudget: "usd_settle_narration_spending",
269
+ },
270
+ usd_reserve_narration_spending: {
271
+ label: "reserve narration spending",
272
+ ledgerType: "other",
273
+ pricing: {
274
+ kind: "included",
275
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
276
+ },
277
+ usdBudget: "usd_reserve_narration_spending",
278
+ },
279
+ usd_expose_capture_cycle: {
280
+ label: "expose capture cycle",
281
+ ledgerType: "other",
282
+ pricing: {
283
+ kind: "included",
284
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
285
+ },
286
+ usdBudget: "usd_expose_capture_cycle",
287
+ },
288
+ usd_reserve_capture_cycle: {
289
+ label: "reserve capture cycle",
290
+ ledgerType: "other",
291
+ pricing: {
292
+ kind: "included",
293
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
294
+ },
295
+ usdBudget: "usd_reserve_capture_cycle",
296
+ },
297
+ usd_settle_capture_cycle: {
298
+ label: "settle capture cycle",
299
+ ledgerType: "other",
300
+ pricing: {
301
+ kind: "included",
302
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
303
+ },
304
+ usdBudget: "usd_settle_capture_cycle",
305
+ },
306
+ usd_admit_research_dispatch: {
307
+ label: "admit research dispatch",
308
+ ledgerType: "other",
309
+ pricing: {
310
+ kind: "included",
311
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
312
+ },
313
+ usdBudget: "usd_admit_research_dispatch",
314
+ },
315
+ usd_start_research_spend_cycle: {
316
+ label: "start research spend cycle",
317
+ ledgerType: "other",
318
+ pricing: {
319
+ kind: "included",
320
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
321
+ },
322
+ usdBudget: "usd_start_research_spend_cycle",
323
+ },
324
+ usd_sync_research_spending: {
325
+ label: "sync research spending",
326
+ ledgerType: "other",
327
+ pricing: {
328
+ kind: "included",
329
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
330
+ },
331
+ usdBudget: "usd_sync_research_spending",
332
+ },
333
+ usd_reconcile_creative_storage_allowance: {
334
+ label: "reconcile creative storage allowance",
335
+ ledgerType: "other",
336
+ pricing: {
337
+ kind: "included",
338
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
339
+ },
340
+ usdBudget: "usd_reconcile_creative_storage_allowance",
341
+ },
342
+ usd_wait_scoped_hosted_work: {
343
+ label: "wait scoped hosted work",
344
+ ledgerType: "other",
345
+ pricing: {
346
+ kind: "included",
347
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
348
+ },
349
+ usdBudget: "usd_wait_scoped_hosted_work",
350
+ },
351
+ usd_dispatch_workflow_worker: {
352
+ label: "dispatch workflow worker",
353
+ ledgerType: "other",
354
+ pricing: {
355
+ kind: "included",
356
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
357
+ },
358
+ usdBudget: "usd_dispatch_workflow_worker",
359
+ },
360
+ usd_bind_audio_spending_run: {
361
+ label: "bind audio spending run",
362
+ ledgerType: "other",
363
+ pricing: {
364
+ kind: "included",
365
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
366
+ },
367
+ usdBudget: "usd_bind_audio_spending_run",
368
+ },
369
+ usd_reserve_audio_spending: {
370
+ label: "reserve audio spending",
371
+ ledgerType: "other",
372
+ pricing: {
373
+ kind: "included",
374
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
375
+ },
376
+ usdBudget: "usd_reserve_audio_spending",
377
+ },
378
+ usd_dispatch_routed_hosted_work: {
379
+ label: "dispatch routed hosted work",
380
+ ledgerType: "other",
381
+ pricing: {
382
+ kind: "included",
383
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
384
+ },
385
+ usdBudget: "usd_dispatch_routed_hosted_work",
386
+ },
387
+ usd_link_export_spending: {
388
+ label: "link export spending",
389
+ ledgerType: "other",
390
+ pricing: {
391
+ kind: "included",
392
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
393
+ },
394
+ usdBudget: "usd_link_export_spending",
395
+ },
396
+ usd_assert_export_render_spending: {
397
+ label: "assert export render spending",
398
+ ledgerType: "other",
399
+ pricing: {
400
+ kind: "included",
401
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
402
+ },
403
+ usdBudget: "usd_assert_export_render_spending",
404
+ },
405
+ usd_run_budgeted_remote_intake: {
406
+ label: "run budgeted remote intake",
407
+ ledgerType: "other",
408
+ pricing: {
409
+ kind: "included",
410
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
411
+ },
412
+ usdBudget: "usd_run_budgeted_remote_intake",
413
+ },
414
+ usd_reconcile_modal_analysis_cache: {
415
+ label: "reconcile modal analysis cache",
416
+ ledgerType: "other",
417
+ pricing: {
418
+ kind: "included",
419
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
420
+ },
421
+ usdBudget: "usd_reconcile_modal_analysis_cache",
422
+ },
423
+ usd_run_budgeted_modal_analysis: {
424
+ label: "run budgeted modal analysis",
425
+ ledgerType: "other",
426
+ pricing: {
427
+ kind: "included",
428
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
429
+ },
430
+ usdBudget: "usd_run_budgeted_modal_analysis",
431
+ },
432
+ usd_assert_creative_storage_admission: {
433
+ label: "assert creative storage admission",
434
+ ledgerType: "other",
435
+ pricing: {
436
+ kind: "included",
437
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
438
+ },
439
+ usdBudget: "usd_assert_creative_storage_admission",
440
+ },
441
+ usd_dispatch_social_download: {
442
+ label: "dispatch social download",
443
+ ledgerType: "other",
444
+ pricing: {
445
+ kind: "included",
446
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
447
+ },
448
+ usdBudget: "usd_dispatch_social_download",
449
+ },
450
+ usd_run_budgeted_qa_preparation: {
451
+ label: "run budgeted qa preparation",
452
+ ledgerType: "other",
453
+ pricing: {
454
+ kind: "included",
455
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
456
+ },
457
+ usdBudget: "usd_run_budgeted_qa_preparation",
458
+ },
459
+ usd_with_standalone_video_review_spending: {
460
+ label: "with standalone video review spending",
461
+ ledgerType: "other",
462
+ pricing: {
463
+ kind: "included",
464
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
465
+ },
466
+ usdBudget: "usd_with_standalone_video_review_spending",
467
+ },
468
+ usd_wait_hosted_work: {
469
+ label: "wait hosted work",
470
+ ledgerType: "other",
471
+ pricing: {
472
+ kind: "included",
473
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
474
+ },
475
+ usdBudget: "usd_wait_hosted_work",
476
+ },
477
+ usd_run_budgeted_vision: {
478
+ label: "run budgeted vision",
479
+ ledgerType: "other",
480
+ pricing: {
481
+ kind: "included",
482
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
483
+ },
484
+ usdBudget: "usd_run_budgeted_vision",
485
+ },
486
+ agent_token_estimate: {
487
+ label: "agent_token_estimate",
488
+ ledgerType: "agent_execution",
489
+ pricing: { kind: "fixed", credits: MODEL_PRICES.default.agent_execution },
490
+ },
491
+ video_upscale_estimate: {
492
+ label: "video_upscale_estimate",
493
+ ledgerType: "video_upscale",
494
+ pricing: { kind: "fixed", credits: MODEL_PRICES.default.video_upscale },
495
+ },
496
+ miscellaneous: {
497
+ label: "miscellaneous",
498
+ ledgerType: "other",
499
+ pricing: { kind: "fixed", credits: MODEL_PRICES.default.other },
500
+ },
501
+ planning_admission: {
502
+ label: "Planning Admission",
503
+ ledgerType: "agent_execution",
504
+ pricing: { kind: "fixed", credits: 0.1 },
505
+ },
506
+ story_planning: {
507
+ label: "Story Planning",
508
+ ledgerType: "prompt_enhancement",
509
+ pricing: {
510
+ kind: "fixed",
511
+ credits: MODEL_PRICES.operation.promptEnhancement,
512
+ },
513
+ },
514
+ ugc_production: {
515
+ label: "Ugc Production",
516
+ ledgerType: "other",
517
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
518
+ },
519
+ knowledge_research: {
520
+ label: "Knowledge Research",
521
+ ledgerType: "other",
522
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
523
+ },
524
+ billing_inspection: {
525
+ label: "Billing Inspection",
526
+ ledgerType: "other",
527
+ pricing: { kind: "fixed", credits: 0 },
528
+ },
529
+ creative_learning: {
530
+ label: "Creative Learning",
531
+ ledgerType: "other",
532
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
533
+ },
534
+ creative_map: {
535
+ label: "Creative Map",
536
+ ledgerType: "other",
537
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
538
+ },
539
+ faceless_production_plan: {
540
+ label: "Faceless Production Plan",
541
+ ledgerType: "prompt_enhancement",
542
+ pricing: { kind: "fixed", credits: 2.5 },
543
+ },
544
+ semantic_action_qa: {
545
+ label: "Semantic Action Qa",
546
+ ledgerType: "prompt_enhancement",
547
+ pricing: {
548
+ kind: "fixed",
549
+ credits: MODEL_PRICES.operation.promptEnhancement,
550
+ },
551
+ },
552
+ creative_recipe: {
553
+ label: "Creative Recipe",
554
+ ledgerType: "other",
555
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
556
+ },
557
+ mistake_detection: {
558
+ label: "Mistake Detection",
559
+ ledgerType: "prompt_enhancement",
560
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
561
+ },
562
+ video_benchmark: {
563
+ label: "Video Benchmark",
564
+ ledgerType: "other",
565
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
566
+ },
567
+ web_capture: {
568
+ label: "Web Capture",
569
+ ledgerType: "other",
570
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
571
+ },
572
+ short_suggestions: {
573
+ label: "Short Suggestions",
574
+ ledgerType: "short_suggestions",
575
+ pricing: { kind: "fixed", credits: MODEL_PRICES.default.short_suggestions },
576
+ },
577
+ broll_analysis: {
578
+ label: "Broll Analysis",
579
+ ledgerType: "prompt_enhancement",
580
+ pricing: {
581
+ kind: "fixed",
582
+ credits: MODEL_PRICES.operation.promptEnhancement,
583
+ },
584
+ },
585
+ media_description: {
586
+ label: "Media Description",
587
+ ledgerType: "prompt_enhancement",
588
+ pricing: {
589
+ kind: "fixed",
590
+ credits: MODEL_PRICES.operation.promptEnhancement,
591
+ },
592
+ },
593
+ ai_content: {
594
+ label: "Ai Content",
595
+ ledgerType: "prompt_enhancement",
596
+ pricing: {
597
+ kind: "fixed",
598
+ credits: MODEL_PRICES.operation.promptEnhancement,
599
+ },
600
+ },
601
+ magic_emojis_pipeline: {
602
+ label: "Magic Emojis Pipeline",
603
+ ledgerType: "prompt_enhancement",
604
+ pricing: { kind: "fixed", credits: MODEL_PRICES.operation.magicEmojis },
605
+ },
606
+ pro_enhancements: {
607
+ label: "Pro Enhancements",
608
+ ledgerType: "prompt_enhancement",
609
+ pricing: {
610
+ kind: "fixed",
611
+ credits: MODEL_PRICES.operation.promptEnhancement,
612
+ },
613
+ },
614
+ broll_organization: {
615
+ label: "Broll Organization",
616
+ ledgerType: "prompt_enhancement",
617
+ pricing: {
618
+ kind: "fixed",
619
+ credits: MODEL_PRICES.operation.promptEnhancement,
620
+ },
621
+ },
622
+ workflow_execution: {
623
+ label: "Workflow Execution",
624
+ ledgerType: "agent_execution",
625
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
626
+ },
627
+ image_generation: {
628
+ label: "Image Generation",
629
+ ledgerType: "image_generation",
630
+ pricing: {
631
+ kind: "per_model",
632
+ catalog: "image",
633
+ defaultModel: "fal-ai/krea/v2/medium/turbo/text-to-image",
634
+ },
635
+ },
636
+ image_edit: {
637
+ label: "Image Edit",
638
+ ledgerType: "image_generation",
639
+ pricing: {
640
+ kind: "per_model",
641
+ catalog: "image",
642
+ defaultModel: "fal-ai/krea/v2/medium/turbo/text-to-image",
643
+ },
644
+ },
645
+ video_generation: {
646
+ label: "Video Generation",
647
+ ledgerType: "video_generation",
648
+ pricing: {
649
+ kind: "per_model",
650
+ catalog: "video",
651
+ defaultModel: "gemini-omni-flash-t2v",
652
+ },
653
+ },
654
+ image_to_video: {
655
+ label: "Image To Video",
656
+ ledgerType: "image_to_video",
657
+ pricing: {
658
+ kind: "per_model",
659
+ catalog: "video",
660
+ defaultModel: "kling-2.6-pro",
661
+ },
662
+ },
663
+ image_upscale: {
664
+ label: "Image Upscale",
665
+ ledgerType: "image_upscale",
666
+ pricing: { kind: "fixed", credits: MODEL_PRICES.default.image_upscale },
667
+ },
668
+ background_removal: {
669
+ label: "Background Removal",
670
+ ledgerType: "background_removal",
671
+ pricing: {
672
+ kind: "fixed",
673
+ credits: MODEL_PRICES.default.background_removal,
674
+ },
675
+ },
676
+ video_text_removal: {
677
+ label: "Video Text Removal",
678
+ ledgerType: "video_text_removal",
679
+ pricing: {
680
+ kind: "fixed",
681
+ credits: MODEL_PRICES.default.video_text_removal,
682
+ },
683
+ },
684
+ video_upscale: {
685
+ label: "Video Upscale",
686
+ ledgerType: "video_upscale",
687
+ pricing: {
688
+ kind: "per_model",
689
+ catalog: "upscale",
690
+ defaultModel: "bytedance-upscaler",
691
+ },
692
+ },
693
+ voice_generation: {
694
+ label: "Voice Generation",
695
+ ledgerType: "voice_generation",
696
+ pricing: {
697
+ kind: "fixed",
698
+ credits: MODEL_PRICES.operation.voicePer1KCharacters,
699
+ },
700
+ },
701
+ music_generation: {
702
+ label: "Music Generation",
703
+ ledgerType: "voice_generation",
704
+ pricing: { kind: "fixed", credits: MODEL_PRICES.music.standalonePerSecond },
705
+ },
706
+ sound_effects: {
707
+ label: "Sound Effects",
708
+ ledgerType: "voice_generation",
709
+ pricing: {
710
+ kind: "fixed",
711
+ credits: MODEL_PRICES.operation.soundEffectsPerGeneration,
712
+ },
713
+ },
714
+ faceless_story: {
715
+ label: "Faceless Story",
716
+ ledgerType: "faceless_story",
717
+ pricing: {
718
+ kind: "fixed",
719
+ credits: MODEL_PRICES.operation.facelessStoryPerScene,
720
+ },
721
+ },
722
+ faceless_music: {
723
+ label: "Faceless music",
724
+ ledgerType: "voice_generation",
725
+ pricing: { kind: "fixed", credits: MODEL_PRICES.operation.musicPerSecond },
726
+ },
727
+ faceless_plan: {
728
+ label: "Faceless Plan",
729
+ ledgerType: "faceless_story",
730
+ pricing: { kind: "fixed", credits: MODEL_PRICES.faceless.plan },
731
+ },
732
+ faceless_voice: {
733
+ label: "Faceless Voice",
734
+ ledgerType: "voice_generation",
735
+ pricing: { kind: "fixed", credits: MODEL_PRICES.faceless.voicePerSecond },
736
+ },
737
+ carousel_compile: {
738
+ label: "Carousel Compile",
739
+ ledgerType: "other",
740
+ pricing: {
741
+ kind: "carousel",
742
+ compileCredits: MODEL_PRICES.operation.carouselCompile,
743
+ rasterCredits: MODEL_PRICES.operation.carouselRaster,
744
+ },
745
+ },
746
+ carousel_raster: {
747
+ label: "Carousel Raster",
748
+ ledgerType: "other",
749
+ pricing: { kind: "fixed", credits: MODEL_PRICES.operation.carouselRaster },
750
+ },
751
+ prompt_enhancement: {
752
+ label: "Prompt Enhancement",
753
+ ledgerType: "prompt_enhancement",
754
+ pricing: {
755
+ kind: "fixed",
756
+ credits: MODEL_PRICES.operation.promptEnhancement,
757
+ },
758
+ },
759
+ url_import: {
760
+ label: "Url Import",
761
+ ledgerType: "other",
762
+ pricing: {
763
+ kind: "per_unit",
764
+ providerUsdPerUnit: MODEL_PRICES.operation.urlImportPerMinute / CLIPPING_CREDITS_PER_USD,
765
+ markup: "clipping",
766
+ unit: "minute",
767
+ },
768
+ },
769
+ export_video: {
770
+ label: "Export Video",
771
+ ledgerType: "export_video",
772
+ pricing: {
773
+ kind: "per_unit",
774
+ providerUsdPerUnit: MODEL_PRICES.operation.exportVideoPerMinute / CLIPPING_CREDITS_PER_USD,
775
+ markup: "clipping",
776
+ unit: "started_minute",
777
+ },
778
+ },
779
+ agent_execution: {
780
+ label: "AI agent execution",
781
+ ledgerType: "agent_execution",
782
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
783
+ },
784
+ source_analysis: {
785
+ label: "Source analysis",
786
+ ledgerType: "transcription",
787
+ pricing: {
788
+ kind: "per_unit",
789
+ providerUsdPerUnit: MODEL_PRICES.operation.sourceAnalysisPerMinute /
790
+ CLIPPING_CREDITS_PER_USD,
791
+ markup: "clipping",
792
+ unit: "minute",
793
+ },
794
+ },
795
+ social_provider_call: {
796
+ label: "Social research",
797
+ ledgerType: "other",
798
+ pricing: { kind: "included", dailyLimitPerWorkspace: 500 },
799
+ },
800
+ huntapi: {
801
+ label: "Social import provider",
802
+ ledgerType: "other",
803
+ pricing: { kind: "included", dailyLimitPerWorkspace: 200 },
804
+ },
805
+ voice_isolation: {
806
+ label: "Studio Sound",
807
+ ledgerType: "other",
808
+ pricing: {
809
+ kind: "per_unit",
810
+ providerUsdPerUnit: 0.12,
811
+ markup: "clipping",
812
+ unit: "started_minute",
813
+ },
814
+ },
815
+ media_understanding: {
816
+ label: "Media understanding",
817
+ ledgerType: "other",
818
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
819
+ },
820
+ brand_scan: {
821
+ label: "Website brand scan",
822
+ ledgerType: "other",
823
+ includedPerWorkspace: 1,
824
+ pricing: { kind: "fixed", credits: 1 },
825
+ },
826
+ reframe_analysis: {
827
+ label: "Smart reframe analysis",
828
+ ledgerType: "export_video",
829
+ pricing: {
830
+ kind: "per_unit",
831
+ providerUsdPerUnit: 0.13,
832
+ markup: "clipping",
833
+ unit: "analysis",
834
+ },
835
+ },
836
+ reframe_prefetch: {
837
+ label: "Background reframe analysis",
838
+ ledgerType: "export_video",
839
+ pricing: {
840
+ kind: "included",
841
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
842
+ },
843
+ },
844
+ trend_discovery: {
845
+ label: "Trend discovery",
846
+ ledgerType: "other",
847
+ pricing: { kind: "included", dailyLimitPerWorkspace: 300 },
848
+ },
849
+ pinterest_search: {
850
+ label: "Pinterest search",
851
+ ledgerType: "other",
852
+ pricing: { kind: "included", dailyLimitPerWorkspace: 200 },
853
+ },
854
+ magic_emojis: {
855
+ label: "Magic emojis",
856
+ ledgerType: "other",
857
+ pricing: { kind: "fixed", credits: MODEL_PRICES.operation.magicEmojis },
858
+ },
859
+ content_personalization: {
860
+ label: "Content writing",
861
+ ledgerType: "other",
862
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
863
+ },
864
+ hosted_draft_model_call: {
865
+ label: "Creative Studio planning",
866
+ ledgerType: "agent_execution",
867
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
868
+ },
869
+ code_highlights: {
870
+ label: "Code highlights",
871
+ ledgerType: "agent_execution",
872
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
873
+ },
874
+ generation_plan: {
875
+ label: "Generation planning",
876
+ ledgerType: "agent_execution",
877
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
878
+ },
879
+ script_parser: {
880
+ label: "Script parsing",
881
+ ledgerType: "agent_execution",
882
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
883
+ },
884
+ prompt_improvement: {
885
+ usdBudget: "prompt",
886
+ label: "Prompt improvement",
887
+ ledgerType: "agent_execution",
888
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
889
+ },
890
+ character_likeness: {
891
+ label: "Character likeness",
892
+ ledgerType: "agent_execution",
893
+ usdBudget: "prompt",
894
+ pricing: {
895
+ kind: "included",
896
+ dailyLimitPerWorkspace: Number.MAX_SAFE_INTEGER,
897
+ },
898
+ },
899
+ character_description: {
900
+ usdBudget: "prompt",
901
+ label: "Character description",
902
+ ledgerType: "agent_execution",
903
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
904
+ },
905
+ frame_vision: {
906
+ label: "Frame vision",
907
+ ledgerType: "agent_execution",
908
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 2 },
909
+ },
910
+ video_review: {
911
+ label: "Video review",
912
+ ledgerType: "agent_execution",
913
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 2 },
914
+ },
915
+ ugc_planning: {
916
+ label: "UGC planning",
917
+ ledgerType: "agent_execution",
918
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
919
+ },
920
+ edit_planning: {
921
+ label: "Edit planning",
922
+ ledgerType: "agent_execution",
923
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
924
+ },
925
+ agent_web_search: {
926
+ label: "Agent web search",
927
+ ledgerType: "agent_execution",
928
+ pricing: { kind: "measured", markup: "generation", reserveCredits: 1 },
929
+ },
930
+ project_name: {
931
+ label: "Project names",
932
+ ledgerType: "other",
933
+ pricing: { kind: "included", dailyLimitPerWorkspace: 200 },
934
+ },
935
+ vocabulary: {
936
+ label: "Vocabulary",
937
+ ledgerType: "other",
938
+ pricing: { kind: "included", dailyLimitPerWorkspace: 200 },
939
+ },
940
+ json_prompt: {
941
+ label: "JSON prompt conversion",
942
+ ledgerType: "other",
943
+ pricing: { kind: "included", dailyLimitPerWorkspace: 200 },
944
+ },
945
+ chat_title: {
946
+ label: "Chat titles",
947
+ ledgerType: "other",
948
+ pricing: { kind: "included", dailyLimitPerWorkspace: 200 },
949
+ },
950
+ embeddings: {
951
+ label: "Embeddings",
952
+ ledgerType: "other",
953
+ pricing: { kind: "included", dailyLimitPerWorkspace: 2000 },
954
+ },
955
+ tiktok_analytics: {
956
+ label: "TikTok analytics fallback",
957
+ ledgerType: "other",
958
+ pricing: { kind: "included", dailyLimitPerWorkspace: 24 },
959
+ },
960
+ };
961
+ export function quoteMeteredOperation({ operation, units, costUsd, model, options, precision = "debit", }) {
962
+ if (!Number.isFinite(units) || units < 0)
963
+ throw new Error("Invalid metered units");
964
+ if (costUsd !== undefined && (!Number.isFinite(costUsd) || costUsd < 0))
965
+ throw new Error("Invalid measured cost");
966
+ const { pricing } = METERED_OPERATIONS[operation];
967
+ const round = precision === "rate" ? (value) => value : roundCreditDebit;
968
+ switch (pricing.kind) {
969
+ case "faceless": {
970
+ const production = options?.production;
971
+ if (!production)
972
+ throw new Error("Faceless production requires model quote snapshots");
973
+ if (![production.imageCreditCost, production.videoCreditsPerSecond].every((rate) => Number.isFinite(rate) && rate >= 0))
974
+ throw new Error("Invalid faceless model quote snapshot");
975
+ const sceneCount = Math.max(MODEL_PRICES.faceless.minSceneCount, Math.min(MODEL_PRICES.faceless.maxSceneCount, Math.round(units / MODEL_PRICES.faceless.sceneDurationSeconds)));
976
+ const quote = (input) => quoteMeteredOperation({ ...input, precision: "rate" });
977
+ return round(quote({ operation: "faceless_story", units: sceneCount }) +
978
+ quote({
979
+ operation: "voice_generation",
980
+ units: ((units / 60) *
981
+ MODEL_PRICES.faceless.narrationCharactersPerMinute) /
982
+ 1000,
983
+ }) +
984
+ sceneCount * production.imageCreditCost +
985
+ sceneCount *
986
+ production.videoCreditsPerSecond *
987
+ MODEL_PRICES.faceless.clipDurationSeconds +
988
+ (production.backgroundMusic
989
+ ? quote({ operation: "faceless_music", units })
990
+ : 0) +
991
+ (production.soundEffects
992
+ ? quote({ operation: "sound_effects", units: 1 })
993
+ : 0) +
994
+ quote({ operation: "export_video", units: units / 60 }) +
995
+ (production.improvePrompt
996
+ ? quote({ operation: "prompt_enhancement", units: 1 })
997
+ : 0));
998
+ }
999
+ case "per_model": {
1000
+ const selected = model ?? pricing.defaultModel;
1001
+ if (!selected)
1002
+ throw new Error(`A model is required for ${operation}`);
1003
+ if (pricing.catalog === "upscale") {
1004
+ if (selected !== "bytedance-upscaler")
1005
+ throw new Error(`Missing upscale price: ${selected}`);
1006
+ const resolution = options?.resolution === "4k" ? "4k" : "1080p";
1007
+ const cost = Math.round(units *
1008
+ MODEL_PRICES.upscale[resolution] *
1009
+ (options?.targetFps === "60fps" ? 2 : 1) *
1010
+ 10_000) / 10_000;
1011
+ return round(Math.ceil(cost * MODEL_PRICES.upscale.customerMultiplier * 100) / 100);
1012
+ }
1013
+ return round(resolveModelPrice({ kind: pricing.catalog, model: selected, options }) *
1014
+ units);
1015
+ }
1016
+ case "carousel":
1017
+ return round(pricing.compileCredits + pricing.rasterCredits * Math.max(1, units));
1018
+ case "included":
1019
+ return 0;
1020
+ case "fixed":
1021
+ return round(pricing.credits * units);
1022
+ case "measured":
1023
+ return round(costUsd === undefined
1024
+ ? Math.max(0.1, pricing.reserveCredits * units)
1025
+ : costUsd * GENERATION_CREDITS_PER_USD);
1026
+ case "per_unit":
1027
+ return round((pricing.unit === "started_minute" ? Math.ceil(units) : units) *
1028
+ (pricing.providerUsdPerUnit *
1029
+ (pricing.markup === "generation"
1030
+ ? GENERATION_CREDITS_PER_USD
1031
+ : CLIPPING_CREDITS_PER_USD)));
1032
+ }
1033
+ }
1034
+ export const METERED_AI_OPERATIONS = {
1035
+ transcription: "source_analysis",
1036
+ prompt_enhancement: "prompt_enhancement",
1037
+ image_generation: "image_generation",
1038
+ background_removal: "background_removal",
1039
+ image_upscale: "image_upscale",
1040
+ video_upscale: "video_upscale_estimate",
1041
+ video_text_removal: "video_text_removal",
1042
+ faceless_story: "faceless_story",
1043
+ voice_generation: "voice_generation",
1044
+ video_generation: "video_generation",
1045
+ image_to_video: "image_to_video",
1046
+ export_video: "export_video",
1047
+ agent_execution: "agent_token_estimate",
1048
+ short_suggestions: "short_suggestions",
1049
+ other: "miscellaneous",
1050
+ };
1051
+ //# sourceMappingURL=metered-operations.js.map