@scenario-labs/sdk 0.1.3 → 0.2.0

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 (275) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +1 -1
  3. package/README.md +29 -29
  4. package/client.d.mts +35 -18
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +35 -18
  7. package/client.d.ts.map +1 -1
  8. package/client.js +88 -50
  9. package/client.js.map +1 -1
  10. package/client.mjs +86 -48
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/resource.d.mts +3 -3
  27. package/core/resource.d.mts.map +1 -1
  28. package/core/resource.d.ts +3 -3
  29. package/core/resource.d.ts.map +1 -1
  30. package/core/resource.js.map +1 -1
  31. package/core/resource.mjs.map +1 -1
  32. package/index.d.mts +8 -3
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts +8 -3
  35. package/index.d.ts.map +1 -1
  36. package/index.js +16 -6
  37. package/index.js.map +1 -1
  38. package/index.mjs +7 -3
  39. package/index.mjs.map +1 -1
  40. package/internal/parse.d.mts +2 -2
  41. package/internal/parse.d.mts.map +1 -1
  42. package/internal/parse.d.ts +2 -2
  43. package/internal/parse.d.ts.map +1 -1
  44. package/internal/parse.js.map +1 -1
  45. package/internal/parse.mjs.map +1 -1
  46. package/internal/request-options.d.mts +4 -0
  47. package/internal/request-options.d.mts.map +1 -1
  48. package/internal/request-options.d.ts +4 -0
  49. package/internal/request-options.d.ts.map +1 -1
  50. package/internal/request-options.js.map +1 -1
  51. package/internal/request-options.mjs.map +1 -1
  52. package/internal/shims.js +1 -1
  53. package/internal/shims.js.map +1 -1
  54. package/internal/shims.mjs +1 -1
  55. package/internal/shims.mjs.map +1 -1
  56. package/internal/uploads.d.mts +4 -4
  57. package/internal/uploads.d.mts.map +1 -1
  58. package/internal/uploads.d.ts +4 -4
  59. package/internal/uploads.d.ts.map +1 -1
  60. package/internal/uploads.js.map +1 -1
  61. package/internal/uploads.mjs.map +1 -1
  62. package/internal/utils/base64.js +2 -2
  63. package/internal/utils/base64.js.map +1 -1
  64. package/internal/utils/base64.mjs +3 -3
  65. package/internal/utils/base64.mjs.map +1 -1
  66. package/internal/utils/log.d.mts +3 -3
  67. package/internal/utils/log.d.mts.map +1 -1
  68. package/internal/utils/log.d.ts +3 -3
  69. package/internal/utils/log.d.ts.map +1 -1
  70. package/internal/utils/log.js.map +1 -1
  71. package/internal/utils/log.mjs.map +1 -1
  72. package/internal/utils/path.js +1 -1
  73. package/internal/utils/path.js.map +1 -1
  74. package/internal/utils/path.mjs +2 -2
  75. package/internal/utils/path.mjs.map +1 -1
  76. package/internal/utils/values.js +5 -5
  77. package/internal/utils/values.js.map +1 -1
  78. package/internal/utils/values.mjs +6 -6
  79. package/internal/utils/values.mjs.map +1 -1
  80. package/lib/generate.d.mts +19 -0
  81. package/lib/generate.d.mts.map +1 -0
  82. package/lib/generate.d.ts +19 -0
  83. package/lib/generate.d.ts.map +1 -0
  84. package/lib/generate.js +35 -0
  85. package/lib/generate.js.map +1 -0
  86. package/lib/generate.mjs +31 -0
  87. package/lib/generate.mjs.map +1 -0
  88. package/lib/job.d.mts +48 -0
  89. package/lib/job.d.mts.map +1 -0
  90. package/lib/job.d.ts +48 -0
  91. package/lib/job.d.ts.map +1 -0
  92. package/lib/job.js +50 -0
  93. package/lib/job.js.map +1 -0
  94. package/lib/job.mjs +45 -0
  95. package/lib/job.mjs.map +1 -0
  96. package/lib/models.d.mts +20 -0
  97. package/lib/models.d.mts.map +1 -0
  98. package/lib/models.d.ts +20 -0
  99. package/lib/models.d.ts.map +1 -0
  100. package/lib/models.js +28 -0
  101. package/lib/models.js.map +1 -0
  102. package/lib/models.mjs +23 -0
  103. package/lib/models.mjs.map +1 -0
  104. package/lib/scenario.d.mts +39 -0
  105. package/lib/scenario.d.mts.map +1 -0
  106. package/lib/scenario.d.ts +39 -0
  107. package/lib/scenario.d.ts.map +1 -0
  108. package/lib/scenario.js +46 -0
  109. package/lib/scenario.js.map +1 -0
  110. package/lib/scenario.mjs +42 -0
  111. package/lib/scenario.mjs.map +1 -0
  112. package/lib/workflow.d.mts +48 -0
  113. package/lib/workflow.d.mts.map +1 -0
  114. package/lib/workflow.d.ts +48 -0
  115. package/lib/workflow.d.ts.map +1 -0
  116. package/lib/workflow.js +59 -0
  117. package/lib/workflow.js.map +1 -0
  118. package/lib/workflow.mjs +54 -0
  119. package/lib/workflow.mjs.map +1 -0
  120. package/package.json +13 -3
  121. package/resources/assets/assets.d.mts +401 -96
  122. package/resources/assets/assets.d.mts.map +1 -1
  123. package/resources/assets/assets.d.ts +401 -96
  124. package/resources/assets/assets.d.ts.map +1 -1
  125. package/resources/assets/assets.js +2 -2
  126. package/resources/assets/assets.js.map +1 -1
  127. package/resources/assets/assets.mjs +2 -2
  128. package/resources/assets/assets.mjs.map +1 -1
  129. package/resources/assets/index.d.mts +1 -1
  130. package/resources/assets/index.d.mts.map +1 -1
  131. package/resources/assets/index.d.ts +1 -1
  132. package/resources/assets/index.d.ts.map +1 -1
  133. package/resources/assets/index.js.map +1 -1
  134. package/resources/assets/index.mjs.map +1 -1
  135. package/resources/assets/public.d.mts +30 -27
  136. package/resources/assets/public.d.mts.map +1 -1
  137. package/resources/assets/public.d.ts +30 -27
  138. package/resources/assets/public.d.ts.map +1 -1
  139. package/resources/assets/public.js +2 -2
  140. package/resources/assets/public.js.map +1 -1
  141. package/resources/assets/public.mjs +2 -2
  142. package/resources/assets/public.mjs.map +1 -1
  143. package/resources/collections/assets.d.mts +2 -8
  144. package/resources/collections/assets.d.mts.map +1 -1
  145. package/resources/collections/assets.d.ts +2 -8
  146. package/resources/collections/assets.d.ts.map +1 -1
  147. package/resources/collections/assets.js +2 -2
  148. package/resources/collections/assets.js.map +1 -1
  149. package/resources/collections/assets.mjs +2 -2
  150. package/resources/collections/assets.mjs.map +1 -1
  151. package/resources/collections/collections.d.mts +5 -5
  152. package/resources/collections/collections.d.mts.map +1 -1
  153. package/resources/collections/collections.d.ts +5 -5
  154. package/resources/collections/collections.d.ts.map +1 -1
  155. package/resources/collections/collections.js.map +1 -1
  156. package/resources/collections/collections.mjs.map +1 -1
  157. package/resources/collections/index.d.mts +2 -2
  158. package/resources/collections/index.d.mts.map +1 -1
  159. package/resources/collections/index.d.ts +2 -2
  160. package/resources/collections/index.d.ts.map +1 -1
  161. package/resources/collections/index.js.map +1 -1
  162. package/resources/collections/index.mjs +2 -2
  163. package/resources/collections/index.mjs.map +1 -1
  164. package/resources/collections/models.d.mts +2 -8
  165. package/resources/collections/models.d.mts.map +1 -1
  166. package/resources/collections/models.d.ts +2 -8
  167. package/resources/collections/models.d.ts.map +1 -1
  168. package/resources/collections/models.js +2 -2
  169. package/resources/collections/models.js.map +1 -1
  170. package/resources/collections/models.mjs +2 -2
  171. package/resources/collections/models.mjs.map +1 -1
  172. package/resources/generate.d.mts +4188 -1370
  173. package/resources/generate.d.mts.map +1 -1
  174. package/resources/generate.d.ts +4188 -1370
  175. package/resources/generate.d.ts.map +1 -1
  176. package/resources/index.d.mts +2 -2
  177. package/resources/index.d.mts.map +1 -1
  178. package/resources/index.d.ts +2 -2
  179. package/resources/index.d.ts.map +1 -1
  180. package/resources/index.js.map +1 -1
  181. package/resources/index.mjs.map +1 -1
  182. package/resources/jobs.d.mts +943 -33
  183. package/resources/jobs.d.mts.map +1 -1
  184. package/resources/jobs.d.ts +943 -33
  185. package/resources/jobs.d.ts.map +1 -1
  186. package/resources/jobs.js +3 -2
  187. package/resources/jobs.js.map +1 -1
  188. package/resources/jobs.mjs +3 -2
  189. package/resources/jobs.mjs.map +1 -1
  190. package/resources/models/description.d.mts +8 -8
  191. package/resources/models/description.d.mts.map +1 -1
  192. package/resources/models/description.d.ts +8 -8
  193. package/resources/models/description.d.ts.map +1 -1
  194. package/resources/models/examples.d.mts +640 -34
  195. package/resources/models/examples.d.mts.map +1 -1
  196. package/resources/models/examples.d.ts +640 -34
  197. package/resources/models/examples.d.ts.map +1 -1
  198. package/resources/models/models.d.mts +1323 -301
  199. package/resources/models/models.d.mts.map +1 -1
  200. package/resources/models/models.d.ts +1323 -301
  201. package/resources/models/models.d.ts.map +1 -1
  202. package/resources/models/models.js.map +1 -1
  203. package/resources/models/models.mjs.map +1 -1
  204. package/resources/models/train.d.mts +718 -90
  205. package/resources/models/train.d.mts.map +1 -1
  206. package/resources/models/train.d.ts +718 -90
  207. package/resources/models/train.d.ts.map +1 -1
  208. package/resources/models/train.js +9 -4
  209. package/resources/models/train.js.map +1 -1
  210. package/resources/models/train.mjs +9 -4
  211. package/resources/models/train.mjs.map +1 -1
  212. package/resources/models/training-images.d.mts +2 -2
  213. package/resources/models/training-images.d.mts.map +1 -1
  214. package/resources/models/training-images.d.ts +2 -2
  215. package/resources/models/training-images.d.ts.map +1 -1
  216. package/resources/search.d.mts +6 -31
  217. package/resources/search.d.mts.map +1 -1
  218. package/resources/search.d.ts +6 -31
  219. package/resources/search.d.ts.map +1 -1
  220. package/resources/search.js +6 -2
  221. package/resources/search.js.map +1 -1
  222. package/resources/search.mjs +6 -2
  223. package/resources/search.mjs.map +1 -1
  224. package/resources/tags.d.mts +1 -1
  225. package/resources/tags.d.ts +1 -1
  226. package/resources/usages.d.mts +401 -16
  227. package/resources/usages.d.mts.map +1 -1
  228. package/resources/usages.d.ts +401 -16
  229. package/resources/usages.d.ts.map +1 -1
  230. package/resources/workflows.d.mts +2738 -101
  231. package/resources/workflows.d.mts.map +1 -1
  232. package/resources/workflows.d.ts +2738 -101
  233. package/resources/workflows.d.ts.map +1 -1
  234. package/src/client.ts +102 -44
  235. package/src/core/api-promise.ts +4 -4
  236. package/src/core/error.ts +2 -2
  237. package/src/core/resource.ts +3 -3
  238. package/src/index.ts +8 -3
  239. package/src/internal/parse.ts +2 -2
  240. package/src/internal/request-options.ts +2 -0
  241. package/src/internal/shims.ts +1 -1
  242. package/src/internal/uploads.ts +5 -5
  243. package/src/internal/utils/base64.ts +3 -3
  244. package/src/internal/utils/log.ts +3 -3
  245. package/src/internal/utils/path.ts +2 -2
  246. package/src/internal/utils/values.ts +6 -6
  247. package/src/lib/generate.ts +77 -0
  248. package/src/lib/job.ts +78 -0
  249. package/src/lib/models.ts +27 -0
  250. package/src/lib/scenario.ts +39 -0
  251. package/src/lib/workflow.ts +90 -0
  252. package/src/resources/assets/assets.ts +742 -212
  253. package/src/resources/assets/index.ts +0 -1
  254. package/src/resources/assets/public.ts +151 -29
  255. package/src/resources/collections/assets.ts +2 -14
  256. package/src/resources/collections/collections.ts +3 -5
  257. package/src/resources/collections/index.ts +2 -14
  258. package/src/resources/collections/models.ts +2 -14
  259. package/src/resources/generate.ts +6254 -2217
  260. package/src/resources/index.ts +2 -3
  261. package/src/resources/jobs.ts +1355 -26
  262. package/src/resources/models/description.ts +50 -8
  263. package/src/resources/models/examples.ts +906 -56
  264. package/src/resources/models/models.ts +1867 -330
  265. package/src/resources/models/train.ts +976 -98
  266. package/src/resources/models/training-images.ts +2 -2
  267. package/src/resources/search.ts +13 -39
  268. package/src/resources/tags.ts +1 -1
  269. package/src/resources/usages.ts +544 -11
  270. package/src/resources/workflows.ts +4586 -914
  271. package/src/version.ts +1 -1
  272. package/version.d.mts +1 -1
  273. package/version.d.ts +1 -1
  274. package/version.js +1 -1
  275. package/version.mjs +1 -1
@@ -21,12 +21,16 @@ export class Usages extends APIResource {
21
21
  export interface UsageListResponse {
22
22
  activity?: Array<UsageListResponse.Activity>;
23
23
 
24
+ assetUsages?: Array<UsageListResponse.AssetUsage>;
25
+
24
26
  consumption?: Array<UsageListResponse.Consumption>;
25
27
 
26
28
  entities?: UsageListResponse.Entities;
27
29
 
28
30
  modelUsages?: Array<UsageListResponse.ModelUsage>;
29
31
 
32
+ nsfwUsages?: Array<UsageListResponse.NsfwUsage>;
33
+
30
34
  usages?: Array<UsageListResponse.Usage>;
31
35
  }
32
36
 
@@ -46,7 +50,12 @@ export namespace UsageListResponse {
46
50
  action:
47
51
  | 'asset'
48
52
  | 'asset-privacy'
53
+ | 'assistant-message'
49
54
  | 'background-removal'
55
+ | 'byok-remove-project-provider'
56
+ | 'byok-remove-provider'
57
+ | 'byok-set-project-provider'
58
+ | 'byok-set-provider'
50
59
  | 'captioning'
51
60
  | 'collection'
52
61
  | 'collection-assets'
@@ -61,6 +70,7 @@ export namespace UsageListResponse {
61
70
  | 'creative-unit-cost'
62
71
  | 'creative-unit-discount'
63
72
  | 'custom'
73
+ | 'custom-asset-created'
64
74
  | 'delete-asset'
65
75
  | 'delete-collection'
66
76
  | 'delete-collection-assets'
@@ -77,9 +87,13 @@ export namespace UsageListResponse {
77
87
  | 'delete-training-images'
78
88
  | 'describe-style'
79
89
  | 'detection'
90
+ | 'disable-project-model'
91
+ | 'disable-team-model'
80
92
  | 'download-assets'
81
93
  | 'download-model'
82
94
  | 'embed'
95
+ | 'enable-project-model'
96
+ | 'enable-team-model'
83
97
  | 'generative-fill'
84
98
  | 'image-prompt-editing'
85
99
  | 'images-generation'
@@ -165,6 +179,12 @@ export namespace UsageListResponse {
165
179
  */
166
180
  assetId?: string;
167
181
 
182
+ /**
183
+ * The BYOK provider information for this action Only set if the action is a BYOK
184
+ * action (byok-set-provider or byok-remove-provider)
185
+ */
186
+ byokProvider?: Data.ByokProvider;
187
+
168
188
  /**
169
189
  * The collection for this action
170
190
  */
@@ -185,6 +205,46 @@ export namespace UsageListResponse {
185
205
  */
186
206
  modelId?: string;
187
207
  }
208
+
209
+ export namespace Data {
210
+ /**
211
+ * The BYOK provider information for this action Only set if the action is a BYOK
212
+ * action (byok-set-provider or byok-remove-provider)
213
+ */
214
+ export interface ByokProvider {
215
+ id: string;
216
+
217
+ displayName: string;
218
+ }
219
+ }
220
+ }
221
+
222
+ export interface AssetUsage {
223
+ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
224
+
225
+ /**
226
+ * The data points
227
+ */
228
+ points: Array<AssetUsage.Point>;
229
+ }
230
+
231
+ export namespace AssetUsage {
232
+ export interface Point {
233
+ /**
234
+ * Number of assets created
235
+ */
236
+ count: number;
237
+
238
+ /**
239
+ * Number of assets created via an API key
240
+ */
241
+ countApiKey: number;
242
+
243
+ /**
244
+ * The UTC ISO date of the point
245
+ */
246
+ time: string;
247
+ }
188
248
  }
189
249
 
190
250
  /**
@@ -193,6 +253,16 @@ export namespace UsageListResponse {
193
253
  * There is no limit on the number of entries
194
254
  */
195
255
  export interface Consumption {
256
+ /**
257
+ * The Creative Units discount for the user
258
+ */
259
+ discount: number;
260
+
261
+ /**
262
+ * The total consumption for the user (value + discount)
263
+ */
264
+ total: number;
265
+
196
266
  /**
197
267
  * The unique identifier of the user
198
268
  */
@@ -311,8 +381,10 @@ export namespace UsageListResponse {
311
381
  | 'upscale-texture'
312
382
  | 'upscale-video'
313
383
  | 'vectorization'
384
+ | 'video23d'
314
385
  | 'video2img'
315
- | 'video2video';
386
+ | 'video2video'
387
+ | 'voice-clone';
316
388
  }
317
389
 
318
390
  export namespace Asset {
@@ -393,8 +465,10 @@ export namespace UsageListResponse {
393
465
  | 'upscale-texture'
394
466
  | 'upscale-video'
395
467
  | 'vectorization'
468
+ | 'video23d'
396
469
  | 'video2img'
397
- | 'video2video';
470
+ | 'video2video'
471
+ | 'voice-clone';
398
472
  }
399
473
 
400
474
  /**
@@ -441,7 +515,7 @@ export namespace UsageListResponse {
441
515
  /**
442
516
  * Bounding box dimensions [width, height, depth]
443
517
  */
444
- dimensions?: Array<unknown>;
518
+ dimensions?: Array<number>;
445
519
 
446
520
  /**
447
521
  * Duration of the media in seconds
@@ -558,6 +632,7 @@ export namespace UsageListResponse {
558
632
  | 'model-download'
559
633
  | 'model-import'
560
634
  | 'model-training'
635
+ | 'musubi-model-training'
561
636
  | 'openai-image-generation'
562
637
  | 'patch-image'
563
638
  | 'pixelate'
@@ -608,20 +683,37 @@ export namespace UsageListResponse {
608
683
  */
609
684
  assetIds?: Array<string>;
610
685
 
686
+ /**
687
+ * Eventual error for the job
688
+ */
689
+ error?: string | null;
690
+
611
691
  /**
612
692
  * The flow of the job. Only available for workflow jobs.
613
693
  */
614
694
  flow?: Array<Metadata.Flow>;
615
695
 
696
+ /**
697
+ * Actionable hint for the user explaining what went wrong and how to resolve it.
698
+ */
699
+ hint?: string;
700
+
616
701
  /**
617
702
  * The inputs for the job
618
703
  */
619
- input?: unknown;
704
+ input?: { [key: string]: unknown };
705
+
706
+ /**
707
+ * May contain the output of the job for specific custom models jobs. Only
708
+ * available for custom models which generate non-assets outputs. Example: LLM text
709
+ * results.
710
+ */
711
+ output?: { [key: string]: unknown };
620
712
 
621
713
  /**
622
- * The output of the job
714
+ * For voice-clone jobs: the ID of the model being trained.
623
715
  */
624
- output?: unknown;
716
+ outputModelId?: string;
625
717
 
626
718
  /**
627
719
  * The workflow ID of the job if job is part of a workflow.
@@ -651,8 +743,11 @@ export namespace UsageListResponse {
651
743
  */
652
744
  type:
653
745
  | 'custom-model'
746
+ | 'for-each'
654
747
  | 'generate-prompt'
748
+ | 'list'
655
749
  | 'logic'
750
+ | 'model'
656
751
  | 'remove-background'
657
752
  | 'transform'
658
753
  | 'user-approval'
@@ -663,17 +758,46 @@ export namespace UsageListResponse {
663
758
  */
664
759
  assets?: Array<Flow.Asset>;
665
760
 
761
+ /**
762
+ * Fixed number of iterations for a ForEach node. When set, the loop runs exactly
763
+ * `count` times regardless of array input. When not set, the loop iterates over
764
+ * the resolved array input. Only available for ForEach nodes.
765
+ */
766
+ count?: number;
767
+
666
768
  /**
667
769
  * The nodes that this node depends on. Only available for nodes that have
668
770
  * dependencies. Mainly used for user approval nodes.
669
771
  */
670
772
  dependsOn?: Array<string>;
671
773
 
774
+ /**
775
+ * If true, the outputs of this node will be included in the workflow job's final
776
+ * output. Only applicable to producing nodes (custom-model, inference, etc.). By
777
+ * default, only last nodes (nodes not referenced by other nodes) contribute to
778
+ * outputs. Set this to true to also include intermediate nodes in the final
779
+ * output. Note: This should only be set to `true` or left undefined.
780
+ */
781
+ includeOutputsInWorkflowJob?: true;
782
+
672
783
  /**
673
784
  * The inputs of the node.
674
785
  */
675
786
  inputs?: Array<Flow.Input>;
676
787
 
788
+ /**
789
+ * Statically-configured items for a List node. The node outputs this array as-is
790
+ * when executed. Only available for List nodes. The values can be strings,
791
+ * numbers, or asset IDs.
792
+ */
793
+ items?: Array<string>;
794
+
795
+ /**
796
+ * Zero-based index of the iteration this node copy belongs to. Set on
797
+ * dynamically-created copies of loop body nodes.
798
+ */
799
+ iterationIndex?: number;
800
+
677
801
  /**
678
802
  * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
679
803
  * only available for nodes started. A node "Pending" for a running workflow job is
@@ -691,11 +815,29 @@ export namespace UsageListResponse {
691
815
  */
692
816
  logicType?: 'if-else';
693
817
 
818
+ /**
819
+ * IDs of the body template nodes that belong to this ForEach loop. At runtime
820
+ * these templates are cloned once per iteration and marked Skipped. Only available
821
+ * for ForEach nodes.
822
+ */
823
+ loopBodyNodeIds?: Array<string>;
824
+
825
+ /**
826
+ * ID of the ForEach node that spawned this iteration copy. Set on
827
+ * dynamically-created copies of loop body nodes.
828
+ */
829
+ loopNodeId?: string;
830
+
694
831
  /**
695
832
  * The model id for the node. Mainly used for custom model tasks.
696
833
  */
697
834
  modelId?: string;
698
835
 
836
+ /**
837
+ * The output of the node. Only available for logic nodes.
838
+ */
839
+ output?: unknown;
840
+
699
841
  /**
700
842
  * The workflow id for the node. Mainly used for workflow tasks.
701
843
  */
@@ -756,6 +898,11 @@ export namespace UsageListResponse {
756
898
  */
757
899
  costImpact?: boolean;
758
900
 
901
+ /**
902
+ * The default value for the input
903
+ */
904
+ default?: unknown;
905
+
759
906
  /**
760
907
  * Help text displayed in the UI to provide additional information about the input
761
908
  */
@@ -777,11 +924,20 @@ export namespace UsageListResponse {
777
924
  * the same as the current object. This is only available for type inputs_array
778
925
  * inputs.
779
926
  */
780
- inputs?: Array<unknown>;
927
+ inputs?: Array<{ [key: string]: unknown }>;
928
+
929
+ /**
930
+ * The configured items for inputs_array type inputs. Each item is an array of
931
+ * SubNodeInput that need ref/value resolution. Only available for inputs_array
932
+ * type.
933
+ */
934
+ items?: Array<Array<Input.Item>>;
781
935
 
782
936
  /**
783
937
  * The asset kind of the input. Only taken into account for \`file\` and
784
- * \`file_array\` input types.
938
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
939
+ * not able to create the asset on the flight on API side with dataurl without
940
+ * data:kind, prefix
785
941
  */
786
942
  kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
787
943
 
@@ -807,6 +963,13 @@ export namespace UsageListResponse {
807
963
  */
808
964
  maxLength?: number;
809
965
 
966
+ /**
967
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
968
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
969
+ * creation time.
970
+ */
971
+ maxSize?: number;
972
+
810
973
  /**
811
974
  * The minimum allowed value. Only available for \`number\` and array input types.
812
975
  */
@@ -824,6 +987,7 @@ export namespace UsageListResponse {
824
987
  */
825
988
  modelTypes?: Array<
826
989
  | 'custom'
990
+ | 'elevenlabs-voice'
827
991
  | 'flux.1'
828
992
  | 'flux.1-composition'
829
993
  | 'flux.1-kontext-dev'
@@ -833,14 +997,32 @@ export namespace UsageListResponse {
833
997
  | 'flux.1-lora'
834
998
  | 'flux.1-pro'
835
999
  | 'flux.1.1-pro-ultra'
1000
+ | 'flux.2-dev-edit-lora'
1001
+ | 'flux.2-dev-lora'
1002
+ | 'flux.2-klein-4b-edit-lora'
1003
+ | 'flux.2-klein-4b-lora'
1004
+ | 'flux.2-klein-9b-edit-lora'
1005
+ | 'flux.2-klein-9b-lora'
1006
+ | 'flux.2-klein-base-4b-edit-lora'
1007
+ | 'flux.2-klein-base-4b-lora'
1008
+ | 'flux.2-klein-base-9b-edit-lora'
1009
+ | 'flux.2-klein-base-9b-lora'
836
1010
  | 'flux1.1-pro'
837
1011
  | 'gpt-image-1'
1012
+ | 'qwen-image-2512-lora'
1013
+ | 'qwen-image-edit-2509-lora'
1014
+ | 'qwen-image-edit-2511-lora'
1015
+ | 'qwen-image-edit-lora'
1016
+ | 'qwen-image-lora'
838
1017
  | 'sd-1_5'
839
1018
  | 'sd-1_5-composition'
840
1019
  | 'sd-1_5-lora'
841
1020
  | 'sd-xl'
842
1021
  | 'sd-xl-composition'
843
1022
  | 'sd-xl-lora'
1023
+ | 'zimage-de-turbo-lora'
1024
+ | 'zimage-lora'
1025
+ | 'zimage-turbo-lora'
844
1026
  >;
845
1027
 
846
1028
  /**
@@ -892,9 +1074,316 @@ export namespace UsageListResponse {
892
1074
  * The step increment for numeric inputs. Only available for \`number\` input type.
893
1075
  */
894
1076
  step?: number;
1077
+
1078
+ /**
1079
+ * The value of the input. This is the value of the input that will be used to run
1080
+ * the node. Only available for flows managed by a WorkflowJob.
1081
+ */
1082
+ value?: unknown;
895
1083
  }
896
1084
 
897
1085
  export namespace Input {
1086
+ /**
1087
+ * A sub-input within an inputs_array item. Same as NodeInput but without the
1088
+ * recursive items field.
1089
+ */
1090
+ export interface Item {
1091
+ /**
1092
+ * The name that must be user to call the model through the API
1093
+ */
1094
+ name: string;
1095
+
1096
+ /**
1097
+ * The data type of the input
1098
+ */
1099
+ type:
1100
+ | 'boolean'
1101
+ | 'file'
1102
+ | 'file_array'
1103
+ | 'inputs_array'
1104
+ | 'model'
1105
+ | 'model_array'
1106
+ | 'number'
1107
+ | 'number_array'
1108
+ | 'string'
1109
+ | 'string_array';
1110
+
1111
+ /**
1112
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
1113
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
1114
+ * dropdown.
1115
+ */
1116
+ allowedValues?: Array<unknown>;
1117
+
1118
+ /**
1119
+ * Specifies the background behavior for the input. Only available for \`file\` and
1120
+ * \`file_array\` input types with kind \`image\`.
1121
+ */
1122
+ backgroundBehavior?: 'opaque' | 'transparent';
1123
+
1124
+ /**
1125
+ * Whether the input is a color or not. Only available for \`string\` input type.
1126
+ */
1127
+ color?: boolean;
1128
+
1129
+ /**
1130
+ * Whether this input affects the model's cost calculation
1131
+ */
1132
+ costImpact?: boolean;
1133
+
1134
+ /**
1135
+ * The default value for the input
1136
+ */
1137
+ default?: unknown;
1138
+
1139
+ /**
1140
+ * Help text displayed in the UI to provide additional information about the input
1141
+ */
1142
+ description?: string;
1143
+
1144
+ /**
1145
+ * Used to visually group inputs together in the UI. Inputs with the same group
1146
+ * value appear consecutively in the UI.
1147
+ */
1148
+ group?: string;
1149
+
1150
+ /**
1151
+ * Hint text displayed in the UI as a tooltip to guide the user
1152
+ */
1153
+ hint?: string;
1154
+
1155
+ /**
1156
+ * The list of inputs which form an object within a container array. All inputs are
1157
+ * the same as the current object. This is only available for type inputs_array
1158
+ * inputs.
1159
+ */
1160
+ inputs?: Array<{ [key: string]: unknown }>;
1161
+
1162
+ /**
1163
+ * The asset kind of the input. Only taken into account for \`file\` and
1164
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
1165
+ * not able to create the asset on the flight on API side with dataurl without
1166
+ * data:kind, prefix
1167
+ */
1168
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
1169
+
1170
+ /**
1171
+ * The label displayed in the UI for this input
1172
+ */
1173
+ label?: string;
1174
+
1175
+ /**
1176
+ * The name of the file input field to use as the mask source
1177
+ */
1178
+ maskFrom?: string;
1179
+
1180
+ /**
1181
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
1182
+ * types.
1183
+ */
1184
+ max?: number;
1185
+
1186
+ /**
1187
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
1188
+ * \`string_array\`.
1189
+ */
1190
+ maxLength?: number;
1191
+
1192
+ /**
1193
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
1194
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
1195
+ * creation time.
1196
+ */
1197
+ maxSize?: number;
1198
+
1199
+ /**
1200
+ * The minimum allowed value. Only available for \`number\` and array input types.
1201
+ */
1202
+ min?: number;
1203
+
1204
+ /**
1205
+ * The minimum allowed length for string inputs. Also applies to each item in
1206
+ * \`string_array\`.
1207
+ */
1208
+ minLength?: number;
1209
+
1210
+ /**
1211
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
1212
+ * available for \`model_array\` input type.
1213
+ */
1214
+ modelTypes?: Array<
1215
+ | 'custom'
1216
+ | 'elevenlabs-voice'
1217
+ | 'flux.1'
1218
+ | 'flux.1-composition'
1219
+ | 'flux.1-kontext-dev'
1220
+ | 'flux.1-kontext-lora'
1221
+ | 'flux.1-krea-dev'
1222
+ | 'flux.1-krea-lora'
1223
+ | 'flux.1-lora'
1224
+ | 'flux.1-pro'
1225
+ | 'flux.1.1-pro-ultra'
1226
+ | 'flux.2-dev-edit-lora'
1227
+ | 'flux.2-dev-lora'
1228
+ | 'flux.2-klein-4b-edit-lora'
1229
+ | 'flux.2-klein-4b-lora'
1230
+ | 'flux.2-klein-9b-edit-lora'
1231
+ | 'flux.2-klein-9b-lora'
1232
+ | 'flux.2-klein-base-4b-edit-lora'
1233
+ | 'flux.2-klein-base-4b-lora'
1234
+ | 'flux.2-klein-base-9b-edit-lora'
1235
+ | 'flux.2-klein-base-9b-lora'
1236
+ | 'flux1.1-pro'
1237
+ | 'gpt-image-1'
1238
+ | 'qwen-image-2512-lora'
1239
+ | 'qwen-image-edit-2509-lora'
1240
+ | 'qwen-image-edit-2511-lora'
1241
+ | 'qwen-image-edit-lora'
1242
+ | 'qwen-image-lora'
1243
+ | 'sd-1_5'
1244
+ | 'sd-1_5-composition'
1245
+ | 'sd-1_5-lora'
1246
+ | 'sd-xl'
1247
+ | 'sd-xl-composition'
1248
+ | 'sd-xl-lora'
1249
+ | 'zimage-de-turbo-lora'
1250
+ | 'zimage-lora'
1251
+ | 'zimage-turbo-lora'
1252
+ >;
1253
+
1254
+ /**
1255
+ * Whether this input represents a parent asset to assign to the produced assets.
1256
+ * Only available for \`file\` and \`file_array\` input types.
1257
+ *
1258
+ * For \`file_array\`, the parent asset is the first item in the array.
1259
+ */
1260
+ parent?: boolean;
1261
+
1262
+ /**
1263
+ * Placeholder text for the input. Only available for 'string' input type.
1264
+ */
1265
+ placeholder?: string;
1266
+
1267
+ /**
1268
+ * Whether the input is a prompt. When true, displays as a text area with prompt
1269
+ * spark feature. Only available for \`string\` input type.
1270
+ */
1271
+ prompt?: boolean;
1272
+
1273
+ /**
1274
+ * Whether the input is used with prompt spark. Only available for \`string\` input
1275
+ * type.
1276
+ */
1277
+ promptSpark?: boolean;
1278
+
1279
+ /**
1280
+ * The reference to another input or output of the same workflow. Must have at
1281
+ * least one of node or conditional.
1282
+ */
1283
+ ref?: Item.Ref;
1284
+
1285
+ /**
1286
+ * Set of rules that describes when this input is required:
1287
+ *
1288
+ * - \`always\`: Input is always required
1289
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1290
+ * defined
1291
+ * - \`ifDefined\`: Input is required when another specified input is defined
1292
+ * - \`conditionalValues\`: Input is required when another input has a specific
1293
+ * value
1294
+ *
1295
+ * By default, the input is not required.
1296
+ */
1297
+ required?: Item.Required;
1298
+
1299
+ /**
1300
+ * The step increment for numeric inputs. Only available for \`number\` input type.
1301
+ */
1302
+ step?: number;
1303
+
1304
+ /**
1305
+ * The value of the input. This is the value of the input that will be used to run
1306
+ * the node. Only available for flows managed by a WorkflowJob.
1307
+ */
1308
+ value?: unknown;
1309
+ }
1310
+
1311
+ export namespace Item {
1312
+ /**
1313
+ * The reference to another input or output of the same workflow. Must have at
1314
+ * least one of node or conditional.
1315
+ */
1316
+ export interface Ref {
1317
+ /**
1318
+ * The conditional nodes to reference. If the conditional nodes are successful, the
1319
+ * node will be successful. If the conditional nodes are skipped, the node will be
1320
+ * skipped. Contains an array of node ids used to check the status of the nodes.
1321
+ */
1322
+ conditional?: Array<string>;
1323
+
1324
+ /**
1325
+ * This is the desired node output value if ref is an if/else node.
1326
+ */
1327
+ equal?: string;
1328
+
1329
+ /**
1330
+ * The name of the input or output to reference. If the type is 'workflow', the
1331
+ * name is the name of the input of the workflow is required If the type is 'node',
1332
+ * the name is not mandatory, except if you want all outputs of the node. To get
1333
+ * all outputs of a node, you can use the name 'all'.
1334
+ */
1335
+ name?: string;
1336
+
1337
+ /**
1338
+ * The node id or 'workflow' if the source is a workflow input.
1339
+ */
1340
+ node?: string;
1341
+ }
1342
+
1343
+ /**
1344
+ * Set of rules that describes when this input is required:
1345
+ *
1346
+ * - \`always\`: Input is always required
1347
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1348
+ * defined
1349
+ * - \`ifDefined\`: Input is required when another specified input is defined
1350
+ * - \`conditionalValues\`: Input is required when another input has a specific
1351
+ * value
1352
+ *
1353
+ * By default, the input is not required.
1354
+ */
1355
+ export interface Required {
1356
+ /**
1357
+ * Whether the input is always required
1358
+ */
1359
+ always?: boolean;
1360
+
1361
+ /**
1362
+ * Makes this input required when another input has a specific value:
1363
+ *
1364
+ * - Key: name of the input to check
1365
+ * - Value: operation and allowed values that trigger the requirement
1366
+ */
1367
+ conditionalValues?: unknown;
1368
+
1369
+ /**
1370
+ * Makes this input required when another input is defined:
1371
+ *
1372
+ * - Key: name of the input that must be defined
1373
+ * - Value: message to display when this input is required
1374
+ */
1375
+ ifDefined?: unknown;
1376
+
1377
+ /**
1378
+ * Makes this input required when another input is not defined:
1379
+ *
1380
+ * - Key: name of the input that must be undefined
1381
+ * - Value: message to display when this input is required
1382
+ */
1383
+ ifNotDefined?: unknown;
1384
+ }
1385
+ }
1386
+
898
1387
  /**
899
1388
  * The reference to another input or output of the same workflow. Must have at
900
1389
  * least one of node or conditional.
@@ -1113,6 +1602,16 @@ export namespace UsageListResponse {
1113
1602
 
1114
1603
  export namespace ModelUsage {
1115
1604
  export interface Point {
1605
+ /**
1606
+ * Cost for model usage for API key only
1607
+ */
1608
+ apiKeyCost: number;
1609
+
1610
+ /**
1611
+ * The discount for model usage for API key only
1612
+ */
1613
+ apiKeyDiscount: number;
1614
+
1116
1615
  /**
1117
1616
  * Cost for model usage
1118
1617
  */
@@ -1135,6 +1634,34 @@ export namespace UsageListResponse {
1135
1634
  }
1136
1635
  }
1137
1636
 
1637
+ export interface NsfwUsage {
1638
+ label: string;
1639
+
1640
+ /**
1641
+ * The data points
1642
+ */
1643
+ points: Array<NsfwUsage.Point>;
1644
+ }
1645
+
1646
+ export namespace NsfwUsage {
1647
+ export interface Point {
1648
+ /**
1649
+ * Number of NSFW assets created
1650
+ */
1651
+ count: number;
1652
+
1653
+ /**
1654
+ * Number of NSFW assets created via an API key
1655
+ */
1656
+ countApiKey: number;
1657
+
1658
+ /**
1659
+ * The UTC ISO date of the point
1660
+ */
1661
+ time: string;
1662
+ }
1663
+ }
1664
+
1138
1665
  export interface Usage {
1139
1666
  /**
1140
1667
  * Granularity for points (example: "1d", "1h", "1m", "15m")
@@ -1156,6 +1683,7 @@ export namespace UsageListResponse {
1156
1683
  | 'creative-unit-cost'
1157
1684
  | 'creative-unit-discount'
1158
1685
  | 'custom'
1686
+ | 'custom-asset-created'
1159
1687
  | 'detection'
1160
1688
  | 'image-prompt-editing'
1161
1689
  | 'images-generation'
@@ -1174,6 +1702,11 @@ export namespace UsageListResponse {
1174
1702
 
1175
1703
  export namespace Usage {
1176
1704
  export interface Point {
1705
+ /**
1706
+ * Value of the point for API key only
1707
+ */
1708
+ apiKey: string;
1709
+
1177
1710
  /**
1178
1711
  * The UTC ISO date of the point
1179
1712
  */
@@ -1192,7 +1725,7 @@ export interface UsageListParams {
1192
1725
  * The offset for the activity data. Default is 0. If bad offset or empty, 0 will
1193
1726
  * be returned. Must be a positive integer.
1194
1727
  */
1195
- activityOffset?: string;
1728
+ activityOffset?: number;
1196
1729
 
1197
1730
  /**
1198
1731
  * The end date of the usage in ISO 8601 format. If not provided, use default
@@ -1216,13 +1749,13 @@ export interface UsageListParams {
1216
1749
  * The time range of the usage. If not provided, use default timeRange. If
1217
1750
  * startDate and endDate provided, timeRange is ignored.
1218
1751
  */
1219
- timeRange?: string;
1752
+ timeRange?: 'last-hour' | 'last-day' | 'last-three-days' | 'last-seven-days' | 'last-thirty-one-days';
1220
1753
 
1221
1754
  /**
1222
1755
  * The type of the usage data. Can be one or more comma separated values. Default
1223
1756
  * is all types. If bad type or empty, all types will be returned.
1224
1757
  */
1225
- type?: string;
1758
+ type?: 'usages' | 'activity' | 'consumption' | 'model-usages' | 'asset-usages' | 'nsfw-usages';
1226
1759
 
1227
1760
  /**
1228
1761
  * The unique identifier of the user for the usage. If not provided, returns all