@runwayml/sdk 3.7.0 → 3.9.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 (86) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/lib/polling.d.mts +2 -2
  7. package/lib/polling.d.mts.map +1 -1
  8. package/lib/polling.d.ts +2 -2
  9. package/lib/polling.d.ts.map +1 -1
  10. package/lib/polling.js +1 -1
  11. package/lib/polling.js.map +1 -1
  12. package/lib/polling.mjs +1 -1
  13. package/lib/polling.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/character-performance.d.mts +3 -0
  16. package/resources/character-performance.d.mts.map +1 -1
  17. package/resources/character-performance.d.ts +3 -0
  18. package/resources/character-performance.d.ts.map +1 -1
  19. package/resources/image-to-video.d.mts +48 -37
  20. package/resources/image-to-video.d.mts.map +1 -1
  21. package/resources/image-to-video.d.ts +48 -37
  22. package/resources/image-to-video.d.ts.map +1 -1
  23. package/resources/organization.d.mts +18 -489
  24. package/resources/organization.d.mts.map +1 -1
  25. package/resources/organization.d.ts +18 -489
  26. package/resources/organization.d.ts.map +1 -1
  27. package/resources/sound-effect.d.mts +3 -0
  28. package/resources/sound-effect.d.mts.map +1 -1
  29. package/resources/sound-effect.d.ts +3 -0
  30. package/resources/sound-effect.d.ts.map +1 -1
  31. package/resources/speech-to-speech.d.mts +4 -1
  32. package/resources/speech-to-speech.d.mts.map +1 -1
  33. package/resources/speech-to-speech.d.ts +4 -1
  34. package/resources/speech-to-speech.d.ts.map +1 -1
  35. package/resources/tasks.d.mts +94 -32
  36. package/resources/tasks.d.mts.map +1 -1
  37. package/resources/tasks.d.ts +94 -32
  38. package/resources/tasks.d.ts.map +1 -1
  39. package/resources/text-to-image.d.mts +162 -88
  40. package/resources/text-to-image.d.mts.map +1 -1
  41. package/resources/text-to-image.d.ts +162 -88
  42. package/resources/text-to-image.d.ts.map +1 -1
  43. package/resources/text-to-speech.d.mts +3 -0
  44. package/resources/text-to-speech.d.mts.map +1 -1
  45. package/resources/text-to-speech.d.ts +3 -0
  46. package/resources/text-to-speech.d.ts.map +1 -1
  47. package/resources/text-to-video.d.mts +11 -0
  48. package/resources/text-to-video.d.mts.map +1 -1
  49. package/resources/text-to-video.d.ts +11 -0
  50. package/resources/text-to-video.d.ts.map +1 -1
  51. package/resources/video-to-video.d.mts +3 -0
  52. package/resources/video-to-video.d.mts.map +1 -1
  53. package/resources/video-to-video.d.ts +3 -0
  54. package/resources/video-to-video.d.ts.map +1 -1
  55. package/resources/video-upscale.d.mts +3 -0
  56. package/resources/video-upscale.d.mts.map +1 -1
  57. package/resources/video-upscale.d.ts +3 -0
  58. package/resources/video-upscale.d.ts.map +1 -1
  59. package/resources/voice-dubbing.d.mts +3 -0
  60. package/resources/voice-dubbing.d.mts.map +1 -1
  61. package/resources/voice-dubbing.d.ts +3 -0
  62. package/resources/voice-dubbing.d.ts.map +1 -1
  63. package/resources/voice-isolation.d.mts +3 -0
  64. package/resources/voice-isolation.d.mts.map +1 -1
  65. package/resources/voice-isolation.d.ts +3 -0
  66. package/resources/voice-isolation.d.ts.map +1 -1
  67. package/src/client.ts +1 -1
  68. package/src/lib/polling.ts +4 -4
  69. package/src/resources/character-performance.ts +3 -0
  70. package/src/resources/image-to-video.ts +57 -44
  71. package/src/resources/organization.ts +33 -583
  72. package/src/resources/sound-effect.ts +3 -0
  73. package/src/resources/speech-to-speech.ts +4 -1
  74. package/src/resources/tasks.ts +116 -32
  75. package/src/resources/text-to-image.ts +262 -114
  76. package/src/resources/text-to-speech.ts +3 -0
  77. package/src/resources/text-to-video.ts +13 -0
  78. package/src/resources/video-to-video.ts +3 -0
  79. package/src/resources/video-upscale.ts +3 -0
  80. package/src/resources/voice-dubbing.ts +3 -0
  81. package/src/resources/voice-isolation.ts +3 -0
  82. package/src/version.ts +1 -1
  83. package/version.d.mts +1 -1
  84. package/version.d.ts +1 -1
  85. package/version.js +1 -1
  86. package/version.mjs +1 -1
@@ -18,50 +18,112 @@ export declare class Tasks extends APIResource {
18
18
  */
19
19
  delete(id: string, options?: RequestOptions): APIPromise<void>;
20
20
  }
21
- export interface TaskRetrieveResponse {
21
+ /**
22
+ * A pending task
23
+ */
24
+ export type TaskRetrieveResponse = TaskRetrieveResponse.Pending | TaskRetrieveResponse.Throttled | TaskRetrieveResponse.Cancelled | TaskRetrieveResponse.Running | TaskRetrieveResponse.Failed | TaskRetrieveResponse.Succeeded;
25
+ export declare namespace TaskRetrieveResponse {
22
26
  /**
23
- * The ID of the task being returned.
27
+ * A pending task
24
28
  */
25
- id: string;
29
+ interface Pending {
30
+ /**
31
+ * The ID of the task being returned.
32
+ */
33
+ id: string;
34
+ /**
35
+ * The timestamp that the task was submitted at.
36
+ */
37
+ createdAt: string;
38
+ status: 'PENDING';
39
+ }
26
40
  /**
27
- * The timestamp that the task was submitted at.
41
+ * A throttled task
28
42
  */
29
- createdAt: string;
43
+ interface Throttled {
44
+ /**
45
+ * The ID of the task being returned.
46
+ */
47
+ id: string;
48
+ /**
49
+ * The timestamp that the task was submitted at.
50
+ */
51
+ createdAt: string;
52
+ status: 'THROTTLED';
53
+ }
30
54
  /**
31
- * - `PENDING` tasks have been enqueued and are waiting to run.
32
- * - `THROTTLED` tasks are waiting to be enqueued until other jobs have finished
33
- * running.
34
- * - `RUNNING` tasks are currently being processed.
35
- * - `SUCCEEDED` tasks have completed successfully.
36
- * - `FAILED` tasks have failed.
37
- * - `CANCELLED` tasks have been aborted.
55
+ * A cancelled or deleted task
38
56
  */
39
- status: 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'PENDING' | 'CANCELLED' | 'THROTTLED';
57
+ interface Cancelled {
58
+ /**
59
+ * The ID of the task being returned.
60
+ */
61
+ id: string;
62
+ /**
63
+ * The timestamp that the task was submitted at.
64
+ */
65
+ createdAt: string;
66
+ status: 'CANCELLED';
67
+ }
40
68
  /**
41
- * If the status is `FAILED`, this will contain a human-friendly reason for the
42
- * failure.
69
+ * A running task
43
70
  */
44
- failure?: string;
71
+ interface Running {
72
+ /**
73
+ * The ID of the task being returned.
74
+ */
75
+ id: string;
76
+ /**
77
+ * The timestamp that the task was submitted at.
78
+ */
79
+ createdAt: string;
80
+ progress: number;
81
+ status: 'RUNNING';
82
+ }
45
83
  /**
46
- * If the task has a status of `FAILED`, this contains a machine-readable error
47
- * code. This is a dot-separated string, with the leftmost segment being the most
48
- * generic and the rightmost segment being the most specific. For example,
49
- * `SAFETY.INPUT.TEXT` would indicate that the task failed due to a content
50
- * moderation error on the input text.
84
+ * A failed task
51
85
  */
52
- failureCode?: string;
86
+ interface Failed {
87
+ /**
88
+ * The ID of the task being returned.
89
+ */
90
+ id: string;
91
+ /**
92
+ * The timestamp that the task was submitted at.
93
+ */
94
+ createdAt: string;
95
+ /**
96
+ * A human-friendly reason for the failure. We do not recommend returning this to
97
+ * users directly without adding context.
98
+ */
99
+ failure: string;
100
+ status: 'FAILED';
101
+ /**
102
+ * A machine-readable error code for the failure. See
103
+ * https://docs.dev.runwayml.com/errors/task-failures/ for more information.
104
+ */
105
+ failureCode?: string;
106
+ }
53
107
  /**
54
- * If the status is `SUCCEEDED`, this will contain an array of strings. Each string
55
- * will be a URL that returns an output from the task. URLs expire within 24-48
56
- * hours; fetch the task again to get fresh URLs. It is expected that you download
57
- * the assets at these URLs and store them in your own storage system.
108
+ * A succeeded task
58
109
  */
59
- output?: Array<string>;
60
- /**
61
- * If the task has a status of `RUNNING`, this will contain a floating point number
62
- * between 0 and 1 representing the progress of the generation.
63
- */
64
- progress?: number;
110
+ interface Succeeded {
111
+ /**
112
+ * The ID of the task being returned.
113
+ */
114
+ id: string;
115
+ /**
116
+ * The timestamp that the task was submitted at.
117
+ */
118
+ createdAt: string;
119
+ /**
120
+ * An array of URLs that return the output of the task. These URLs will expire
121
+ * within 24-48 hours; fetch the task again to get fresh URLs. It is expected that
122
+ * you download the assets at these URLs and store them in your own storage system.
123
+ */
124
+ output: Array<string>;
125
+ status: 'SUCCEEDED';
126
+ }
65
127
  }
66
128
  export declare namespace Tasks {
67
129
  export { type TaskRetrieveResponse as TaskRetrieveResponse };
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.mts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;OAElB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,2BAA2B,CAAC,oBAAoB,CAAC;IAOjG;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAM/D;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;OAQG;IACH,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;IAEnF;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;CAC9D"}
1
+ {"version":3,"file":"tasks.d.mts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"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,EAAE,SAAS,CAAC;KACnB;IAED;;OAEG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB,MAAM,EAAE,QAAQ,CAAC;QAEjB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;;WAIG;QACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEtB,MAAM,EAAE,WAAW,CAAC;KACrB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;CAC9D"}
@@ -18,50 +18,112 @@ export declare class Tasks extends APIResource {
18
18
  */
19
19
  delete(id: string, options?: RequestOptions): APIPromise<void>;
20
20
  }
21
- export interface TaskRetrieveResponse {
21
+ /**
22
+ * A pending task
23
+ */
24
+ export type TaskRetrieveResponse = TaskRetrieveResponse.Pending | TaskRetrieveResponse.Throttled | TaskRetrieveResponse.Cancelled | TaskRetrieveResponse.Running | TaskRetrieveResponse.Failed | TaskRetrieveResponse.Succeeded;
25
+ export declare namespace TaskRetrieveResponse {
22
26
  /**
23
- * The ID of the task being returned.
27
+ * A pending task
24
28
  */
25
- id: string;
29
+ interface Pending {
30
+ /**
31
+ * The ID of the task being returned.
32
+ */
33
+ id: string;
34
+ /**
35
+ * The timestamp that the task was submitted at.
36
+ */
37
+ createdAt: string;
38
+ status: 'PENDING';
39
+ }
26
40
  /**
27
- * The timestamp that the task was submitted at.
41
+ * A throttled task
28
42
  */
29
- createdAt: string;
43
+ interface Throttled {
44
+ /**
45
+ * The ID of the task being returned.
46
+ */
47
+ id: string;
48
+ /**
49
+ * The timestamp that the task was submitted at.
50
+ */
51
+ createdAt: string;
52
+ status: 'THROTTLED';
53
+ }
30
54
  /**
31
- * - `PENDING` tasks have been enqueued and are waiting to run.
32
- * - `THROTTLED` tasks are waiting to be enqueued until other jobs have finished
33
- * running.
34
- * - `RUNNING` tasks are currently being processed.
35
- * - `SUCCEEDED` tasks have completed successfully.
36
- * - `FAILED` tasks have failed.
37
- * - `CANCELLED` tasks have been aborted.
55
+ * A cancelled or deleted task
38
56
  */
39
- status: 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'PENDING' | 'CANCELLED' | 'THROTTLED';
57
+ interface Cancelled {
58
+ /**
59
+ * The ID of the task being returned.
60
+ */
61
+ id: string;
62
+ /**
63
+ * The timestamp that the task was submitted at.
64
+ */
65
+ createdAt: string;
66
+ status: 'CANCELLED';
67
+ }
40
68
  /**
41
- * If the status is `FAILED`, this will contain a human-friendly reason for the
42
- * failure.
69
+ * A running task
43
70
  */
44
- failure?: string;
71
+ interface Running {
72
+ /**
73
+ * The ID of the task being returned.
74
+ */
75
+ id: string;
76
+ /**
77
+ * The timestamp that the task was submitted at.
78
+ */
79
+ createdAt: string;
80
+ progress: number;
81
+ status: 'RUNNING';
82
+ }
45
83
  /**
46
- * If the task has a status of `FAILED`, this contains a machine-readable error
47
- * code. This is a dot-separated string, with the leftmost segment being the most
48
- * generic and the rightmost segment being the most specific. For example,
49
- * `SAFETY.INPUT.TEXT` would indicate that the task failed due to a content
50
- * moderation error on the input text.
84
+ * A failed task
51
85
  */
52
- failureCode?: string;
86
+ interface Failed {
87
+ /**
88
+ * The ID of the task being returned.
89
+ */
90
+ id: string;
91
+ /**
92
+ * The timestamp that the task was submitted at.
93
+ */
94
+ createdAt: string;
95
+ /**
96
+ * A human-friendly reason for the failure. We do not recommend returning this to
97
+ * users directly without adding context.
98
+ */
99
+ failure: string;
100
+ status: 'FAILED';
101
+ /**
102
+ * A machine-readable error code for the failure. See
103
+ * https://docs.dev.runwayml.com/errors/task-failures/ for more information.
104
+ */
105
+ failureCode?: string;
106
+ }
53
107
  /**
54
- * If the status is `SUCCEEDED`, this will contain an array of strings. Each string
55
- * will be a URL that returns an output from the task. URLs expire within 24-48
56
- * hours; fetch the task again to get fresh URLs. It is expected that you download
57
- * the assets at these URLs and store them in your own storage system.
108
+ * A succeeded task
58
109
  */
59
- output?: Array<string>;
60
- /**
61
- * If the task has a status of `RUNNING`, this will contain a floating point number
62
- * between 0 and 1 representing the progress of the generation.
63
- */
64
- progress?: number;
110
+ interface Succeeded {
111
+ /**
112
+ * The ID of the task being returned.
113
+ */
114
+ id: string;
115
+ /**
116
+ * The timestamp that the task was submitted at.
117
+ */
118
+ createdAt: string;
119
+ /**
120
+ * An array of URLs that return the output of the task. These URLs will expire
121
+ * within 24-48 hours; fetch the task again to get fresh URLs. It is expected that
122
+ * you download the assets at these URLs and store them in your own storage system.
123
+ */
124
+ output: Array<string>;
125
+ status: 'SUCCEEDED';
126
+ }
65
127
  }
66
128
  export declare namespace Tasks {
67
129
  export { type TaskRetrieveResponse as TaskRetrieveResponse };
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;OAElB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,2BAA2B,CAAC,oBAAoB,CAAC;IAOjG;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAM/D;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE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AEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB,MAAM,EAAE,SAAS,CAAC;KACnB;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB,MAAM,EAAE,WAAW,CAAC;KACrB;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB,MAAM,EAAE,WAAW,CAAC;KACrB;IAED;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB,QAAQ,EAAE,MAAM,CAAC;QAEjB,MAAM,EAAE,SAAS,CAAC;KACnB;IAED;;OAEG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB,MAAM,EAAE,QAAQ,CAAC;QAEjB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;;WAIG;QACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEtB,MAAM,EAAE,WAAW,CAAC;KACrB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;CAC9D"}
@@ -9,105 +9,179 @@ export declare class TextToImage extends APIResource {
9
9
  }
10
10
  export interface TextToImageCreateResponse {
11
11
  /**
12
- * The ID of the newly created task.
12
+ * The ID of the task that was created. Use this to retrieve the task later.
13
13
  */
14
14
  id: string;
15
15
  }
16
- export interface TextToImageCreateParams {
17
- /**
18
- * The model variant to use.
19
- */
20
- model: 'gen4_image_turbo' | 'gen4_image' | 'gemini_2.5_flash';
21
- /**
22
- * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
23
- * should describe in detail what should appear in the output.
24
- */
25
- promptText: string;
26
- /**
27
- * The resolution of the output image.
28
- *
29
- * `gen4_image_turbo`, `gen4_image` support the following values:
30
- *
31
- * - `1920:1080`
32
- * - `1080:1920`
33
- * - `1024:1024`
34
- * - `1360:768`
35
- * - `1080:1080`
36
- * - `1168:880`
37
- * - `1440:1080`
38
- * - `1080:1440`
39
- * - `1808:768`
40
- * - `2112:912`
41
- * - `1280:720`
42
- * - `720:1280`
43
- * - `720:720`
44
- * - `960:720`
45
- * - `720:960`
46
- * - `1680:720`
47
- *
48
- * `gemini_2.5_flash` supports the following values:
49
- *
50
- * - `1344:768`
51
- * - `768:1344`
52
- * - `1024:1024`
53
- * - `1184:864`
54
- * - `864:1184`
55
- * - `1536:672`
56
- * - `832x1248`
57
- * - `1248x832`
58
- * - `896x1152`
59
- * - `1152x896`
60
- */
61
- ratio: '1920:1080' | '1080:1920' | '1024:1024' | '1360:768' | '1080:1080' | '1168:880' | '1440:1080' | '1080:1440' | '1808:768' | '2112:912' | '1280:720' | '720:1280' | '720:720' | '960:720' | '720:960' | '1680:720' | '1344:768' | '768:1344' | '1184:864' | '864:1184' | '1536:672' | '832x1248' | '1248x832' | '896x1152' | '1152x896';
62
- /**
63
- * Settings that affect the behavior of the content moderation system.
64
- *
65
- * This field is allowed only for the following model variants: `gen4_image_turbo`,
66
- * `gen4_image`
67
- */
68
- contentModeration?: TextToImageCreateParams.ContentModeration;
69
- /**
70
- * An array of up to three images to be used as references for the generated image
71
- * output.
72
- *
73
- * For `gen4_image_turbo`, _at least one_ reference image is required.
74
- */
75
- referenceImages?: Array<TextToImageCreateParams.ReferenceImage>;
76
- /**
77
- * If unspecified, a random number is chosen. Varying the seed integer is a way to
78
- * get different results for the same other request parameters. Using the same seed
79
- * integer for an identical request will produce similar results.
80
- */
81
- seed?: number;
82
- }
16
+ export type TextToImageCreateParams = TextToImageCreateParams.Gen4ImageTurbo | TextToImageCreateParams.Gen4Image | TextToImageCreateParams.Gemini3Pro | TextToImageCreateParams.Gemini2_5Flash;
83
17
  export declare namespace TextToImageCreateParams {
84
- /**
85
- * Settings that affect the behavior of the content moderation system.
86
- *
87
- * This field is allowed only for the following model variants: `gen4_image_turbo`,
88
- * `gen4_image`
89
- */
90
- interface ContentModeration {
18
+ interface Gen4ImageTurbo {
19
+ model: 'gen4_image_turbo';
20
+ /**
21
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
22
+ * should describe in detail what should appear in the output.
23
+ */
24
+ promptText: string;
25
+ /**
26
+ * The resolution of the output image.
27
+ */
28
+ ratio: '1024:1024' | '1080:1080' | '1168:880' | '1360:768' | '1440:1080' | '1080:1440' | '1808:768' | '1920:1080' | '1080:1920' | '2112:912' | '1280:720' | '720:1280' | '720:720' | '960:720' | '720:960' | '1680:720';
29
+ /**
30
+ * An array of one to three images to be used as references for the generated image
31
+ * output.
32
+ */
33
+ referenceImages: Array<Gen4ImageTurbo.ReferenceImage>;
34
+ /**
35
+ * Settings that affect the behavior of the content moderation system.
36
+ */
37
+ contentModeration?: Gen4ImageTurbo.ContentModeration;
38
+ /**
39
+ * If unspecified, a random number is chosen. Varying the seed integer is a way to
40
+ * get different results for the same other request parameters. Using the same seed
41
+ * integer for an identical request will produce similar results.
42
+ */
43
+ seed?: number;
44
+ }
45
+ namespace Gen4ImageTurbo {
46
+ interface ReferenceImage {
47
+ /**
48
+ * A HTTPS URL.
49
+ */
50
+ uri: string;
51
+ /**
52
+ * A tag to identify the reference image. This is used to reference the image in
53
+ * prompt text.
54
+ */
55
+ tag?: string;
56
+ }
91
57
  /**
92
- * When set to `low`, the content moderation system will be less strict about
93
- * preventing generations that include recognizable public figures.
58
+ * Settings that affect the behavior of the content moderation system.
94
59
  */
95
- publicFigureThreshold?: 'auto' | 'low';
60
+ interface ContentModeration {
61
+ /**
62
+ * When set to `low`, the content moderation system will be less strict about
63
+ * preventing generations that include recognizable public figures.
64
+ */
65
+ publicFigureThreshold?: 'auto' | 'low';
66
+ }
96
67
  }
97
- interface ReferenceImage {
68
+ interface Gen4Image {
69
+ model: 'gen4_image';
98
70
  /**
99
- * A HTTPS URL, Runway or data URI containing an encoded image to be used as
100
- * reference for the generated output image. See [our docs](/assets/inputs#images)
101
- * on image inputs for more information.
71
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
72
+ * should describe in detail what should appear in the output.
102
73
  */
103
- uri: string;
74
+ promptText: string;
104
75
  /**
105
- * A name used to refer to the image reference, from 3 to 16 characters in length.
106
- * Tags must be alphanumeric (plus underscores) and start with a letter. You can
107
- * refer to the reference image's tag in the prompt text with at-mention syntax:
108
- * `@tag`. Tags are case-sensitive.
76
+ * The resolution of the output image.
109
77
  */
110
- tag?: string;
78
+ ratio: '1024:1024' | '1080:1080' | '1168:880' | '1360:768' | '1440:1080' | '1080:1440' | '1808:768' | '1920:1080' | '1080:1920' | '2112:912' | '1280:720' | '720:1280' | '720:720' | '960:720' | '720:960' | '1680:720';
79
+ /**
80
+ * Settings that affect the behavior of the content moderation system.
81
+ */
82
+ contentModeration?: Gen4Image.ContentModeration;
83
+ /**
84
+ * An array of up to three images to be used as references for the generated image
85
+ * output.
86
+ */
87
+ referenceImages?: Array<Gen4Image.ReferenceImage>;
88
+ /**
89
+ * If unspecified, a random number is chosen. Varying the seed integer is a way to
90
+ * get different results for the same other request parameters. Using the same seed
91
+ * integer for an identical request will produce similar results.
92
+ */
93
+ seed?: number;
94
+ }
95
+ namespace Gen4Image {
96
+ /**
97
+ * Settings that affect the behavior of the content moderation system.
98
+ */
99
+ interface ContentModeration {
100
+ /**
101
+ * When set to `low`, the content moderation system will be less strict about
102
+ * preventing generations that include recognizable public figures.
103
+ */
104
+ publicFigureThreshold?: 'auto' | 'low';
105
+ }
106
+ interface ReferenceImage {
107
+ /**
108
+ * A HTTPS URL.
109
+ */
110
+ uri: string;
111
+ /**
112
+ * A tag to identify the reference image. This is used to reference the image in
113
+ * prompt text.
114
+ */
115
+ tag?: string;
116
+ }
117
+ }
118
+ interface Gemini3Pro {
119
+ model: 'gemini_3_pro';
120
+ /**
121
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
122
+ * should describe in detail what should appear in the output.
123
+ */
124
+ promptText: string;
125
+ /**
126
+ * The resolution of the output image.
127
+ */
128
+ ratio: '1344:768' | '768:1344' | '1024:1024' | '1184:864' | '864:1184' | '1536:672' | '832:1248' | '1248:832' | '896:1152' | '1152:896' | '2048:2048' | '1696:2528' | '2528:1696' | '1792:2400' | '2400:1792' | '1856:2304' | '2304:1856' | '1536:2752' | '2752:1536' | '3168:1344' | '4096:4096' | '3392:5056' | '5056:3392' | '3584:4800' | '4800:3584' | '3712:4608' | '4608:3712' | '3072:5504' | '5504:3072' | '6336:2688';
129
+ /**
130
+ * An array of up to 14 images to be used as references for the generated image
131
+ * output. Up to five of those images can pass `subject: "human"` to maintain
132
+ * character consistency, and up to nine of those images can pass
133
+ * `subject: "object"` with high-fidelity images of objects to include in the
134
+ * output.
135
+ */
136
+ referenceImages?: Array<Gemini3Pro.ReferenceImage>;
137
+ }
138
+ namespace Gemini3Pro {
139
+ interface ReferenceImage {
140
+ /**
141
+ * Whether this is a reference of a human subject (for character consistency) or an
142
+ * object that appears in the output.
143
+ */
144
+ subject: 'object' | 'human';
145
+ /**
146
+ * A HTTPS URL.
147
+ */
148
+ uri: string;
149
+ /**
150
+ * A tag to identify the reference image. This is used to reference the image in
151
+ * prompt text.
152
+ */
153
+ tag?: string;
154
+ }
155
+ }
156
+ interface Gemini2_5Flash {
157
+ model: 'gemini_2.5_flash';
158
+ /**
159
+ * A non-empty string up to 1000 characters (measured in UTF-16 code units). This
160
+ * should describe in detail what should appear in the output.
161
+ */
162
+ promptText: string;
163
+ /**
164
+ * The resolution of the output image.
165
+ */
166
+ ratio: '1344:768' | '768:1344' | '1024:1024' | '1184:864' | '864:1184' | '1536:672' | '832:1248' | '1248:832' | '896:1152' | '1152:896';
167
+ /**
168
+ * An array of up to three images to be used as references for the generated image
169
+ * output.
170
+ */
171
+ referenceImages?: Array<Gemini2_5Flash.ReferenceImage>;
172
+ }
173
+ namespace Gemini2_5Flash {
174
+ interface ReferenceImage {
175
+ /**
176
+ * A HTTPS URL.
177
+ */
178
+ uri: string;
179
+ /**
180
+ * A tag to identify the reference image. This is used to reference the image in
181
+ * prompt text.
182
+ */
183
+ tag?: string;
184
+ }
111
185
  }
112
186
  }
113
187
  export declare namespace TextToImage {
@@ -1 +1 @@
1
- {"version":3,"file":"text-to-image.d.mts","sourceRoot":"","sources":["../src/resources/text-to-image.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,2BAA2B,CAAC,yBAAyB,CAAC;CAK1D;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,KAAK,EAAE,kBAAkB,GAAG,YAAY,GAAG,kBAAkB,CAAC;IAE9D;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,KAAK,EACD,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;IAEf;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAC,iBAAiB,CAAC;IAE9D;;;;;OAKG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAEhE;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,uBAAuB,CAAC;IACvC;;;;;OAKG;IACH,UAAiB,iBAAiB;QAChC;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;KACxC;IAED,UAAiB,cAAc;QAC7B;;;;WAIG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;;;;WAKG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
1
+ {"version":3,"file":"text-to-image.d.mts","sourceRoot":"","sources":["../src/resources/text-to-image.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,2BAA2B,CAAC,yBAAyB,CAAC;CAK1D;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,uBAAuB,GAC/B,uBAAuB,CAAC,cAAc,GACtC,uBAAuB,CAAC,SAAS,GACjC,uBAAuB,CAAC,UAAU,GAClC,uBAAuB,CAAC,cA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