@runwayml/sdk 4.13.2 → 4.14.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 (199) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/client.d.mts +3 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/character-performance.d.mts +17 -0
  12. package/resources/character-performance.d.mts.map +1 -1
  13. package/resources/character-performance.d.ts +17 -0
  14. package/resources/character-performance.d.ts.map +1 -1
  15. package/resources/generate/audio.d.mts +46 -24
  16. package/resources/generate/audio.d.mts.map +1 -1
  17. package/resources/generate/audio.d.ts +46 -24
  18. package/resources/generate/audio.d.ts.map +1 -1
  19. package/resources/generate/audio.js.map +1 -1
  20. package/resources/generate/audio.mjs.map +1 -1
  21. package/resources/generate/generate.d.mts +2 -2
  22. package/resources/generate/generate.d.mts.map +1 -1
  23. package/resources/generate/generate.d.ts +2 -2
  24. package/resources/generate/generate.d.ts.map +1 -1
  25. package/resources/generate/generate.js.map +1 -1
  26. package/resources/generate/generate.mjs.map +1 -1
  27. package/resources/generate/image.d.mts +21 -0
  28. package/resources/generate/image.d.mts.map +1 -1
  29. package/resources/generate/image.d.ts +21 -0
  30. package/resources/generate/image.d.ts.map +1 -1
  31. package/resources/generate/index.d.mts +1 -1
  32. package/resources/generate/index.d.mts.map +1 -1
  33. package/resources/generate/index.d.ts +1 -1
  34. package/resources/generate/index.d.ts.map +1 -1
  35. package/resources/generate/index.js.map +1 -1
  36. package/resources/generate/index.mjs +1 -1
  37. package/resources/generate/index.mjs.map +1 -1
  38. package/resources/generate/video.d.mts +21 -0
  39. package/resources/generate/video.d.mts.map +1 -1
  40. package/resources/generate/video.d.ts +21 -0
  41. package/resources/generate/video.d.ts.map +1 -1
  42. package/resources/image-to-video.d.mts +118 -27
  43. package/resources/image-to-video.d.mts.map +1 -1
  44. package/resources/image-to-video.d.ts +118 -27
  45. package/resources/image-to-video.d.ts.map +1 -1
  46. package/resources/image-upscale.d.mts +17 -0
  47. package/resources/image-upscale.d.mts.map +1 -1
  48. package/resources/image-upscale.d.ts +17 -0
  49. package/resources/image-upscale.d.ts.map +1 -1
  50. package/resources/index.d.mts +2 -2
  51. package/resources/index.d.mts.map +1 -1
  52. package/resources/index.d.ts +2 -2
  53. package/resources/index.d.ts.map +1 -1
  54. package/resources/index.js +1 -1
  55. package/resources/index.js.map +1 -1
  56. package/resources/index.mjs +1 -1
  57. package/resources/index.mjs.map +1 -1
  58. package/resources/organization/index.d.mts +3 -0
  59. package/resources/organization/index.d.mts.map +1 -0
  60. package/resources/organization/index.d.ts +3 -0
  61. package/resources/organization/index.d.ts.map +1 -0
  62. package/resources/organization/index.js +9 -0
  63. package/resources/organization/index.js.map +1 -0
  64. package/resources/organization/index.mjs +4 -0
  65. package/resources/organization/index.mjs.map +1 -0
  66. package/resources/organization/organization.d.mts +154 -0
  67. package/resources/organization/organization.d.mts.map +1 -0
  68. package/resources/organization/organization.d.ts +154 -0
  69. package/resources/organization/organization.d.ts.map +1 -0
  70. package/resources/organization/organization.js +32 -0
  71. package/resources/organization/organization.js.map +1 -0
  72. package/resources/organization/organization.mjs +27 -0
  73. package/resources/organization/organization.mjs.map +1 -0
  74. package/resources/organization/webapp/audit-logs.d.mts +216 -0
  75. package/resources/organization/webapp/audit-logs.d.mts.map +1 -0
  76. package/resources/organization/webapp/audit-logs.d.ts +216 -0
  77. package/resources/organization/webapp/audit-logs.d.ts.map +1 -0
  78. package/resources/organization/webapp/audit-logs.js +30 -0
  79. package/resources/organization/webapp/audit-logs.js.map +1 -0
  80. package/resources/organization/webapp/audit-logs.mjs +26 -0
  81. package/resources/organization/webapp/audit-logs.mjs.map +1 -0
  82. package/resources/organization/webapp/index.d.mts +3 -0
  83. package/resources/organization/webapp/index.d.mts.map +1 -0
  84. package/resources/organization/webapp/index.d.ts +3 -0
  85. package/resources/organization/webapp/index.d.ts.map +1 -0
  86. package/resources/organization/webapp/index.js +9 -0
  87. package/resources/organization/webapp/index.js.map +1 -0
  88. package/resources/organization/webapp/index.mjs +4 -0
  89. package/resources/organization/webapp/index.mjs.map +1 -0
  90. package/resources/organization/webapp/webapp.d.mts +73 -0
  91. package/resources/organization/webapp/webapp.d.mts.map +1 -0
  92. package/resources/organization/webapp/webapp.d.ts +73 -0
  93. package/resources/organization/webapp/webapp.d.ts.map +1 -0
  94. package/resources/organization/webapp/webapp.js +30 -0
  95. package/resources/organization/webapp/webapp.js.map +1 -0
  96. package/resources/organization/webapp/webapp.mjs +25 -0
  97. package/resources/organization/webapp/webapp.mjs.map +1 -0
  98. package/resources/organization/webapp.d.mts +2 -0
  99. package/resources/organization/webapp.d.mts.map +1 -0
  100. package/resources/organization/webapp.d.ts +2 -0
  101. package/resources/organization/webapp.d.ts.map +1 -0
  102. package/resources/organization/webapp.js +6 -0
  103. package/resources/organization/webapp.js.map +1 -0
  104. package/resources/organization/webapp.mjs +3 -0
  105. package/resources/organization/webapp.mjs.map +1 -0
  106. package/resources/organization.d.mts +1 -149
  107. package/resources/organization.d.mts.map +1 -1
  108. package/resources/organization.d.ts +1 -149
  109. package/resources/organization.d.ts.map +1 -1
  110. package/resources/organization.js +2 -20
  111. package/resources/organization.js.map +1 -1
  112. package/resources/organization.mjs +1 -18
  113. package/resources/organization.mjs.map +1 -1
  114. package/resources/recipes.d.mts +119 -0
  115. package/resources/recipes.d.mts.map +1 -1
  116. package/resources/recipes.d.ts +119 -0
  117. package/resources/recipes.d.ts.map +1 -1
  118. package/resources/routers.d.mts +194 -1
  119. package/resources/routers.d.mts.map +1 -1
  120. package/resources/routers.d.ts +194 -1
  121. package/resources/routers.d.ts.map +1 -1
  122. package/resources/routers.js +10 -0
  123. package/resources/routers.js.map +1 -1
  124. package/resources/routers.mjs +10 -0
  125. package/resources/routers.mjs.map +1 -1
  126. package/resources/sound-effect.d.mts +17 -0
  127. package/resources/sound-effect.d.mts.map +1 -1
  128. package/resources/sound-effect.d.ts +17 -0
  129. package/resources/sound-effect.d.ts.map +1 -1
  130. package/resources/speech-to-speech.d.mts +17 -0
  131. package/resources/speech-to-speech.d.mts.map +1 -1
  132. package/resources/speech-to-speech.d.ts +17 -0
  133. package/resources/speech-to-speech.d.ts.map +1 -1
  134. package/resources/tasks.d.mts +90 -0
  135. package/resources/tasks.d.mts.map +1 -1
  136. package/resources/tasks.d.ts +90 -0
  137. package/resources/tasks.d.ts.map +1 -1
  138. package/resources/text-to-image.d.mts +22 -0
  139. package/resources/text-to-image.d.mts.map +1 -1
  140. package/resources/text-to-image.d.ts +22 -0
  141. package/resources/text-to-image.d.ts.map +1 -1
  142. package/resources/text-to-speech.d.mts +77 -1
  143. package/resources/text-to-speech.d.mts.map +1 -1
  144. package/resources/text-to-speech.d.ts +77 -1
  145. package/resources/text-to-speech.d.ts.map +1 -1
  146. package/resources/text-to-video.d.mts +170 -17
  147. package/resources/text-to-video.d.mts.map +1 -1
  148. package/resources/text-to-video.d.ts +170 -17
  149. package/resources/text-to-video.d.ts.map +1 -1
  150. package/resources/video-to-video.d.mts +199 -7
  151. package/resources/video-to-video.d.mts.map +1 -1
  152. package/resources/video-to-video.d.ts +199 -7
  153. package/resources/video-to-video.d.ts.map +1 -1
  154. package/resources/video-upscale.d.mts +17 -0
  155. package/resources/video-upscale.d.mts.map +1 -1
  156. package/resources/video-upscale.d.ts +17 -0
  157. package/resources/video-upscale.d.ts.map +1 -1
  158. package/resources/voice-dubbing.d.mts +17 -0
  159. package/resources/voice-dubbing.d.mts.map +1 -1
  160. package/resources/voice-dubbing.d.ts +17 -0
  161. package/resources/voice-dubbing.d.ts.map +1 -1
  162. package/resources/voice-isolation.d.mts +17 -0
  163. package/resources/voice-isolation.d.mts.map +1 -1
  164. package/resources/voice-isolation.d.ts +17 -0
  165. package/resources/voice-isolation.d.ts.map +1 -1
  166. package/src/client.ts +12 -6
  167. package/src/resources/character-performance.ts +19 -0
  168. package/src/resources/generate/audio.ts +57 -27
  169. package/src/resources/generate/generate.ts +3 -1
  170. package/src/resources/generate/image.ts +24 -0
  171. package/src/resources/generate/index.ts +7 -1
  172. package/src/resources/generate/video.ts +24 -0
  173. package/src/resources/image-to-video.ts +147 -27
  174. package/src/resources/image-upscale.ts +19 -0
  175. package/src/resources/index.ts +4 -1
  176. package/src/resources/organization/index.ts +14 -0
  177. package/src/resources/organization/organization.ts +307 -0
  178. package/src/resources/organization/webapp/audit-logs.ts +440 -0
  179. package/src/resources/organization/webapp/index.ts +16 -0
  180. package/src/resources/organization/webapp/webapp.ts +118 -0
  181. package/src/resources/organization/webapp.ts +3 -0
  182. package/src/resources/organization.ts +1 -283
  183. package/src/resources/recipes.ts +133 -0
  184. package/src/resources/routers.ts +247 -0
  185. package/src/resources/sound-effect.ts +19 -0
  186. package/src/resources/speech-to-speech.ts +19 -0
  187. package/src/resources/tasks.ts +102 -0
  188. package/src/resources/text-to-image.ts +25 -0
  189. package/src/resources/text-to-speech.ts +142 -1
  190. package/src/resources/text-to-video.ts +208 -17
  191. package/src/resources/video-to-video.ts +246 -7
  192. package/src/resources/video-upscale.ts +19 -0
  193. package/src/resources/voice-dubbing.ts +19 -0
  194. package/src/resources/voice-isolation.ts +19 -0
  195. package/src/version.ts +1 -1
  196. package/version.d.mts +1 -1
  197. package/version.d.ts +1 -1
  198. package/version.js +1 -1
  199. package/version.mjs +1 -1
@@ -56,10 +56,27 @@ export class Routers extends APIResource {
56
56
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
57
57
  });
58
58
  }
59
+
60
+ /**
61
+ * Paginated routing history for live Model Router requests (successful routes and
62
+ * failures). Playground dry runs are not recorded.
63
+ */
64
+ listRequests(
65
+ id: string,
66
+ query: RouterListRequestsParams,
67
+ options?: RequestOptions,
68
+ ): PagePromise<RouterListRequestsResponsesCursorPage, RouterListRequestsResponse> {
69
+ return this._client.getAPIList(path`/v1/routers/${id}/requests`, CursorPage<RouterListRequestsResponse>, {
70
+ query,
71
+ ...options,
72
+ });
73
+ }
59
74
  }
60
75
 
61
76
  export type RouterListResponsesCursorPage = CursorPage<RouterListResponse>;
62
77
 
78
+ export type RouterListRequestsResponsesCursorPage = CursorPage<RouterListRequestsResponse>;
79
+
63
80
  export interface RouterCreateResponse {
64
81
  /**
65
82
  * The Model Router's primary key ID (UUID). Use it to manage this router via the
@@ -111,6 +128,12 @@ export namespace RouterCreateResponse {
111
128
  */
112
129
  schemaVersion: 1;
113
130
 
131
+ /**
132
+ * Opt-in behavior for what routing should do when the preferred model cannot start
133
+ * immediately.
134
+ */
135
+ fallback?: Settings.Fallback;
136
+
114
137
  /**
115
138
  * Optional per-modality credit caps, applied per generated output. Models whose
116
139
  * estimated per-output cost exceeds the cap are excluded.
@@ -131,6 +154,20 @@ export namespace RouterCreateResponse {
131
154
  }
132
155
 
133
156
  export namespace Settings {
157
+ /**
158
+ * Opt-in behavior for what routing should do when the preferred model cannot start
159
+ * immediately.
160
+ */
161
+ export interface Fallback {
162
+ /**
163
+ * When true, if the account is at its concurrency limit on the preferred model,
164
+ * routing skips it and picks the next-best eligible model instead of queueing. If
165
+ * every eligible model is at its limit, the original best-ranked model is used and
166
+ * the task queues as usual.
167
+ */
168
+ onCapacity?: boolean;
169
+ }
170
+
134
171
  /**
135
172
  * Optional per-modality credit caps, applied per generated output. Models whose
136
173
  * estimated per-output cost exceeds the cap are excluded.
@@ -207,6 +244,12 @@ export namespace RouterRetrieveResponse {
207
244
  */
208
245
  schemaVersion: 1;
209
246
 
247
+ /**
248
+ * Opt-in behavior for what routing should do when the preferred model cannot start
249
+ * immediately.
250
+ */
251
+ fallback?: Settings.Fallback;
252
+
210
253
  /**
211
254
  * Optional per-modality credit caps, applied per generated output. Models whose
212
255
  * estimated per-output cost exceeds the cap are excluded.
@@ -227,6 +270,20 @@ export namespace RouterRetrieveResponse {
227
270
  }
228
271
 
229
272
  export namespace Settings {
273
+ /**
274
+ * Opt-in behavior for what routing should do when the preferred model cannot start
275
+ * immediately.
276
+ */
277
+ export interface Fallback {
278
+ /**
279
+ * When true, if the account is at its concurrency limit on the preferred model,
280
+ * routing skips it and picks the next-best eligible model instead of queueing. If
281
+ * every eligible model is at its limit, the original best-ranked model is used and
282
+ * the task queues as usual.
283
+ */
284
+ onCapacity?: boolean;
285
+ }
286
+
230
287
  /**
231
288
  * Optional per-modality credit caps, applied per generated output. Models whose
232
289
  * estimated per-output cost exceeds the cap are excluded.
@@ -303,6 +360,12 @@ export namespace RouterUpdateResponse {
303
360
  */
304
361
  schemaVersion: 1;
305
362
 
363
+ /**
364
+ * Opt-in behavior for what routing should do when the preferred model cannot start
365
+ * immediately.
366
+ */
367
+ fallback?: Settings.Fallback;
368
+
306
369
  /**
307
370
  * Optional per-modality credit caps, applied per generated output. Models whose
308
371
  * estimated per-output cost exceeds the cap are excluded.
@@ -323,6 +386,20 @@ export namespace RouterUpdateResponse {
323
386
  }
324
387
 
325
388
  export namespace Settings {
389
+ /**
390
+ * Opt-in behavior for what routing should do when the preferred model cannot start
391
+ * immediately.
392
+ */
393
+ export interface Fallback {
394
+ /**
395
+ * When true, if the account is at its concurrency limit on the preferred model,
396
+ * routing skips it and picks the next-best eligible model instead of queueing. If
397
+ * every eligible model is at its limit, the original best-ranked model is used and
398
+ * the task queues as usual.
399
+ */
400
+ onCapacity?: boolean;
401
+ }
402
+
326
403
  /**
327
404
  * Optional per-modality credit caps, applied per generated output. Models whose
328
405
  * estimated per-output cost exceeds the cap are excluded.
@@ -402,6 +479,12 @@ export namespace RouterListResponse {
402
479
  */
403
480
  schemaVersion: 1;
404
481
 
482
+ /**
483
+ * Opt-in behavior for what routing should do when the preferred model cannot start
484
+ * immediately.
485
+ */
486
+ fallback?: Settings.Fallback;
487
+
405
488
  /**
406
489
  * Optional per-modality credit caps, applied per generated output. Models whose
407
490
  * estimated per-output cost exceeds the cap are excluded.
@@ -422,6 +505,20 @@ export namespace RouterListResponse {
422
505
  }
423
506
 
424
507
  export namespace Settings {
508
+ /**
509
+ * Opt-in behavior for what routing should do when the preferred model cannot start
510
+ * immediately.
511
+ */
512
+ export interface Fallback {
513
+ /**
514
+ * When true, if the account is at its concurrency limit on the preferred model,
515
+ * routing skips it and picks the next-best eligible model instead of queueing. If
516
+ * every eligible model is at its limit, the original best-ranked model is used and
517
+ * the task queues as usual.
518
+ */
519
+ onCapacity?: boolean;
520
+ }
521
+
425
522
  /**
426
523
  * Optional per-modality credit caps, applied per generated output. Models whose
427
524
  * estimated per-output cost exceeds the cap are excluded.
@@ -447,6 +544,111 @@ export namespace RouterListResponse {
447
544
  }
448
545
  }
449
546
 
547
+ /**
548
+ * A recorded Model Router routing decision.
549
+ */
550
+ export interface RouterListRequestsResponse {
551
+ id: string;
552
+
553
+ createdAt: string;
554
+
555
+ /**
556
+ * The filter(s) that reduced the eligible pool to zero.
557
+ */
558
+ emptiedBy: Array<'capability' | 'prompt_length' | 'input_support' | 'allow_deny' | 'price'>;
559
+
560
+ estimatedCredits: number | null;
561
+
562
+ model: string | null;
563
+
564
+ /**
565
+ * Ordered routing story: hard-filter stages with surviving model ids, a capacity
566
+ * step when concurrency limits affected the pool, then rank step when selection
567
+ * reached ranking.
568
+ */
569
+ pipeline: Array<
570
+ RouterListRequestsResponse.Filter | RouterListRequestsResponse.Capacity | RouterListRequestsResponse.Rank
571
+ >;
572
+
573
+ provider: string | null;
574
+
575
+ /**
576
+ * Free-text explanation of the pick. Written by the ranker, so treat it as prose
577
+ * for humans and group on reasonCode instead.
578
+ */
579
+ reason: string | null;
580
+
581
+ /**
582
+ * Why the model won: lowest_cost, best_latency, best_quality, only_eligible_model,
583
+ * or filter_order_fallback (ranking was unavailable, so hard-filter order stood).
584
+ * Null when the request never reached ranking.
585
+ */
586
+ reasonCode:
587
+ | 'lowest_cost'
588
+ | 'best_latency'
589
+ | 'best_quality'
590
+ | 'only_eligible_model'
591
+ | 'filter_order_fallback'
592
+ | null;
593
+
594
+ requestId: string;
595
+
596
+ /**
597
+ * How the routing attempt ended: routed (model selected), no_eligible_model (hard
598
+ * filters emptied the pool), router_config_not_found (same condition as the
599
+ * generate error of that name), invalid_request, or error.
600
+ */
601
+ status: 'routed' | 'no_eligible_model' | 'router_config_not_found' | 'invalid_request' | 'error';
602
+
603
+ taskId: string | null;
604
+ }
605
+
606
+ export namespace RouterListRequestsResponse {
607
+ export interface Filter {
608
+ /**
609
+ * Hard-filter stage that ran: capability (modality/feature fit), prompt_length
610
+ * (prompt within model limits), input_support (requested inputs/assets),
611
+ * allow_deny (router model allowlist/denylist), or price (credit ceiling).
612
+ */
613
+ filter: 'capability' | 'prompt_length' | 'input_support' | 'allow_deny' | 'price';
614
+
615
+ /**
616
+ * Model IDs of the models that remained eligible after this filter stage.
617
+ */
618
+ models: Array<string>;
619
+
620
+ type: 'filter';
621
+ }
622
+
623
+ export interface Capacity {
624
+ /**
625
+ * True when every eligible model was at its limit, in which case none was skipped
626
+ * and the selected task queues.
627
+ */
628
+ allExhausted: boolean;
629
+
630
+ /**
631
+ * Model IDs that were eligible but passed over because the account was at its
632
+ * concurrency limit for them.
633
+ */
634
+ skipped: Array<string>;
635
+
636
+ type: 'capacity';
637
+ }
638
+
639
+ export interface Rank {
640
+ /**
641
+ * How the router chose among eligible models: cost (sorted by estimated credits),
642
+ * selected (preference ranking chose a model), fallback (preference ranking failed
643
+ * so the eligible models were left in filter order), or single_candidate (only one
644
+ * model remained).
645
+ */
646
+ outcome: 'cost' | 'selected' | 'fallback' | 'single_candidate';
647
+
648
+ type: 'rank';
649
+ }
650
+ }
651
+
450
652
  export interface RouterCreateParams {
451
653
  /**
452
654
  * Immutable slug used to reference this Model Router in generation requests (for
@@ -481,6 +683,12 @@ export namespace RouterCreateParams {
481
683
  * Router.
482
684
  */
483
685
  export interface Settings {
686
+ /**
687
+ * Opt-in behavior for what routing should do when the preferred model cannot start
688
+ * immediately.
689
+ */
690
+ fallback?: Settings.Fallback;
691
+
484
692
  /**
485
693
  * Optional per-modality credit caps, applied per generated output. Models whose
486
694
  * estimated per-output cost exceeds the cap are excluded.
@@ -507,6 +715,20 @@ export namespace RouterCreateParams {
507
715
  }
508
716
 
509
717
  export namespace Settings {
718
+ /**
719
+ * Opt-in behavior for what routing should do when the preferred model cannot start
720
+ * immediately.
721
+ */
722
+ export interface Fallback {
723
+ /**
724
+ * When true, if the account is at its concurrency limit on the preferred model,
725
+ * routing skips it and picks the next-best eligible model instead of queueing. If
726
+ * every eligible model is at its limit, the original best-ranked model is used and
727
+ * the task queues as usual.
728
+ */
729
+ onCapacity?: boolean;
730
+ }
731
+
510
732
  /**
511
733
  * Optional per-modality credit caps, applied per generated output. Models whose
512
734
  * estimated per-output cost exceeds the cap are excluded.
@@ -555,6 +777,12 @@ export namespace RouterUpdateParams {
555
777
  * optimizeFor does not clear the model allowlist or credit ceiling).
556
778
  */
557
779
  export interface Settings {
780
+ /**
781
+ * Opt-in behavior for what routing should do when the preferred model cannot start
782
+ * immediately.
783
+ */
784
+ fallback?: Settings.Fallback;
785
+
558
786
  /**
559
787
  * Optional per-modality credit caps, applied per generated output. Models whose
560
788
  * estimated per-output cost exceeds the cap are excluded.
@@ -581,6 +809,20 @@ export namespace RouterUpdateParams {
581
809
  }
582
810
 
583
811
  export namespace Settings {
812
+ /**
813
+ * Opt-in behavior for what routing should do when the preferred model cannot start
814
+ * immediately.
815
+ */
816
+ export interface Fallback {
817
+ /**
818
+ * When true, if the account is at its concurrency limit on the preferred model,
819
+ * routing skips it and picks the next-best eligible model instead of queueing. If
820
+ * every eligible model is at its limit, the original best-ranked model is used and
821
+ * the task queues as usual.
822
+ */
823
+ onCapacity?: boolean;
824
+ }
825
+
584
826
  /**
585
827
  * Optional per-modality credit caps, applied per generated output. Models whose
586
828
  * estimated per-output cost exceeds the cap are excluded.
@@ -608,15 +850,20 @@ export namespace RouterUpdateParams {
608
850
 
609
851
  export interface RouterListParams extends CursorPageParams {}
610
852
 
853
+ export interface RouterListRequestsParams extends CursorPageParams {}
854
+
611
855
  export declare namespace Routers {
612
856
  export {
613
857
  type RouterCreateResponse as RouterCreateResponse,
614
858
  type RouterRetrieveResponse as RouterRetrieveResponse,
615
859
  type RouterUpdateResponse as RouterUpdateResponse,
616
860
  type RouterListResponse as RouterListResponse,
861
+ type RouterListRequestsResponse as RouterListRequestsResponse,
617
862
  type RouterListResponsesCursorPage as RouterListResponsesCursorPage,
863
+ type RouterListRequestsResponsesCursorPage as RouterListRequestsResponsesCursorPage,
618
864
  type RouterCreateParams as RouterCreateParams,
619
865
  type RouterUpdateParams as RouterUpdateParams,
620
866
  type RouterListParams as RouterListParams,
867
+ type RouterListRequestsParams as RouterListRequestsParams,
621
868
  };
622
869
  }
@@ -27,6 +27,25 @@ export interface SoundEffectCreateResponse {
27
27
  * The ID of the task that was created. Use this to retrieve the task later.
28
28
  */
29
29
  id: string;
30
+
31
+ /**
32
+ * The maximum credits this task may charge. The final amount may be lower after
33
+ * the task completes.
34
+ */
35
+ estimatedCost: SoundEffectCreateResponse.EstimatedCost;
36
+ }
37
+
38
+ export namespace SoundEffectCreateResponse {
39
+ /**
40
+ * The maximum credits this task may charge. The final amount may be lower after
41
+ * the task completes.
42
+ */
43
+ export interface EstimatedCost {
44
+ /**
45
+ * Estimated cost of the generation in credits.
46
+ */
47
+ credits: number;
48
+ }
30
49
  }
31
50
 
32
51
  export type SoundEffectCreateParams =
@@ -26,6 +26,25 @@ export interface SpeechToSpeechCreateResponse {
26
26
  * The ID of the task that was created. Use this to retrieve the task later.
27
27
  */
28
28
  id: string;
29
+
30
+ /**
31
+ * The maximum credits this task may charge. The final amount may be lower after
32
+ * the task completes.
33
+ */
34
+ estimatedCost: SpeechToSpeechCreateResponse.EstimatedCost;
35
+ }
36
+
37
+ export namespace SpeechToSpeechCreateResponse {
38
+ /**
39
+ * The maximum credits this task may charge. The final amount may be lower after
40
+ * the task completes.
41
+ */
42
+ export interface EstimatedCost {
43
+ /**
44
+ * Estimated cost of the generation in credits.
45
+ */
46
+ credits: number;
47
+ }
29
48
  }
30
49
 
31
50
  export interface SpeechToSpeechCreateParams {
@@ -64,9 +64,26 @@ export namespace TaskRetrieveResponse {
64
64
  */
65
65
  createdAt: string;
66
66
 
67
+ /**
68
+ * Estimated cost, computed against current pricing.
69
+ */
70
+ estimatedCost: Pending.EstimatedCost;
71
+
67
72
  status: 'PENDING';
68
73
  }
69
74
 
75
+ export namespace Pending {
76
+ /**
77
+ * Estimated cost, computed against current pricing.
78
+ */
79
+ export interface EstimatedCost {
80
+ /**
81
+ * Estimated cost of the generation in credits.
82
+ */
83
+ credits: number;
84
+ }
85
+ }
86
+
70
87
  /**
71
88
  * A throttled task
72
89
  */
@@ -81,9 +98,26 @@ export namespace TaskRetrieveResponse {
81
98
  */
82
99
  createdAt: string;
83
100
 
101
+ /**
102
+ * Estimated cost, computed against current pricing.
103
+ */
104
+ estimatedCost: Throttled.EstimatedCost;
105
+
84
106
  status: 'THROTTLED';
85
107
  }
86
108
 
109
+ export namespace Throttled {
110
+ /**
111
+ * Estimated cost, computed against current pricing.
112
+ */
113
+ export interface EstimatedCost {
114
+ /**
115
+ * Estimated cost of the generation in credits.
116
+ */
117
+ credits: number;
118
+ }
119
+ }
120
+
87
121
  /**
88
122
  * A cancelled or deleted task
89
123
  */
@@ -93,6 +127,11 @@ export namespace TaskRetrieveResponse {
93
127
  */
94
128
  id: string;
95
129
 
130
+ /**
131
+ * Final cost in credits for a terminal task. A refunded task reports 0.
132
+ */
133
+ cost: Cancelled.Cost;
134
+
96
135
  /**
97
136
  * The timestamp that the task was submitted at.
98
137
  */
@@ -101,6 +140,18 @@ export namespace TaskRetrieveResponse {
101
140
  status: 'CANCELLED';
102
141
  }
103
142
 
143
+ export namespace Cancelled {
144
+ /**
145
+ * Final cost in credits for a terminal task. A refunded task reports 0.
146
+ */
147
+ export interface Cost {
148
+ /**
149
+ * Credits charged for this task.
150
+ */
151
+ credits: number;
152
+ }
153
+ }
154
+
104
155
  /**
105
156
  * A running task
106
157
  */
@@ -115,11 +166,28 @@ export namespace TaskRetrieveResponse {
115
166
  */
116
167
  createdAt: string;
117
168
 
169
+ /**
170
+ * Estimated cost, computed against current pricing.
171
+ */
172
+ estimatedCost: Running.EstimatedCost;
173
+
118
174
  progress: number;
119
175
 
120
176
  status: 'RUNNING';
121
177
  }
122
178
 
179
+ export namespace Running {
180
+ /**
181
+ * Estimated cost, computed against current pricing.
182
+ */
183
+ export interface EstimatedCost {
184
+ /**
185
+ * Estimated cost of the generation in credits.
186
+ */
187
+ credits: number;
188
+ }
189
+ }
190
+
123
191
  /**
124
192
  * A failed task
125
193
  */
@@ -129,6 +197,11 @@ export namespace TaskRetrieveResponse {
129
197
  */
130
198
  id: string;
131
199
 
200
+ /**
201
+ * Final cost in credits for a terminal task. A refunded task reports 0.
202
+ */
203
+ cost: Failed.Cost;
204
+
132
205
  /**
133
206
  * The timestamp that the task was submitted at.
134
207
  */
@@ -149,6 +222,18 @@ export namespace TaskRetrieveResponse {
149
222
  failureCode?: string;
150
223
  }
151
224
 
225
+ export namespace Failed {
226
+ /**
227
+ * Final cost in credits for a terminal task. A refunded task reports 0.
228
+ */
229
+ export interface Cost {
230
+ /**
231
+ * Credits charged for this task.
232
+ */
233
+ credits: number;
234
+ }
235
+ }
236
+
152
237
  /**
153
238
  * A succeeded task
154
239
  */
@@ -158,6 +243,11 @@ export namespace TaskRetrieveResponse {
158
243
  */
159
244
  id: string;
160
245
 
246
+ /**
247
+ * Final cost in credits for a terminal task. A refunded task reports 0.
248
+ */
249
+ cost: Succeeded.Cost;
250
+
161
251
  /**
162
252
  * The timestamp that the task was submitted at.
163
253
  */
@@ -172,6 +262,18 @@ export namespace TaskRetrieveResponse {
172
262
 
173
263
  status: 'SUCCEEDED';
174
264
  }
265
+
266
+ export namespace Succeeded {
267
+ /**
268
+ * Final cost in credits for a terminal task. A refunded task reports 0.
269
+ */
270
+ export interface Cost {
271
+ /**
272
+ * Credits charged for this task.
273
+ */
274
+ credits: number;
275
+ }
276
+ }
175
277
  }
176
278
 
177
279
  export declare namespace Tasks {
@@ -26,6 +26,25 @@ export interface TextToImageCreateResponse {
26
26
  * The ID of the task that was created. Use this to retrieve the task later.
27
27
  */
28
28
  id: string;
29
+
30
+ /**
31
+ * The maximum credits this task may charge. The final amount may be lower after
32
+ * the task completes.
33
+ */
34
+ estimatedCost: TextToImageCreateResponse.EstimatedCost;
35
+ }
36
+
37
+ export namespace TextToImageCreateResponse {
38
+ /**
39
+ * The maximum credits this task may charge. The final amount may be lower after
40
+ * the task completes.
41
+ */
42
+ export interface EstimatedCost {
43
+ /**
44
+ * Estimated cost of the generation in credits.
45
+ */
46
+ credits: number;
47
+ }
29
48
  }
30
49
 
31
50
  export type TextToImageCreateParams =
@@ -571,6 +590,12 @@ export declare namespace TextToImageCreateParams {
571
590
  | '2496:3744'
572
591
  | '4704:2016';
573
592
 
593
+ /**
594
+ * When true, enable live web search so the model can use current brand, trend, or
595
+ * event context. Default false for deterministic output.
596
+ */
597
+ grounding?: boolean;
598
+
574
599
  /**
575
600
  * The number of images to generate. Increasing this number will affect the number
576
601
  * of credits consumed by the generation.