@picsart/ai-sdk 1.152.1 → 3.17.4

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.
package/index.d.ts CHANGED
@@ -1,14 +1,13 @@
1
+ import { WorkflowTypes, ExecutionOptions, WorkflowResponse } from './_vendor/workflows-client/index';
2
+ export { ExecutionMode as ApiRunMode } from './_vendor/workflows-client/index';
3
+ import { ModelPricingClientOptions } from './_vendor/pa-model-pricing-sdk/index';
4
+
1
5
  interface WorkflowSubmitRequest<TPayload = Record<string, unknown>> {
2
- /** Explicit workflow endpoint, e.g. "veo-text-to-video". */
3
- workflow?: string;
4
- /** Model reference (model id, backend modelId, display name, or workflow string fallback). */
5
- model?: string;
6
+ /** Workflow endpoint, e.g. "veo-text-to-video". */
7
+ workflow: string;
6
8
  payload: TPayload;
7
9
  signal?: AbortSignal;
8
10
  }
9
- interface ResolvedWorkflowSubmitRequest<TPayload = Record<string, unknown>> extends WorkflowSubmitRequest<TPayload> {
10
- workflow: string;
11
- }
12
11
  interface WorkflowJobHandle {
13
12
  workflow: string;
14
13
  id: string;
@@ -26,11 +25,21 @@ interface WorkflowStatusResult<TResult = unknown> {
26
25
  progress?: WorkflowProgress;
27
26
  raw: unknown;
28
27
  }
29
- interface WorkflowTransport<TPayload = Record<string, unknown>> {
30
- submit(request: ResolvedWorkflowSubmitRequest<TPayload>): Promise<WorkflowJobHandle>;
31
- status(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<unknown>;
32
- execute?(request: ResolvedWorkflowSubmitRequest<TPayload>): Promise<unknown>;
33
- cancel?(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<void>;
28
+ /**
29
+ * The transport contract for talking to the workflows backend.
30
+ *
31
+ * `execute` (one-shot synchronous generation) is the only required method.
32
+ * `submit` + `status` are the async submit-and-poll pair — optional, so an
33
+ * execute-only transport can omit them. `options` is the SDK-level
34
+ * credit-estimation call. When a transport omits `submit`, the client routes
35
+ * all generation through `execute`; calling the async lifecycle methods
36
+ * (submit/status/result/subscribe) on such a client throws.
37
+ */
38
+ interface SdkTransport<TPayload = Record<string, unknown>> {
39
+ execute(request: WorkflowSubmitRequest<TPayload>): Promise<unknown>;
40
+ submit?(request: WorkflowSubmitRequest<TPayload>): Promise<WorkflowJobHandle>;
41
+ status?(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<unknown>;
42
+ options?(workflow: string, payload: Record<string, unknown>): Promise<number | null>;
34
43
  }
35
44
  interface WorkflowPollOptions {
36
45
  intervalMs?: number;
@@ -47,14 +56,34 @@ type WorkflowSubscribeOptions = WorkflowPollOptions;
47
56
  * Regenerate with: npm run build:model-input-types
48
57
  */
49
58
  type ModelInputById = {
50
- "bytedance-omnihuman": {
59
+ "async-flash-v1": {
60
+ prompt: string;
61
+ voiceId?: "cca0e076-94b9-4c6d-86b7-546168f11174" | "f493c663-b272-493e-8b78-72d2262a2a8d" | "317bf805-4b42-417b-9474-10807e2f67c9" | "3950360d-4810-4c65-a0b8-eb5b4b3b4231" | "a6268eaf-976d-4d44-871d-57e1d58002c7" | "84905ece-2420-47b5-b3d6-964e62200c73" | "a44e2f09-6897-4e1e-8573-631207c53f6d" | "8f7ad606-26df-400a-8336-e7162a977be7" | "c8dab279-6c67-468c-977d-ce4081fa3936" | "054c9aed-4786-4fa5-a317-09abd199e21f" | "ef932845-cfe9-4748-a123-454664076938" | "cfc8833a-dc45-40e9-9279-57cad23e3c09" | "5d20dd0a-a781-43ea-b06c-56892a691715" | "46ffc709-542b-409c-a8a9-aa5d3e0e1cfc" | "e5a67eaf-6e5a-4488-9fb9-4806bd7fea54" | "c01e9ac9-dc1b-4263-9b70-091f919c05f4" | "d7eb91fb-c2a7-45fd-b65a-80b8b499be7f" | "3f1e185f-6e91-4253-b94a-d8b53f6214be" | "8288f28a-a3f4-4792-a26e-d762fc2263b9" | "854eef1c-9aae-41ae-8849-2a32b9b349bb" | "a5e830d5-e543-4250-9724-a24c452fa248" | "15a92057-54a7-4bb8-979c-38f44581fb8c" | "f57e9942-4d9e-4b05-8a0c-585359eef0dd" | "965d9bd7-9e95-4cdd-a798-80a5233705bd" | "66254e55-d74a-4b23-a12a-cccdd14a25a0" | "8bab777e-1a1e-43d8-915d-eaafcb446e9d" | "2d83227c-1abf-47c0-902d-f82448bdc598" | "4a7876f0-5fb4-4ed8-a104-890bc30d9832" | "f7f4fee8-845b-49d2-be7e-6ff7c8706b55" | "b355a1d2-f989-4e62-a997-5de0bb2aa841" | "ee89b03c-5275-488a-b5d2-ca5ca364e857" | "fb9cc041-75e5-4ac5-ae7f-c763f1e54797" | "c81384a9-3dce-48d2-bb5b-b0875f2db37e" | "9e5001fa-5367-4f6d-a079-6bfc0ddbff69" | "17486b3b-2ffb-43e7-9d81-3ed3d147a497" | "44523faf-3c13-469e-961e-eb7c5496cb90" | "350bf05c-7858-49c1-859e-ef1e657d43f2" | "8788ac4f-2156-40ce-8030-7a9a0a9b9161" | "348aff4f-dff7-4871-81d5-fc31c3d90ef6" | "b976d8b2-e1f8-4c22-b6ba-87ce392f0f01" | "0aef6559-9098-4860-8224-13e038ab3aef" | "1e5d72bd-4a36-4abe-9b57-15dfc2b3841c" | "20180bd3-4f7a-4d83-9599-9a40c282ef04" | "66318ebc-62a9-437a-989a-9bd148ec829a" | "dfa6d420-4742-452f-b2fb-5d7ba0c3852e" | "9e9a769b-a283-4b03-93a5-bee4a5bd62bc" | "2808aed4-85d9-4b61-87d9-daefdaad29af" | "d8acc796-5d2c-475c-ae8e-2f1c8158490c" | "059fee9c-51a5-4db9-8c8c-1ff1ede29cf1" | "6d891f84-452e-4412-a72a-f00eea0f1fd7" | "6112718a-871e-46f6-abb3-d0cdd1f4368a" | "544ba1a4-4a04-4b93-9aaf-fadb09fed104" | "9f5d9d57-b7bb-4ee3-b627-d7402ed00d15" | "721d6b30-7601-4643-9447-6de1be2bd92e" | "f161bd60-c617-44b0-8275-7f879c96e86c" | "610df5e1-2fa1-42e8-8dcd-988d2ec2d8f3" | "3f38104f-9327-4554-873d-7f092caf1256" | "07c10ae2-0007-4551-841d-f8dcbee53433" | "5f41badd-5f53-4460-a5b2-63dda5503490" | "a8915cb1-a587-4313-841a-ddc74ff17050" | "3010fa3f-897a-41e7-a426-a06f29f61f78" | "8abd608c-b8d3-4193-8d54-9976911a337c" | "43064fb0-6723-4f2c-a311-eaf6a5d2f0e5" | "adf91049-3cab-4e62-b40c-be00fe34e0e6" | "04da033a-8919-4553-8fc5-eb6869e0c0e1" | "9f2e03d7-714d-48a5-a0e7-58c2b7efad23" | "c1820aa0-467e-4b13-8f73-418f950dba51" | "befbed31-f461-4bdc-8900-fe786fbeffc3" | "d7979182-36b7-4ae5-8284-1962050da404" | "0e8463d7-5e80-47bf-b900-3bbf4e3e564a" | "b0641d1a-e342-41d0-8a56-63781d487ca3" | "34123cc6-9377-4a13-8b4c-ed274cbe317a" | "4c71b60f-357f-4569-9867-cd1ce4ff58c8" | "d1a08ee2-2706-4743-898c-882238036c81" | "c6db469b-929f-4066-896c-165f60d09162" | "be6bbe5d-5f45-4ad8-bec9-ed6a7cdf5311" | "aa40e5b8-af38-4f88-ab43-1fd5ca9749c6" | "7cd2e6c8-a8f8-4115-a757-9397c0127e50" | "7a3ef29d-8962-4722-adfb-fda21e0d821e" | "13616e5f-6fda-4247-b548-8821cb71fb54" | "041937f9-3a23-4eef-a206-7c1656243825" | "fb8c1498-1d6b-446c-891e-163a79e6d817" | "f912f511-6b44-46dd-bd40-be3031201561" | "f5b7eb43-2365-410a-95e0-beb92768809c" | "f26d400a-a7ff-4522-b098-485b2f34b123" | "f26c8c45-049e-46c7-a6bd-b217d9255d3e" | "ec82ea24-3249-4981-a28f-65a78d2a2cd0" | "ec4f77d4-60fa-4707-a094-ad18fdfbaa97" | "e8490197-0f00-4089-8b7f-e32f331a6edf" | "e7e88155-71c0-4e51-a3b4-8022468f7eca" | "e590a00d-1925-4759-aea8-21e3beabafac" | "e4db0c1b-f72d-494c-baa8-43c44d5765b6" | "e486f733-9769-4f8a-a8e2-d39e4e3eab81" | "e0f39dc4-f691-4e78-bba5-5c636692cc04" | "e098922a-9410-4d96-8e3c-402e26f7160b" | "df05515b-b647-4b60-9387-b0642c51b235" | "dd063dd5-c566-437e-b82a-a4f98eae1f38" | "dbf08c3e-d33a-4afb-bdb3-0f024a687d19" | "db21e50c-9c85-4177-9bb2-9bf177890e44" | "d7114790-534e-4007-b80d-6d176230553c";
62
+ container?: "mp3" | "wav" | "raw";
63
+ sampleRate?: number;
64
+ encoding?: "pcm_s16le" | "pcm_f32le";
65
+ bitRate?: number;
66
+ };
67
+ "bytedance-omnihuman-v1.5": {
51
68
  prompt?: string;
52
69
  imageUrls: [string, ...string[]];
53
70
  audioUrl: string;
54
71
  };
55
- "bytedance-upscaler": {
72
+ "bytedance-video-upscaler": {
56
73
  videoUrl: string;
57
74
  };
75
+ "claude-haiku-4-5": {
76
+ prompt: string;
77
+ imageUrls?: string[];
78
+ };
79
+ "claude-opus-4-8": {
80
+ prompt: string;
81
+ imageUrls?: string[];
82
+ };
83
+ "claude-sonnet-4-6": {
84
+ prompt: string;
85
+ imageUrls?: string[];
86
+ };
58
87
  "creatify-aurora": {
59
88
  prompt?: string;
60
89
  imageUrls: [string, ...string[]];
@@ -92,19 +121,24 @@ type ModelInputById = {
92
121
  prompt: string;
93
122
  voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
94
123
  };
95
- "eleven-voice-design-v2": {
124
+ "eleven-voice-create": {
96
125
  prompt: string;
97
126
  };
98
- "eleven-voice-design-v3": {
127
+ "eleven-voice-design-v2": {
99
128
  prompt: string;
100
129
  };
101
- "eleven-voice-previews": {
130
+ "eleven-voice-design-v3": {
102
131
  prompt: string;
103
132
  };
104
133
  "eleven-voice-remix": {
105
134
  voiceId?: "JBFqnCBsd6RMkjVDRZzb" | "EkK5I93UQWFDigLMpZcX" | "RILOU7YmBhvwJGDGjNmP" | "Z3R5wn05IrDiVCyEkUrK" | "NNl6r8mD7vthiJatiJt1" | "Bj9UqZbhQsanLzgalpEG" | "exsUS4vynmxd379XN4yO" | "BpjGufoPiobT79j2vtj4" | "kdmDKE6EkgrWrrykO9Qt" | "1SM7GgM6IMuvQlz2BwM3" | "ouL9IsyrSnUkCmfnD02u" | "5l5f8iK3YPeGga21rQIX" | "scOwDtmlUjD3prqpp97I" | "19STyYD15bswVz51nqLf" | "BZgkqPqms7Kj9ulSkVzn" | "wo6udizrrtpIxWGp2qJk" | "yjJ45q8TVCrtMhEKurxY" | "gU0LNdkMOQCOrPrwtbee" | "DGzg6RaUqxGRTHSBjfgF" | "x70vRnQBMBu4FAYhjJbO";
106
135
  prompt: string;
107
136
  };
137
+ "elevenlabs-music-v2": {
138
+ prompt: string;
139
+ duration?: 10 | 20 | 30 | 60 | 120 | 180 | 300 | 600;
140
+ isInstrumental?: boolean;
141
+ };
108
142
  "elevenlabs-sfx": {
109
143
  prompt: string;
110
144
  duration?: 1 | 3 | 5 | 8 | 10 | 15;
@@ -149,19 +183,26 @@ type ModelInputById = {
149
183
  language?: string;
150
184
  accent?: string;
151
185
  prompt: string;
152
- voiceId?: "Aoede" | "Charon" | "Fenrir" | "Kore" | "Leda" | "Orus" | "Perseus" | "Puck" | "Zephyr" | "Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Autonoe" | "Callirhoe" | "Despina" | "Enceladus" | "Erinome" | "Gacrux" | "Iapetus" | "Laomedeia" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zubenelgenubi";
186
+ voiceId?: "Aoede" | "Charon" | "Fenrir" | "Kore" | "Leda" | "Orus" | "Puck" | "Zephyr" | "Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Autonoe" | "Despina" | "Enceladus" | "Erinome" | "Gacrux" | "Iapetus" | "Laomedeia" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zubenelgenubi";
153
187
  };
154
188
  "gemini-2.5-pro-tts": {
155
189
  language?: string;
156
190
  accent?: string;
157
191
  prompt: string;
158
- voiceId?: "Aoede" | "Charon" | "Fenrir" | "Kore" | "Leda" | "Orus" | "Perseus" | "Puck" | "Zephyr" | "Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Autonoe" | "Callirhoe" | "Despina" | "Enceladus" | "Erinome" | "Gacrux" | "Iapetus" | "Laomedeia" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zubenelgenubi";
192
+ voiceId?: "Aoede" | "Charon" | "Fenrir" | "Kore" | "Leda" | "Orus" | "Puck" | "Zephyr" | "Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Autonoe" | "Despina" | "Enceladus" | "Erinome" | "Gacrux" | "Iapetus" | "Laomedeia" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zubenelgenubi";
193
+ };
194
+ "gemini-3-pro": {
195
+ prompt: string;
196
+ imageUrls?: string[];
197
+ videoUrl?: string;
198
+ thinking?: "off" | "low" | "high";
159
199
  };
160
200
  "gemini-3-pro-image": {
161
201
  prompt: string;
162
202
  aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3" | "2:3" | "21:9";
163
- resolution?: "0.5K" | "1K" | "2K" | "4K";
203
+ resolution?: "1K" | "2K" | "4K";
164
204
  count?: 1 | 2 | 4 | 6 | 8 | 10;
205
+ thinkingBudget?: number;
165
206
  imageUrls?: string[];
166
207
  };
167
208
  "gemini-3.1-flash-image": {
@@ -169,12 +210,34 @@ type ModelInputById = {
169
210
  aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3" | "3:2" | "2:3" | "4:5" | "5:4" | "4:1" | "1:4" | "8:1" | "1:8" | "21:9";
170
211
  resolution?: "0.5K" | "1K" | "2K" | "4K";
171
212
  count?: 1 | 2 | 4 | 6 | 8 | 10;
213
+ thinkingLevel?: "minimal" | "high";
214
+ imageUrls?: string[];
215
+ };
216
+ "gemini-3.1-flash-lite-image": {
217
+ prompt: string;
218
+ aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3" | "3:2" | "2:3" | "4:5" | "5:4" | "4:1" | "1:4" | "8:1" | "1:8" | "21:9";
219
+ count?: 1 | 2 | 4 | 6 | 8 | 10;
220
+ thinkingLevel?: "minimal" | "high";
172
221
  imageUrls?: string[];
173
222
  };
223
+ "gemini-omni-flash-preview": {
224
+ prompt: string;
225
+ aspectRatio?: "16:9" | "9:16";
226
+ duration?: 3 | 5 | 6 | 8 | 10;
227
+ imageUrls?: string[];
228
+ videoUrl?: string;
229
+ };
230
+ "gpt-5.5": {
231
+ prompt: string;
232
+ imageUrls?: string[];
233
+ thinking?: "off" | "low" | "medium" | "high";
234
+ };
174
235
  "gpt-image-1": {
175
236
  prompt: string;
176
237
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4";
177
238
  quality?: "high" | "medium" | "low";
239
+ background?: "opaque" | "transparent";
240
+ outputFormat?: "png" | "jpeg" | "webp";
178
241
  count?: 1 | 2 | 4 | 6 | 8 | 10;
179
242
  imageUrls?: string[];
180
243
  };
@@ -182,27 +245,62 @@ type ModelInputById = {
182
245
  prompt: string;
183
246
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4";
184
247
  quality?: "high" | "medium" | "low";
248
+ background?: "opaque" | "transparent";
249
+ outputFormat?: "png" | "jpeg" | "webp";
185
250
  count?: 1 | 2 | 4 | 6 | 8 | 10;
186
251
  imageUrls?: string[];
187
252
  };
188
- "grok": {
253
+ "gpt-image-2": {
189
254
  prompt: string;
190
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3";
191
- resolution?: "480p" | "720p";
192
- duration?: 3 | 5 | 6 | 8 | 10 | 12 | 15;
255
+ aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4" | "auto";
256
+ quality?: "high" | "medium" | "low";
257
+ outputFormat?: "png" | "jpeg" | "webp";
258
+ count?: 1 | 2 | 4 | 6 | 8 | 10;
193
259
  imageUrls?: string[];
194
260
  };
195
261
  "grok-edit-video": {
196
262
  prompt: string;
197
- duration?: 3 | 5 | 6 | 8 | 10 | 12 | 15;
198
263
  videoUrl: string;
199
264
  };
200
- "grok-imagine": {
265
+ "grok-extend-video": {
266
+ prompt: string;
267
+ duration?: 3 | 5 | 6 | 8 | 10;
268
+ videoUrl: string;
269
+ };
270
+ "grok-imagine-image": {
201
271
  prompt: string;
202
272
  aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "2:1" | "1:2" | "19.5:9" | "9:19.5" | "20:9" | "9:20";
273
+ resolution?: "1k" | "2k";
203
274
  count?: 1 | 2 | 4;
204
275
  imageUrls?: string[];
205
276
  };
277
+ "grok-imagine-image-quality": {
278
+ prompt: string;
279
+ aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "2:1" | "1:2" | "19.5:9" | "9:19.5" | "20:9" | "9:20";
280
+ resolution?: "1k" | "2k";
281
+ count?: 1 | 2 | 4;
282
+ imageUrls?: string[];
283
+ };
284
+ "grok-imagine-video": {
285
+ prompt: string;
286
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3";
287
+ resolution?: "480p" | "720p";
288
+ duration?: 3 | 5 | 6 | 8 | 10 | 12 | 15;
289
+ imageUrls?: string[];
290
+ };
291
+ "grok-imagine-video-1.5": {
292
+ prompt: string;
293
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3";
294
+ resolution?: "480p" | "720p" | "1080p";
295
+ duration?: 3 | 5 | 6 | 8 | 10 | 12 | 15;
296
+ imageUrls: [string, ...string[]];
297
+ };
298
+ "grok-tts": {
299
+ language?: string;
300
+ accent?: string;
301
+ prompt: string;
302
+ voiceId?: "eve" | "ara" | "rex" | "sal" | "leo";
303
+ };
206
304
  "hailuo-2.3": {
207
305
  prompt: string;
208
306
  enhancePrompt?: boolean;
@@ -225,25 +323,61 @@ type ModelInputById = {
225
323
  enhancePrompt?: boolean;
226
324
  imageUrls?: string[];
227
325
  };
326
+ "happyhorse-1.0-r2v": {
327
+ prompt: string;
328
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
329
+ resolution?: "720P" | "1080P";
330
+ duration?: 5 | 10 | 15;
331
+ imageUrls: [string, ...string[]];
332
+ };
333
+ "happyhorse-1.0-t2v": {
334
+ prompt: string;
335
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
336
+ resolution?: "720P" | "1080P";
337
+ duration?: 5 | 10 | 15;
338
+ startFrame?: string;
339
+ };
340
+ "happyhorse-1.0-video-edit": {
341
+ prompt: string;
342
+ resolution?: "720P" | "1080P";
343
+ audioSetting?: "auto" | "origin";
344
+ videoUrl: string;
345
+ imageUrls?: string[];
346
+ };
347
+ "happyhorse-1.1-r2v": {
348
+ prompt: string;
349
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
350
+ resolution?: "720P" | "1080P";
351
+ duration?: 5 | 10 | 15;
352
+ imageUrls: [string, ...string[]];
353
+ };
354
+ "happyhorse-1.1-t2v": {
355
+ prompt: string;
356
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
357
+ resolution?: "720P" | "1080P";
358
+ duration?: 5 | 10 | 15;
359
+ startFrame?: string;
360
+ };
228
361
  "heygen-talking-photo": {
229
362
  imageUrls: [string, ...string[]];
230
- resolution?: "1080p" | "720p";
363
+ resolution?: "4k" | "1080p" | "720p";
231
364
  aspectRatio?: "16:9" | "9:16";
232
365
  prompt: string;
233
366
  };
234
367
  "heygen-video-avatar": {
235
- resolution?: "1080p" | "720p";
368
+ resolution?: "4k" | "1080p" | "720p";
236
369
  aspectRatio?: "16:9" | "9:16";
237
370
  prompt: string;
238
371
  };
239
372
  "hunyuan-v3": {
240
373
  prompt: string;
241
374
  aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4";
242
- count?: 1 | 2 | 4 | 6 | 8 | 10;
375
+ count?: 1 | 2 | 4;
243
376
  negativePrompt?: string;
244
377
  cfgScale?: number;
245
378
  };
246
379
  "ideogram-character": {
380
+ prompt: string;
247
381
  resolution?: "1024x1024" | "1344x768" | "768x1344" | "1152x864" | "864x1152" | "832x1248" | "1280x800";
248
382
  renderingSpeed?: "TURBO" | "DEFAULT" | "QUALITY";
249
383
  style?: "AUTO" | "REALISTIC" | "FICTION";
@@ -251,6 +385,7 @@ type ModelInputById = {
251
385
  imageUrls: [string, ...string[]];
252
386
  };
253
387
  "ideogram-v3": {
388
+ prompt: string;
254
389
  aspectRatio?: "16:9" | "9:16" | "1:1" | "3:4" | "4:3";
255
390
  renderingSpeed?: "FLASH" | "TURBO" | "DEFAULT" | "QUALITY";
256
391
  style?: "GENERAL" | "REALISTIC" | "DESIGN";
@@ -259,238 +394,337 @@ type ModelInputById = {
259
394
  imageUrls?: string[];
260
395
  imageWeight?: number;
261
396
  };
397
+ "ideogram-v4": {
398
+ prompt: string;
399
+ resolution?: "2048x2048" | "1440x2880" | "2880x1440" | "1664x2496" | "2496x1664" | "1792x2240" | "2240x1792" | "1440x2560" | "2560x1440" | "1600x2560" | "2560x1600" | "1728x2304" | "2304x1728" | "1296x3168" | "3168x1296" | "1152x2944" | "2944x1152" | "1248x3328" | "3328x1248" | "1280x3072" | "3072x1280";
400
+ renderingSpeed?: "TURBO" | "DEFAULT" | "QUALITY";
401
+ enableCopyrightDetection?: boolean;
402
+ };
262
403
  "imagen-4.0": {
263
404
  prompt: string;
264
405
  aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3";
265
- count?: 1 | 2 | 4 | 6 | 8 | 10;
406
+ count?: 1 | 2 | 4;
266
407
  enhancePrompt?: boolean;
267
408
  negativePrompt?: string;
268
409
  };
269
410
  "imagen-4.0-fast": {
270
411
  prompt: string;
271
412
  aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3";
272
- count?: 1 | 2 | 4 | 6 | 8 | 10;
413
+ count?: 1 | 2 | 4;
273
414
  enhancePrompt?: boolean;
274
415
  negativePrompt?: string;
275
416
  };
276
417
  "imagen-4.0-ultra": {
277
418
  prompt: string;
278
419
  aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3";
279
- count?: 1 | 2 | 4 | 6 | 8 | 10;
420
+ count?: 1 | 2 | 4;
280
421
  enhancePrompt?: boolean;
281
422
  negativePrompt?: string;
282
423
  };
283
- "kling-2.6-pro": {
284
- prompt: string;
285
- aspectRatio?: "16:9" | "9:16" | "1:1";
286
- duration?: 5 | 10;
287
- imageUrls?: string[];
288
- negativePrompt?: string;
289
- generateAudio?: boolean;
290
- cfgScale?: number;
291
- };
292
- "kling-2.6-standard": {
293
- prompt: string;
294
- aspectRatio?: "16:9" | "9:16" | "1:1";
295
- duration?: 5 | 10;
296
- imageUrls?: string[];
297
- negativePrompt?: string;
298
- generateAudio?: boolean;
299
- cfgScale?: number;
300
- };
301
424
  "kling-3.0-image": {
302
425
  prompt: string;
303
426
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
304
427
  resolution?: "1k" | "2k" | "4k";
305
- count?: 1 | 2 | 4 | 6 | 8;
428
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
306
429
  imageUrls?: string[];
307
430
  };
308
- "kling-3.0-pro": {
309
- prompt: string;
310
- aspectRatio?: "16:9" | "9:16" | "1:1";
311
- duration?: 3 | 5 | 8 | 10 | 12 | 15;
312
- imageUrls?: string[];
313
- negativePrompt?: string;
314
- generateAudio?: boolean;
315
- };
316
- "kling-3.0-standard": {
317
- prompt: string;
318
- aspectRatio?: "16:9" | "9:16" | "1:1";
319
- duration?: 3 | 5 | 8 | 10 | 12 | 15;
320
- imageUrls?: string[];
321
- negativePrompt?: string;
322
- generateAudio?: boolean;
323
- };
324
431
  "kling-avatar": {
325
432
  prompt?: string;
326
433
  renderingSpeed?: "std" | "pro";
327
434
  imageUrls: [string, ...string[]];
328
435
  audioUrl: string;
436
+ audioId?: string;
437
+ };
438
+ "kling-elements": {
439
+ elementName: string;
440
+ elementDescription: string;
441
+ referenceType: "image_refer" | "video_refer";
442
+ imageUrls?: string[];
443
+ videoUrl?: string;
444
+ elementVoiceId?: string;
329
445
  };
330
446
  "kling-motion-control": {
331
447
  prompt?: string;
332
448
  resolution?: "720p" | "1080p";
449
+ renderingSpeed?: "std" | "pro";
450
+ characterOrientation?: "image" | "video";
451
+ keepOriginalSound?: "yes" | "no";
333
452
  imageUrls: [string, ...string[]];
334
453
  videoUrl: string;
335
454
  };
336
455
  "kling-motion-control-v3": {
337
456
  prompt?: string;
338
457
  resolution?: "720p" | "1080p";
458
+ renderingSpeed?: "std" | "pro";
459
+ characterOrientation?: "image" | "video";
460
+ keepOriginalSound?: "yes" | "no";
339
461
  imageUrls: [string, ...string[]];
340
462
  videoUrl: string;
341
463
  };
342
464
  "kling-multi-image": {
343
465
  prompt?: string;
344
466
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
345
- count?: 1 | 2 | 4 | 6 | 8;
467
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
346
468
  imageUrls: [string, ...string[]];
469
+ sceneImage?: string;
470
+ styleImage?: string;
347
471
  };
348
472
  "kling-multi-image-v2-1": {
349
473
  prompt?: string;
350
474
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
351
- count?: 1 | 2 | 4 | 6 | 8;
475
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
352
476
  imageUrls: [string, ...string[]];
477
+ sceneImage?: string;
478
+ styleImage?: string;
353
479
  };
354
480
  "kling-o1-image": {
355
481
  prompt: string;
356
482
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
357
483
  resolution?: "1k" | "2k";
358
- count?: 1 | 2 | 4 | 6 | 8;
484
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
359
485
  imageUrls?: string[];
360
486
  };
361
- "kling-o1-pro": {
362
- prompt: string;
363
- aspectRatio?: "16:9" | "9:16" | "1:1";
364
- duration?: 3 | 5 | 8 | 10 | 12 | 15;
365
- imageUrls?: string[];
366
- negativePrompt?: string;
367
- generateAudio?: boolean;
368
- };
369
- "kling-o3-pro": {
370
- prompt: string;
371
- aspectRatio?: "16:9" | "9:16" | "1:1";
372
- duration?: 3 | 5 | 8 | 10 | 12 | 15;
373
- imageUrls?: string[];
374
- negativePrompt?: string;
375
- generateAudio?: boolean;
376
- };
377
- "kling-o3-standard": {
378
- prompt: string;
379
- aspectRatio?: "16:9" | "9:16" | "1:1";
380
- duration?: 3 | 5 | 8 | 10 | 12 | 15;
381
- imageUrls?: string[];
382
- negativePrompt?: string;
383
- generateAudio?: boolean;
384
- };
385
- "kling-omni": {
386
- prompt: string;
387
- aspectRatio?: "16:9" | "9:16" | "1:1";
388
- duration?: 3 | 5 | 8 | 10 | 12 | 15;
389
- resolution?: "720p" | "1080p";
390
- negativePrompt?: string;
391
- };
392
487
  "kling-t2a": {
393
488
  prompt: string;
394
- duration?: 5 | 10;
489
+ duration?: number;
395
490
  };
396
491
  "kling-v1-5-image": {
397
492
  prompt: string;
398
493
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
399
- count?: 1 | 2 | 4 | 6 | 8;
494
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
400
495
  negativePrompt?: string;
401
- imageUrls?: string[];
496
+ imageUrls: [string, ...string[]];
497
+ imageReference?: "subject" | "face";
402
498
  imageWeight?: number;
499
+ humanFidelity?: number;
403
500
  };
404
501
  "kling-v2-1-image": {
405
502
  prompt: string;
406
503
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
407
- count?: 1 | 2 | 4 | 6 | 8;
504
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
408
505
  negativePrompt?: string;
409
506
  imageUrls?: string[];
410
507
  imageWeight?: number;
508
+ humanFidelity?: number;
509
+ };
510
+ "kling-v2-6": {
511
+ prompt: string;
512
+ aspectRatio?: "16:9" | "9:16" | "1:1";
513
+ duration?: 5 | 10;
514
+ startFrame?: string;
515
+ endFrame?: string;
516
+ negativePrompt?: string;
517
+ generateAudio?: boolean;
518
+ cfgScale?: number;
519
+ renderingSpeed?: "std" | "pro";
411
520
  };
412
521
  "kling-v2-image": {
413
522
  prompt: string;
414
523
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
415
- count?: 1 | 2 | 4 | 6 | 8;
524
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
416
525
  negativePrompt?: string;
417
526
  imageUrls?: string[];
418
527
  imageWeight?: number;
528
+ humanFidelity?: number;
419
529
  };
420
530
  "kling-v2-new-image": {
421
531
  prompt: string;
422
532
  aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
423
- count?: 1 | 2 | 4 | 6 | 8;
533
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
424
534
  negativePrompt?: string;
425
535
  imageUrls: [string, ...string[]];
536
+ imageReference?: "subject" | "face";
426
537
  imageWeight?: number;
538
+ humanFidelity?: number;
427
539
  };
428
540
  "kling-v2a": {
429
541
  videoUrl: string;
430
542
  };
543
+ "kling-v3": {
544
+ prompt: string;
545
+ aspectRatio?: "16:9" | "9:16" | "1:1";
546
+ duration?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
547
+ startFrame?: string;
548
+ endFrame?: string;
549
+ negativePrompt?: string;
550
+ generateAudio?: boolean;
551
+ multiShot?: boolean;
552
+ shotType?: "customize" | "intelligence";
553
+ multiPrompt?: Array<{
554
+ index: number;
555
+ prompt: string;
556
+ duration: string;
557
+ }>;
558
+ voiceList?: Array<{
559
+ voice_id: string;
560
+ }>;
561
+ elementList?: Array<{
562
+ element_id: string;
563
+ }>;
564
+ staticMask?: string;
565
+ renderingSpeed?: "std" | "pro" | "4k";
566
+ };
567
+ "kling-v3-omni": {
568
+ prompt: string;
569
+ aspectRatio?: "16:9" | "9:16" | "1:1";
570
+ duration?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
571
+ resolution?: "720p" | "1080p" | "4k";
572
+ renderingSpeed?: "std" | "pro";
573
+ generateAudio?: boolean;
574
+ multiShot?: boolean;
575
+ shotType?: "customize";
576
+ multiPrompt?: Array<{
577
+ index: number;
578
+ prompt: string;
579
+ duration: string;
580
+ }>;
581
+ omniImageList?: Array<{
582
+ image_url: string;
583
+ type?: "first_frame" | "end_frame";
584
+ }>;
585
+ omniVideoList?: Array<{
586
+ video_url: string;
587
+ refer_type: "feature" | "base";
588
+ keep_original_sound: "yes" | "no";
589
+ }>;
590
+ elementList?: Array<{
591
+ element_id: string;
592
+ }>;
593
+ };
594
+ "kling-v3-turbo": {
595
+ prompt: string;
596
+ aspectRatio?: "16:9" | "9:16" | "1:1";
597
+ duration?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
598
+ negativePrompt?: string;
599
+ resolution?: "720p" | "1080p";
600
+ startFrame?: string;
601
+ staticMask?: string;
602
+ };
603
+ "kling-video-effects": {
604
+ style?: "korean_baseball" | "pet_skateboard" | "daily_ootd" | "tiny_beast_printer" | "landmark_reveal" | "winter_charm" | "flash_ride" | "maestro_of_magic" | "magic_carpet_ride" | "good_luck_spirit" | "shooting_star" | "sparkler_wand" | "sovereign_scepter" | "dirt_rush" | "return_of_the_king" | "dance_with_dragon" | "minimalist_light" | "martial_meow" | "sassy_shake" | "knock_at_a_door_revenge" | "palm_sized_figure_pro" | "prank_box" | "perler_beads" | "spring_bloom" | "toss_run" | "switch_to_silk" | "get_rich_quick" | "make_it_rain" | "twist_shake" | "the_hip_sway" | "send_my_love" | "funky_martian" | "wealth_drive" | "the_high_kick" | "the_exercise" | "lucky_veggie" | "studio_look" | "flash_drive" | "shush_my_dreams" | "french_elegance" | "finger_swipe" | "advent_of_flora" | "smooth_transition" | "kiss_pro" | "raid_check" | "snow_night_kiss" | "eternal_kiss" | "fortune_in_motion" | "chinese_trend" | "sedan_chair_dance" | "skyfall" | "good_luck_dance" | "laicai_dance" | "yangge_dance" | "color_mixing" | "palm_sized_figure" | "lantern_festival_cuju" | "unique_firework" | "unique_spring_couplets" | "horse_mask" | "fortune_knocks_cartoon" | "tangyuan_to_animal" | "hot_feet_dance" | "swag_dance" | "pigeon_dance" | "bloodline_dance" | "chanel_dance" | "cute_dance" | "love_theme_song" | "pumpitup_dance" | "city_to_village" | "fortune_god_transform" | "new_year_feast" | "ring_in_new" | "horse_year_firework" | "pet_vlogger" | "crystal_horse" | "lateral_shift_transition" | "drunk_dance" | "drunk_dance_pet" | "daoma_dance" | "bouncy_dance" | "smooth_sailing_dance" | "new_year_greeting" | "lion_dance" | "prosperity" | "great_success" | "golden_horse_fortune" | "red_packet_box" | "lucky_horse_year" | "lucky_red_packet" | "lucky_money_come" | "lion_dance_pet" | "dumpling_making_pet" | "fish_making_pet" | "pet_red_packet" | "lantern_glow" | "expression_challenge" | "overdrive" | "heart_gesture_dance" | "poping" | "martial_arts" | "running" | "nezha" | "motorcycle_dance" | "subject_3_dance" | "ghost_step_dance" | "phantom_jewel" | "zoom_out" | "cheers_2026" | "fight_pro" | "hug_pro" | "heart_gesture_pro" | "dollar_rain_pro" | "pet_bee_pro" | "countdown_teleport" | "santa_random_surprise" | "magic_match_tree" | "bullet_time_360" | "happy_birthday" | "birthday_star" | "thumbs_up_pro" | "tiger_hug_pro" | "pet_lion_pro" | "surprise_bouquet" | "bouquet_drop" | "3d_cartoon_1_pro" | "firework_2026" | "glamour_photo_shoot" | "box_of_joy" | "first_toast_of_the_year" | "my_santa_pic" | "santa_gift" | "steampunk_christmas" | "snowglobe" | "christmas_photo_shoot" | "ornament_crash" | "santa_express" | "instant_christmas" | "particle_santa_surround" | "coronation_of_frost" | "building_sweater" | "spark_in_the_snow" | "scarlet_and_snow" | "cozy_toon_wrap" | "bullet_time_lite" | "magic_cloak" | "balloon_parade" | "jumping_ginger_joy" | "bullet_time" | "c4d_cartoon_pro" | "pure_white_wings" | "black_wings" | "golden_wing" | "pink_pink_wings" | "venomous_spider" | "throne_of_king" | "luminous_elf" | "woodland_elf" | "japanese_anime_1" | "american_comics" | "guardian_spirit" | "swish_swish" | "snowboarding" | "witch_transform" | "vampire_transform" | "pumpkin_head_transform" | "demon_transform" | "mummy_transform" | "zombie_transform" | "cute_pumpkin_transform" | "cute_ghost_transform" | "knock_knock_halloween" | "halloween_escape" | "baseball" | "inner_voice" | "a_list_look" | "memory_alive" | "trampoline" | "trampoline_night" | "pucker_up" | "guess_what" | "feed_mooncake" | "rampage_ape" | "flyer" | "dishwasher" | "pet_chinese_opera" | "magic_fireball" | "gallery_ring" | "pet_moto_rider" | "muscle_pet" | "squeeze_scream" | "pet_delivery" | "running_man" | "disappear" | "mythic_style" | "steampunk" | "3d_cartoon_2" | "eagle_snatch" | "hug_from_past" | "firework" | "media_interview" | "pet_chef" | "santa_gifts" | "santa_hug" | "heart_gesture_1" | "pet_wizard" | "smoke_smoke" | "instant_kid" | "dollar_rain" | "cry_cry" | "building_collapse" | "gun_shot" | "mushroom" | "double_gun" | "pet_warrior" | "lightning_power" | "jesus_hug" | "shark_alert" | "long_hair" | "lie_flat" | "polar_bear_hug" | "brown_bear_hug" | "jazz_jazz" | "office_escape_plow" | "fly_fly" | "watermelon_bomb" | "pet_dance" | "boss_coming" | "wool_curly" | "pet_bee" | "marry_me" | "swing_swing" | "day_to_night" | "piggy_morph" | "wig_out" | "car_explosion" | "ski_ski" | "siblings" | "construction_worker" | "let's_ride" | "snatched" | "magic_broom" | "felt_felt" | "jumpdrop" | "surfsurf" | "fairy_wing" | "angel_wing" | "dark_wing" | "skateskate" | "plushcut" | "jelly_press" | "jelly_slice" | "jelly_squish" | "jelly_jiggle" | "pixelpixel" | "yearbook" | "instant_film" | "anime_figure" | "rocketrocket" | "bloombloom" | "dizzydizzy" | "fuzzyfuzzy" | "squish" | "expansion" | "emoji" | "tennis_trend" | "whirling_beverage" | "f1_live" | "football_live" | "spielberg_transition";
605
+ imageUrls: [string, ...string[]];
606
+ };
607
+ "kling-video-o1": {
608
+ prompt: string;
609
+ aspectRatio?: "16:9" | "9:16" | "1:1";
610
+ duration?: 5 | 10;
611
+ resolution?: "720p" | "1080p";
612
+ renderingSpeed?: "std" | "pro";
613
+ generateAudio?: boolean;
614
+ };
431
615
  "ltx-2.3-a2v": {
432
616
  prompt?: string;
433
617
  audioUrl: string;
434
618
  imageUrls?: string[];
435
619
  cfgScale?: number;
436
620
  };
437
- "ltx-2.3-extend": {
438
- prompt?: string;
439
- duration?: 5 | 10 | 15 | 20;
440
- videoUrl: string;
441
- };
442
- "ltx-2.3-fast-t2v": {
621
+ "ltx-pro-t2v": {
443
622
  prompt: string;
444
- duration?: 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20;
623
+ duration?: 6 | 8 | 10;
445
624
  resolution?: "1080p" | "1440p" | "2160p";
446
- aspectRatio?: "16:9" | "9:16";
447
625
  generateAudio?: boolean;
448
626
  imageUrls?: string[];
449
627
  };
450
- "ltx-2.3-pro-t2v": {
628
+ "ltx-v2-fast": {
451
629
  prompt: string;
452
- duration?: 6 | 8 | 10;
630
+ duration?: 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20;
453
631
  resolution?: "1080p" | "1440p" | "2160p";
454
- aspectRatio?: "16:9" | "9:16";
455
632
  generateAudio?: boolean;
456
633
  imageUrls?: string[];
457
634
  };
458
- "ltx-2.3-retake": {
635
+ "ltx-v2-retake": {
459
636
  prompt: string;
460
637
  duration?: 5 | 10 | 15 | 20;
461
638
  videoUrl: string;
462
639
  };
463
- "ltx-fast-t2v": {
640
+ "ltx-v2.3-extend": {
641
+ prompt?: string;
642
+ duration?: 5 | 10 | 15 | 20;
643
+ videoUrl: string;
644
+ };
645
+ "ltx-v2.3-fast": {
464
646
  prompt: string;
465
647
  duration?: 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20;
466
648
  resolution?: "1080p" | "1440p" | "2160p";
649
+ aspectRatio?: "16:9" | "9:16";
467
650
  generateAudio?: boolean;
468
651
  imageUrls?: string[];
469
652
  };
470
- "ltx-pro-t2v": {
653
+ "ltx-v2.3-pro": {
471
654
  prompt: string;
472
655
  duration?: 6 | 8 | 10;
473
656
  resolution?: "1080p" | "1440p" | "2160p";
657
+ aspectRatio?: "16:9" | "9:16";
474
658
  generateAudio?: boolean;
475
659
  imageUrls?: string[];
476
660
  };
477
- "ltx-retake": {
661
+ "ltx-v2.3-retake": {
478
662
  prompt: string;
479
663
  duration?: 5 | 10 | 15 | 20;
480
664
  videoUrl: string;
481
665
  };
482
- "luma-flash2-i2v": {
666
+ "luma-ray-2": {
483
667
  prompt: string;
484
668
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
485
669
  resolution?: "540p" | "720p" | "1080p" | "4k";
486
670
  duration?: 5 | 9;
487
- imageUrls: [string, ...string[]];
671
+ startFrame?: string;
672
+ endFrame?: string;
673
+ };
674
+ "luma-ray-2-reframe-video": {
675
+ prompt?: string;
676
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
677
+ videoUrl: string;
678
+ };
679
+ "luma-ray-3.2": {
680
+ prompt: string;
681
+ aspectRatio?: "9:16" | "3:4" | "1:1" | "4:3" | "16:9" | "21:9";
682
+ resolution?: "540p" | "720p" | "1080p";
683
+ duration?: 5 | 10;
684
+ startFrame?: string;
685
+ endFrame?: string;
686
+ hdr?: boolean;
687
+ exrExport?: boolean;
688
+ loop?: boolean;
689
+ };
690
+ "luma-ray-3.2-edit": {
691
+ prompt: string;
692
+ videoUrl: string;
693
+ resolution?: "540p" | "720p" | "1080p";
694
+ duration?: 5 | 10;
695
+ editStrength?: "adhere_1" | "adhere_2" | "adhere_3" | "flex_1" | "flex_2" | "flex_3" | "reimagine_1" | "reimagine_2" | "reimagine_3";
696
+ hdr?: boolean;
697
+ exrExport?: boolean;
698
+ };
699
+ "luma-ray-3.2-reframe-video": {
700
+ prompt: string;
701
+ aspectRatio?: "9:16" | "3:4" | "1:1" | "4:3" | "16:9" | "21:9";
702
+ videoUrl: string;
703
+ resolution?: "540p" | "720p" | "1080p";
488
704
  };
489
- "luma-ray2-t2v": {
705
+ "luma-ray-flash-2": {
490
706
  prompt: string;
491
707
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
492
708
  resolution?: "540p" | "720p" | "1080p" | "4k";
493
709
  duration?: 5 | 9;
710
+ startFrame: string;
711
+ endFrame?: string;
712
+ };
713
+ "luma-ray-flash-2-reframe-video": {
714
+ prompt?: string;
715
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
716
+ videoUrl: string;
717
+ };
718
+ "luma-uni-1": {
719
+ prompt: string;
720
+ aspectRatio?: "3:1" | "2:1" | "16:9" | "3:2" | "1:1" | "2:3" | "9:16" | "1:2" | "1:3";
721
+ style?: "auto" | "manga";
722
+ imageUrls?: string[];
723
+ };
724
+ "luma-uni-1-max": {
725
+ prompt: string;
726
+ aspectRatio?: "3:1" | "2:1" | "16:9" | "3:2" | "1:1" | "2:3" | "9:16" | "1:2" | "1:3";
727
+ style?: "auto" | "manga";
494
728
  imageUrls?: string[];
495
729
  };
496
730
  "lyria-3-clip": {
@@ -506,8 +740,12 @@ type ModelInputById = {
506
740
  accent?: string;
507
741
  prompt: string;
508
742
  };
509
- "minimax-music": {
743
+ "minimax-music-v2": {
510
744
  prompt: string;
745
+ lyricsPrompt?: string;
746
+ lyricsOptimizer?: boolean;
747
+ isInstrumental?: boolean;
748
+ outputFormat?: "url" | "hex";
511
749
  };
512
750
  "openai-tts-1": {
513
751
  prompt: string;
@@ -517,7 +755,7 @@ type ModelInputById = {
517
755
  prompt: string;
518
756
  voiceId?: "alloy" | "ash" | "ballad" | "coral" | "echo" | "fable" | "nova" | "onyx" | "sage" | "shimmer" | "verse";
519
757
  };
520
- "ovi-t2v": {
758
+ "ovi": {
521
759
  prompt: string;
522
760
  size?: "9:16" | "16:9" | "1:1" | "9:16+" | "16:9+" | "2:5" | "5:2";
523
761
  imageUrls?: string[];
@@ -529,45 +767,125 @@ type ModelInputById = {
529
767
  "picsart-enhance": {
530
768
  imageUrls: [string, ...string[]];
531
769
  };
532
- "picsart-remove-bg": {
770
+ "picsart-flux-2-klein": {
771
+ prompt: string;
772
+ aspectRatio?: "1:1" | "5:3" | "3:5" | "4:3" | "3:4";
773
+ imageUrls?: string[];
774
+ };
775
+ "picsart-qwen-image-edit": {
533
776
  imageUrls: [string, ...string[]];
777
+ prompt: string;
778
+ negativePrompt?: string;
534
779
  };
535
- "pika-frames": {
780
+ "picsart-qwen-image-edit-angle": {
781
+ imageUrls: [string, ...string[]];
536
782
  prompt: string;
537
- duration?: 5 | 10;
538
- resolution?: "720p" | "1080p";
783
+ negativePrompt?: string;
784
+ numInferenceSteps?: number;
785
+ cfgScale?: number;
786
+ loraWeights?: {
787
+ lora_angle?: number;
788
+ lora_angle_lighting?: number;
789
+ };
790
+ };
791
+ "picsart-qwen-makeup": {
539
792
  imageUrls: [string, ...string[]];
793
+ prompt: string;
794
+ negativePrompt?: string;
540
795
  };
541
- "pika-scenes": {
796
+ "picsart-sana-sprint-v1": {
797
+ prompt: string;
798
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
799
+ };
800
+ "picsart-sod-v8-2": {
801
+ imageUrls: [string, ...string[]];
802
+ };
803
+ "picsart-videography": {
804
+ imageUrls: [string, ...string[]];
805
+ };
806
+ "pika-2.2": {
542
807
  prompt: string;
543
808
  duration?: 5 | 10;
544
809
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:5" | "5:4" | "3:2" | "2:3";
545
810
  resolution?: "720p" | "1080p";
811
+ imageUrls?: string[];
812
+ };
813
+ "pika-2.2-frames": {
814
+ prompt: string;
815
+ duration?: 5 | 10;
816
+ resolution?: "720p" | "1080p";
546
817
  imageUrls: [string, ...string[]];
547
818
  };
548
- "pika-t2v": {
819
+ "pika-2.2-scenes": {
549
820
  prompt: string;
550
821
  duration?: 5 | 10;
551
822
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:5" | "5:4" | "3:2" | "2:3";
552
823
  resolution?: "720p" | "1080p";
553
- imageUrls?: string[];
824
+ imageUrls: [string, ...string[]];
825
+ };
826
+ "pixverse-c1": {
827
+ prompt: string;
828
+ quality?: "360p" | "540p" | "720p" | "1080p";
829
+ duration?: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
830
+ generateAudio?: boolean;
831
+ aspectRatio?: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "2:3" | "3:2" | "21:9";
832
+ };
833
+ "pixverse-c1-fusion": {
834
+ prompt: string;
835
+ quality?: "360p" | "540p" | "720p" | "1080p";
836
+ duration?: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
837
+ generateAudio?: boolean;
838
+ aspectRatio?: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "2:3" | "3:2" | "21:9";
839
+ imageUrls: [string, ...string[]];
840
+ };
841
+ "pixverse-c1-image": {
842
+ prompt: string;
843
+ quality?: "360p" | "540p" | "720p" | "1080p";
844
+ duration?: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
845
+ generateAudio?: boolean;
846
+ imageUrls: [string, ...string[]];
847
+ };
848
+ "pixverse-v6": {
849
+ prompt: string;
850
+ quality?: "360p" | "540p" | "720p" | "1080p";
851
+ duration?: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
852
+ generateAudio?: boolean;
853
+ aspectRatio?: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "2:3" | "3:2" | "21:9";
854
+ };
855
+ "pixverse-v6-fusion": {
856
+ prompt: string;
857
+ quality?: "360p" | "540p" | "720p" | "1080p";
858
+ duration?: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
859
+ generateAudio?: boolean;
860
+ aspectRatio?: "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "2:3" | "3:2" | "21:9";
861
+ imageUrls: [string, ...string[]];
862
+ };
863
+ "pixverse-v6-image": {
864
+ prompt: string;
865
+ quality?: "360p" | "540p" | "720p" | "1080p";
866
+ duration?: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
867
+ generateAudio?: boolean;
868
+ imageUrls: [string, ...string[]];
554
869
  };
555
870
  "qwen": {
556
871
  prompt: string;
557
872
  count?: 1 | 2 | 4 | 6 | 8 | 10;
558
873
  imageUrls?: string[];
559
874
  };
560
- "qwen-2": {
875
+ "qwen-image-2": {
561
876
  prompt: string;
562
877
  count?: 1 | 2 | 4 | 6 | 8 | 10;
563
878
  imageUrls?: string[];
564
879
  };
565
- "qwen-2-pro": {
880
+ "qwen-image-2-pro": {
566
881
  prompt: string;
567
- count?: 1 | 2 | 4 | 6 | 8 | 10;
882
+ negativePrompt?: string;
883
+ resolution?: "2048x2048" | "2688x1536" | "1536x2688" | "2368x1728" | "1728x2368";
884
+ count?: 1 | 2 | 4 | 6;
885
+ enhancePrompt?: boolean;
568
886
  imageUrls?: string[];
569
887
  };
570
- "qwen-edit-plus": {
888
+ "qwen-image-edit-plus": {
571
889
  prompt: string;
572
890
  imageUrls: [string, ...string[]];
573
891
  };
@@ -586,24 +904,24 @@ type ModelInputById = {
586
904
  sourceImageId: string;
587
905
  similarity?: number;
588
906
  };
589
- "recraft-replace-bg": {
907
+ "recraft-vectorize": {
590
908
  prompt?: string;
591
909
  imageUrls: [string, ...string[]];
592
910
  };
593
- "recraft-v2": {
911
+ "recraftv2": {
594
912
  prompt: string;
595
913
  style?: "realistic_image" | "digital_illustration" | "vector_illustration" | "icon";
596
914
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
597
915
  count?: 1 | 2 | 4 | 6;
598
916
  negativePrompt?: string;
599
917
  };
600
- "recraft-v2-vector": {
918
+ "recraftv2_vector": {
601
919
  prompt: string;
602
920
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
603
921
  count?: 1 | 2 | 4 | 6;
604
922
  negativePrompt?: string;
605
923
  };
606
- "recraft-v3": {
924
+ "recraftv3": {
607
925
  prompt: string;
608
926
  style?: "realistic_image" | "digital_illustration" | "vector_illustration" | "any";
609
927
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
@@ -612,80 +930,250 @@ type ModelInputById = {
612
930
  imageUrls?: string[];
613
931
  imageWeight?: number;
614
932
  };
615
- "recraft-v3-vector": {
933
+ "recraftv3_vector": {
616
934
  prompt: string;
617
935
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
618
936
  count?: 1 | 2 | 4 | 6;
619
937
  negativePrompt?: string;
620
938
  };
621
- "recraft-v4": {
939
+ "recraftv3-replace-bg": {
940
+ prompt?: string;
941
+ imageUrls: [string, ...string[]];
942
+ };
943
+ "recraftv4": {
622
944
  prompt: string;
623
945
  style?: "raster" | "vector_illustration";
624
946
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
625
947
  count?: 1 | 2 | 4 | 6;
948
+ imageUrls?: string[];
949
+ imageWeight?: number;
626
950
  };
627
- "recraft-v4-pro": {
951
+ "recraftv4_1": {
628
952
  prompt: string;
629
- style?: "raster" | "vector_illustration";
630
953
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
631
954
  count?: 1 | 2 | 4 | 6;
955
+ imageUrls?: string[];
956
+ imageWeight?: number;
632
957
  };
633
- "recraft-v4-pro-vector": {
958
+ "recraftv4_1_pro": {
634
959
  prompt: string;
635
960
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
636
961
  count?: 1 | 2 | 4 | 6;
962
+ imageUrls?: string[];
963
+ imageWeight?: number;
637
964
  };
638
- "recraft-v4-vector": {
965
+ "recraftv4_1_pro_vector": {
639
966
  prompt: string;
640
967
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
641
968
  count?: 1 | 2 | 4 | 6;
969
+ imageUrls?: string[];
970
+ imageWeight?: number;
642
971
  };
643
- "recraft-vectorize": {
644
- prompt?: string;
645
- imageUrls: [string, ...string[]];
972
+ "recraftv4_1_utility": {
973
+ prompt: string;
974
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
975
+ count?: 1 | 2 | 4 | 6;
976
+ imageUrls?: string[];
977
+ imageWeight?: number;
978
+ };
979
+ "recraftv4_1_utility_pro": {
980
+ prompt: string;
981
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
982
+ count?: 1 | 2 | 4 | 6;
983
+ imageUrls?: string[];
984
+ imageWeight?: number;
985
+ };
986
+ "recraftv4_1_utility_pro_vector": {
987
+ prompt: string;
988
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
989
+ count?: 1 | 2 | 4 | 6;
990
+ imageUrls?: string[];
991
+ imageWeight?: number;
992
+ };
993
+ "recraftv4_1_utility_vector": {
994
+ prompt: string;
995
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
996
+ count?: 1 | 2 | 4 | 6;
997
+ imageUrls?: string[];
998
+ imageWeight?: number;
999
+ };
1000
+ "recraftv4_1_vector": {
1001
+ prompt: string;
1002
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1003
+ count?: 1 | 2 | 4 | 6;
1004
+ imageUrls?: string[];
1005
+ imageWeight?: number;
1006
+ };
1007
+ "recraftv4_pro": {
1008
+ prompt: string;
1009
+ style?: "raster" | "vector_illustration";
1010
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1011
+ count?: 1 | 2 | 4 | 6;
1012
+ imageUrls?: string[];
1013
+ imageWeight?: number;
1014
+ };
1015
+ "recraftv4_pro_vector": {
1016
+ prompt: string;
1017
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1018
+ count?: 1 | 2 | 4 | 6;
1019
+ imageUrls?: string[];
1020
+ imageWeight?: number;
1021
+ };
1022
+ "recraftv4_vector": {
1023
+ prompt: string;
1024
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1025
+ count?: 1 | 2 | 4 | 6;
1026
+ imageUrls?: string[];
1027
+ imageWeight?: number;
646
1028
  };
647
1029
  "reve": {
648
1030
  prompt: string;
649
1031
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3";
650
1032
  count?: 1 | 2 | 4 | 6 | 8 | 10;
651
1033
  imageUrls?: string[];
652
- negativePrompt?: string;
653
1034
  };
654
- "runway-aleph": {
1035
+ "runway-aleph2": {
655
1036
  prompt: string;
656
1037
  videoUrl: string;
1038
+ startFrame?: string;
1039
+ endFrame?: string;
1040
+ };
1041
+ "runway-avatar-video": {
1042
+ style?: "game-character" | "music-superstar" | "game-character-man" | "cat-character" | "influencer" | "tennis-coach" | "human-resource" | "fashion-designer" | "cooking-teacher";
1043
+ voiceId?: "victoria" | "vincent" | "clara" | "drew" | "skye" | "max" | "morgan" | "felix" | "mia" | "marcus" | "summer" | "ruby" | "aurora" | "jasper" | "leo" | "adrian" | "nina" | "emma" | "blake" | "david" | "maya" | "nathan" | "sam" | "georgia" | "petra" | "adam" | "zach" | "violet" | "roman" | "luna";
1044
+ prompt?: string;
1045
+ audioUrl?: string;
657
1046
  };
658
1047
  "runway-gen3a-turbo": {
659
1048
  prompt: string;
660
1049
  duration?: 5 | 10;
661
1050
  aspectRatio?: "16:9" | "9:16";
662
- imageUrls: [string, ...string[]];
1051
+ startFrame: string;
1052
+ endFrame?: string;
1053
+ };
1054
+ "runway-gen4-aleph": {
1055
+ prompt: string;
1056
+ videoUrl: string;
663
1057
  };
664
1058
  "runway-gen4-ref": {
665
1059
  prompt: string;
666
- duration?: 5 | 10;
667
1060
  aspectRatio?: "16:9" | "9:16";
668
1061
  imageUrls: [string, ...string[]];
669
1062
  };
670
- "runway-gen45-t2v": {
1063
+ "runway-gen4.5": {
671
1064
  prompt: string;
672
1065
  duration?: 5 | 8 | 10;
673
1066
  aspectRatio?: "16:9" | "9:16";
674
1067
  imageUrls?: string[];
675
1068
  };
676
- "seedance-1.5-pro": {
1069
+ "seedance-1.5-pro": {
1070
+ prompt: string;
1071
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1072
+ resolution?: "480p" | "720p";
1073
+ duration?: 4 | 5 | 8 | 10 | 12;
1074
+ generateAudio?: boolean;
1075
+ startFrame?: string;
1076
+ endFrame?: string;
1077
+ };
1078
+ "seedance-2.0": {
1079
+ prompt: string;
1080
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1081
+ resolution?: "480p" | "720p" | "1080p" | "4k";
1082
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1083
+ generateAudio?: boolean;
1084
+ returnLastFrame?: boolean;
1085
+ imageUrls?: string[];
1086
+ videoUrls?: string[];
1087
+ audioUrls?: string[];
1088
+ startFrame?: string;
1089
+ endFrame?: string;
1090
+ };
1091
+ "seedance-2.0-fast": {
1092
+ prompt: string;
1093
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1094
+ resolution?: "480p" | "720p";
1095
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1096
+ generateAudio?: boolean;
1097
+ returnLastFrame?: boolean;
1098
+ imageUrls?: string[];
1099
+ videoUrls?: string[];
1100
+ audioUrls?: string[];
1101
+ startFrame?: string;
1102
+ endFrame?: string;
1103
+ };
1104
+ "seedance-2.0-fast-video-edit": {
1105
+ prompt: string;
1106
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1107
+ resolution?: "480p" | "720p";
1108
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1109
+ generateAudio?: boolean;
1110
+ returnLastFrame?: boolean;
1111
+ videoUrl: string;
1112
+ imageUrls?: string[];
1113
+ };
1114
+ "seedance-2.0-fast-video-extend": {
1115
+ prompt: string;
1116
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1117
+ resolution?: "480p" | "720p";
1118
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1119
+ generateAudio?: boolean;
1120
+ videoUrls: [string, ...string[]];
1121
+ };
1122
+ "seedance-2.0-mini": {
1123
+ prompt: string;
1124
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1125
+ resolution?: "480p" | "720p";
1126
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1127
+ generateAudio?: boolean;
1128
+ returnLastFrame?: boolean;
1129
+ imageUrls?: string[];
1130
+ videoUrls?: string[];
1131
+ audioUrls?: string[];
1132
+ startFrame?: string;
1133
+ endFrame?: string;
1134
+ };
1135
+ "seedance-2.0-mini-video-edit": {
1136
+ prompt: string;
1137
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1138
+ resolution?: "480p" | "720p";
1139
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1140
+ generateAudio?: boolean;
1141
+ returnLastFrame?: boolean;
1142
+ videoUrl: string;
1143
+ imageUrls?: string[];
1144
+ };
1145
+ "seedance-2.0-mini-video-extend": {
1146
+ prompt: string;
1147
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1148
+ resolution?: "480p" | "720p";
1149
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1150
+ generateAudio?: boolean;
1151
+ videoUrls: [string, ...string[]];
1152
+ };
1153
+ "seedance-2.0-video-edit": {
1154
+ prompt: string;
1155
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1156
+ resolution?: "480p" | "720p" | "1080p" | "4k";
1157
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1158
+ generateAudio?: boolean;
1159
+ returnLastFrame?: boolean;
1160
+ videoUrl: string;
1161
+ imageUrls?: string[];
1162
+ };
1163
+ "seedance-2.0-video-extend": {
677
1164
  prompt: string;
678
1165
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
679
- resolution?: "480p" | "720p";
680
- duration?: 4 | 5 | 8 | 10 | 12;
1166
+ resolution?: "480p" | "720p" | "1080p" | "4k";
1167
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
681
1168
  generateAudio?: boolean;
1169
+ videoUrls: [string, ...string[]];
682
1170
  };
683
1171
  "seedance-i2v": {
684
1172
  prompt: string;
685
1173
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
686
1174
  resolution?: "480p" | "720p" | "1080p";
687
1175
  duration?: 5 | 10;
688
- imageUrls: [string, ...string[]];
1176
+ startFrame: string;
689
1177
  };
690
1178
  "seedream-4.0": {
691
1179
  resolution?: "1K" | "2K" | "4K";
@@ -711,6 +1199,13 @@ type ModelInputById = {
711
1199
  imageUrls?: string[];
712
1200
  negativePrompt?: string;
713
1201
  };
1202
+ "seedream-5.0-pro": {
1203
+ resolution?: "1K" | "2K";
1204
+ prompt: string;
1205
+ aspectRatio?: "1:1" | "4:3" | "3:4" | "16:9" | "9:16" | "3:2" | "2:3" | "21:9";
1206
+ imageUrls?: string[];
1207
+ negativePrompt?: string;
1208
+ };
714
1209
  "sora-2": {
715
1210
  prompt: string;
716
1211
  imageUrls?: string[];
@@ -719,15 +1214,13 @@ type ModelInputById = {
719
1214
  };
720
1215
  "sora-2-extend": {
721
1216
  prompt: string;
722
- videoUrl: string;
723
- aspectRatio?: "16:9" | "9:16";
724
1217
  duration?: 4 | 8 | 12 | 16 | 20;
725
1218
  };
726
1219
  "sora-2-pro": {
727
1220
  prompt: string;
728
1221
  imageUrls?: string[];
729
1222
  aspectRatio?: "16:9" | "9:16";
730
- resolution?: "720p" | "1080p";
1223
+ resolution?: "720p" | "1024p" | "1080p";
731
1224
  duration?: 4 | 8 | 12 | 16 | 20;
732
1225
  };
733
1226
  "topaz-enhance-cgi": {
@@ -757,13 +1250,13 @@ type ModelInputById = {
757
1250
  "topaz-upscale-image": {
758
1251
  imageUrls: [string, ...string[]];
759
1252
  };
760
- "veed-fabric": {
1253
+ "veed-fabric-v1": {
761
1254
  prompt?: string;
762
1255
  resolution?: "480p" | "720p";
763
1256
  imageUrls: [string, ...string[]];
764
1257
  audioUrl: string;
765
1258
  };
766
- "veed-fabric-fast": {
1259
+ "veed-fabric-v1-fast": {
767
1260
  prompt?: string;
768
1261
  resolution?: "480p" | "720p";
769
1262
  imageUrls: [string, ...string[]];
@@ -774,19 +1267,29 @@ type ModelInputById = {
774
1267
  aspectRatio?: "16:9" | "9:16";
775
1268
  duration?: 4 | 6 | 8;
776
1269
  resolution?: "720p" | "1080p" | "4k";
1270
+ imageUrls?: string[];
777
1271
  generateAudio?: boolean;
778
1272
  negativePrompt?: string;
1273
+ startFrame?: string;
1274
+ endFrame?: string;
779
1275
  };
780
1276
  "veo-3.1-fast": {
781
1277
  prompt: string;
782
1278
  aspectRatio?: "16:9" | "9:16";
783
1279
  duration?: 4 | 6 | 8;
784
1280
  resolution?: "720p" | "1080p" | "4k";
1281
+ imageUrls?: string[];
785
1282
  generateAudio?: boolean;
786
1283
  negativePrompt?: string;
1284
+ startFrame?: string;
1285
+ endFrame?: string;
787
1286
  };
788
- "videography": {
789
- imageUrls: [string, ...string[]];
1287
+ "veo-3.1-lite": {
1288
+ prompt: string;
1289
+ aspectRatio?: "16:9" | "9:16";
1290
+ duration?: 4 | 6 | 8;
1291
+ resolution?: "720p" | "1080p";
1292
+ startFrame?: string;
790
1293
  };
791
1294
  "wan-2.6-image": {
792
1295
  prompt: string;
@@ -806,7 +1309,7 @@ type ModelInputById = {
806
1309
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
807
1310
  negativePrompt?: string;
808
1311
  cfgScale?: number;
809
- imageUrls?: string[];
1312
+ startFrame?: string;
810
1313
  };
811
1314
  "wan-2.7-i2v": {
812
1315
  prompt?: string;
@@ -814,7 +1317,8 @@ type ModelInputById = {
814
1317
  resolution?: "720P" | "1080P";
815
1318
  negativePrompt?: string;
816
1319
  enhancePrompt?: boolean;
817
- imageUrls: [string, ...string[]];
1320
+ startFrame: string;
1321
+ endFrame?: string;
818
1322
  audioUrl?: string;
819
1323
  };
820
1324
  "wan-2.7-r2v": {
@@ -834,7 +1338,7 @@ type ModelInputById = {
834
1338
  negativePrompt?: string;
835
1339
  enhancePrompt?: boolean;
836
1340
  audioUrl?: string;
837
- imageUrls?: string[];
1341
+ startFrame?: string;
838
1342
  };
839
1343
  "wan-2.7-video-edit": {
840
1344
  prompt?: string;
@@ -847,6 +1351,174 @@ type ModelInputById = {
847
1351
  };
848
1352
  type TypedModelId = keyof ModelInputById;
849
1353
  type ModelInput<M extends TypedModelId> = ModelInputById[M];
1354
+ /** IDs of text-generation (LLM) models — narrows generateText(). */
1355
+ type TextModelId = "claude-haiku-4-5" | "claude-opus-4-8" | "claude-sonnet-4-6" | "gemini-3-pro" | "gpt-5.5";
1356
+ type TextModelInputById = Pick<ModelInputById, TextModelId>;
1357
+
1358
+ /**
1359
+ * Drive client — manages folders and file saving in Picsart Drive.
1360
+ *
1361
+ * Uses the same authenticated fetch as the generation client.
1362
+ * Root folder is auto-created on first use and cached.
1363
+ */
1364
+
1365
+ type MediaTypeFilter = 'image' | 'video' | 'audio';
1366
+ type UserReaction = 'like' | 'dislike';
1367
+ /** A folder reference in Picsart Drive. */
1368
+ interface DriveFolder {
1369
+ name: string;
1370
+ uid: string;
1371
+ }
1372
+ /** Drive save result, attached to GenerateResult when drive is enabled. */
1373
+ interface DriveSaveResult {
1374
+ uid: string;
1375
+ folder: DriveFolder;
1376
+ }
1377
+ /**
1378
+ * The generation input parameters, serialized into the `aiSDKPayload` attribute.
1379
+ * Captures every value from the generation context — the named fields below are
1380
+ * common ones for convenience; the index signature carries any other input param.
1381
+ */
1382
+ interface SdkPayload {
1383
+ prompt: string;
1384
+ aspectRatio?: string;
1385
+ duration?: number;
1386
+ resolution?: string;
1387
+ generateAudio?: boolean;
1388
+ imageUrls?: string[];
1389
+ videoUrls?: string[];
1390
+ audioUrls?: string[];
1391
+ startFrame?: string;
1392
+ endFrame?: string;
1393
+ videoUrl?: string;
1394
+ audioUrl?: string;
1395
+ [key: string]: unknown;
1396
+ }
1397
+ type DriveFile = {
1398
+ uid: string;
1399
+ } & Record<string, unknown>;
1400
+ interface DriveAttributes {
1401
+ model: string;
1402
+ /** JSON-encoded SdkPayload (all generation input params). */
1403
+ aiSDKPayload: string;
1404
+ appId?: string;
1405
+ appType?: AppType;
1406
+ }
1407
+ interface GenerationFile {
1408
+ appId?: string;
1409
+ appType?: AppType;
1410
+ model?: string;
1411
+ aiSDKPayload?: SdkPayload;
1412
+ userReaction?: UserReaction;
1413
+ }
1414
+ interface DriveMediaItem {
1415
+ uid: string;
1416
+ url: string;
1417
+ name: string;
1418
+ type: MediaTypeFilter;
1419
+ previewUrl?: string;
1420
+ timestamp: number;
1421
+ }
1422
+ interface DriveFileDetails extends DriveMediaItem {
1423
+ createdAt?: string;
1424
+ model?: string;
1425
+ prompt?: string;
1426
+ service?: string;
1427
+ subType?: string;
1428
+ duration?: string;
1429
+ aspectRatio?: string;
1430
+ resolution?: string;
1431
+ quality?: string;
1432
+ userReaction?: UserReaction;
1433
+ referenceImageUrls?: string[];
1434
+ referenceVideoUrl?: string;
1435
+ referenceAudioUrl?: string;
1436
+ }
1437
+ interface ListOptions {
1438
+ folder?: DriveFolder;
1439
+ type?: MediaTypeFilter;
1440
+ }
1441
+ interface SaveParams {
1442
+ url: string;
1443
+ name: string;
1444
+ resourceType: 'PHOTO' | 'VIDEO' | 'AUDIO';
1445
+ attributes?: Record<string, string>;
1446
+ previewUrl?: string;
1447
+ }
1448
+ /** Target folder for backend Drive save. */
1449
+ interface PayloadDriveFolderOptions {
1450
+ /** Folder path — backend resolves it (e.g. 'AI Playground' or 'AI Playground/My Board'). */
1451
+ path?: string;
1452
+ /** Folder UID — overrides path when provided. */
1453
+ id?: string;
1454
+ }
1455
+ /** Drive save options injected into the workflow payload as `options.drive`. */
1456
+ interface PayloadDriveOptions {
1457
+ /** Filename for the saved asset. */
1458
+ name: string;
1459
+ /** Generation attributes attached to the file (SDK-assembled, fixed shape). */
1460
+ attributes?: DriveAttributes;
1461
+ /** Target folder in Picsart Drive. */
1462
+ folder?: PayloadDriveFolderOptions;
1463
+ }
1464
+ /**
1465
+ * Drive operations surface — returned by {@link createDriveClient} and exposed
1466
+ * as `ai.drive` when Drive is configured. Manages folders, listing, saving, and
1467
+ * reactions in Picsart Drive.
1468
+ */
1469
+ interface DriveClient {
1470
+ /** Ensure a folder exists (creating it if needed) and return it. */
1471
+ ensureFolder(subfolder?: string): Promise<DriveFolder | null>;
1472
+ /** List the immediate subfolders of the root folder. */
1473
+ folders(): Promise<DriveFolder[]>;
1474
+ /** List all folders recursively. */
1475
+ allFolders(): Promise<DriveFolder[]>;
1476
+ /** Find a folder by name. */
1477
+ findFolder(name: string): Promise<DriveFolder | null>;
1478
+ /** List media items in a folder. */
1479
+ list(options?: ListOptions): Promise<DriveMediaItem[]>;
1480
+ /** List media items in a folder with full generation metadata. */
1481
+ listDetailed(options?: ListOptions): Promise<DriveFileDetails[]>;
1482
+ /** Read a single generation's stored attributes. */
1483
+ getGeneration(fileUid: string): Promise<GenerationFile | null>;
1484
+ /** Save an asset to Drive. */
1485
+ save(params: SaveParams, folder?: DriveFolder): Promise<DriveSaveResult | null>;
1486
+ /** Build the save params for a generation result. */
1487
+ buildSaveParams(url: string, modelId: string, modelName: string, mode: string, prompt?: string): SaveParams;
1488
+ /** Set a like/dislike reaction on a file. */
1489
+ addReaction(fileUid: string, reaction: UserReaction): Promise<boolean>;
1490
+ /** Clear the reaction on a file. */
1491
+ removeReaction(fileUid: string): Promise<boolean>;
1492
+ }
1493
+ declare function inferResourceType(mode: string): 'PHOTO' | 'VIDEO' | 'AUDIO';
1494
+ declare function buildFilename(prompt: string | undefined, mode: string): string;
1495
+ declare function buildGenerationAttributes(input: {
1496
+ modelId: string;
1497
+ params: Record<string, unknown>;
1498
+ /** TODO(backend-autosave): temporary — remove once the backend stamps appId/appType. */
1499
+ app?: AppIdentity;
1500
+ }): DriveAttributes;
1501
+ declare function parseGeneration(file: DriveFile | Record<string, unknown>): GenerationFile;
1502
+
1503
+ /** Result of `ai.apis.run()` — the API result plus optional credit usage. */
1504
+ type ApiResponse<R = unknown> = WorkflowResponse<R>;
1505
+ /**
1506
+ * Options for `ai.apis.run()` — execution mode, polling, abort signal, progress callbacks.
1507
+ * Intentionally omits the lib's `remoteSettingName` (a no-op without remote settings),
1508
+ * `onPartialResult`, and `notificationConfig` — these aren't part of the SDK surface.
1509
+ */
1510
+ type ApiRunOptions = Omit<ExecutionOptions, 'remoteSettingName' | 'onPartialResult' | 'notificationConfig'>;
1511
+ /** Registry of known API names → their params/result types (from @picsart/workflows-types). */
1512
+ type ApiSchemas = WorkflowTypes;
1513
+ /**
1514
+ * The `ai.apis` surface — direct, low-level access to the Picsart model APIs.
1515
+ * Known API names (keys of {@link ApiSchemas}) get typed params + result;
1516
+ * unknown names take an open payload and return an unknown result.
1517
+ */
1518
+ interface ApisClient {
1519
+ /** Run an API by name (mirrors WorkflowsClient.run()). */
1520
+ run<W extends string = string>(api: W, payload: W extends keyof ApiSchemas ? ApiSchemas[W]['params'] : Record<string, unknown>, options?: ApiRunOptions): Promise<ApiResponse<W extends keyof ApiSchemas ? ApiSchemas[W]['result'] : unknown>>;
1521
+ }
850
1522
 
851
1523
  /** A fetch-like function that handles authentication (headers, cookies, etc.). */
852
1524
  type AuthenticatedFetch = (url: string, init?: RequestInit) => Promise<Response>;
@@ -856,44 +1528,45 @@ interface DriveConfig {
856
1528
  folder: string;
857
1529
  }
858
1530
  /**
859
- * Simple client config pass an authenticated fetch and the SDK handles the rest.
860
- * The SDK knows the Picsart API endpoints and response shapes internally.
1531
+ * Whether the embedding app is a native client or a miniapp. Set backend-side
1532
+ * during save; surfaced read-only via `getGeneration`.
1533
+ */
1534
+ type AppType = 'native' | 'miniapp';
1535
+ /**
1536
+ * App identity (appId + appType).
1537
+ * TODO(backend-autosave): temporary — the backend will stamp appId/appType on
1538
+ * save. Until then apps may pass this so it's persisted client-side.
1539
+ */
1540
+ interface AppIdentity {
1541
+ id: string;
1542
+ type: AppType;
1543
+ }
1544
+ /**
1545
+ * Simple client config — pass the API base URL plus one auth source, and the
1546
+ * SDK handles the rest. The SDK knows the Picsart API endpoints and response
1547
+ * shapes internally.
1548
+ *
1549
+ * Provide exactly one of:
1550
+ * - `fetch` — your own authenticated fetch (you add headers/cookies), or
1551
+ * - `apiKey` — the SDK builds a fetch that sends `Authorization: Bearer <apiKey>`.
861
1552
  */
862
1553
  interface ClientConfig {
863
- /** Authenticated fetch function. The SDK calls this for all HTTP requests. */
864
- fetch: AuthenticatedFetch;
1554
+ /**
1555
+ * Authenticated fetch function. The SDK calls this for all HTTP requests.
1556
+ * Provide this or `apiKey`. Takes precedence over `apiKey` when both are set.
1557
+ */
1558
+ fetch?: AuthenticatedFetch;
1559
+ /**
1560
+ * Picsart API key. When `fetch` is not provided, the SDK builds an
1561
+ * authenticated fetch that sends `Authorization: Bearer <apiKey>` on every
1562
+ * request (a leading `Bearer ` is stripped if present).
1563
+ */
1564
+ apiKey?: string;
865
1565
  /** API base URL (e.g. 'https://api.picsart.com'). */
866
1566
  apiUrl: string;
867
1567
  /** Enable Drive integration — auto-save generations to a Drive folder. */
868
1568
  drive?: DriveConfig;
869
1569
  }
870
- /**
871
- * Advanced transport — full control over each operation.
872
- * Use this when you need custom request/response handling beyond what fetch provides.
873
- */
874
- interface SdkTransport extends WorkflowTransport {
875
- execute?(request: {
876
- workflow: string;
877
- payload: unknown;
878
- signal?: AbortSignal;
879
- }): Promise<unknown>;
880
- cancel?(handle: {
881
- workflow: string;
882
- id: string;
883
- }, signal?: AbortSignal): Promise<void>;
884
- options?(workflow: string, payload: Record<string, unknown>): Promise<number | null>;
885
- creditBalance?(): Promise<number | null>;
886
- }
887
- /** A folder reference in Picsart Drive. */
888
- interface DriveFolder {
889
- name: string;
890
- uid: string;
891
- }
892
- /** Drive save result, attached to GenerateResult when drive is enabled. */
893
- interface DriveSaveResult {
894
- uid: string;
895
- folder: DriveFolder;
896
- }
897
1570
  interface GenerateResultItem {
898
1571
  url: string;
899
1572
  metadata?: Record<string, unknown>;
@@ -912,21 +1585,16 @@ interface GenerateResult {
912
1585
  /** Present when Drive is enabled and the file was saved. */
913
1586
  drive?: DriveSaveResult;
914
1587
  }
915
- /** Target folder for backend Drive save. */
916
- interface PayloadDriveFolderOptions {
917
- /** Folder path — backend resolves it (e.g. 'AI Playground' or 'AI Playground/My Board'). */
918
- path?: string;
919
- /** Folder UID overrides path when provided. */
920
- id?: string;
921
- }
922
- /** Drive save options injected into the workflow payload as `options.drive`. */
923
- interface PayloadDriveOptions {
924
- /** Filename for the saved asset. */
925
- name: string;
926
- /** Custom attributes to attach to the file (tool, model, prompt, etc.). */
927
- attributes?: Record<string, unknown>;
928
- /** Target folder in Picsart Drive. */
929
- folder?: PayloadDriveFolderOptions;
1588
+ /** Result of a text-generation (LLM) model. */
1589
+ interface GenerateTextResult {
1590
+ /** Generated text. */
1591
+ text: string;
1592
+ /** Model ID that produced this result. */
1593
+ model: string;
1594
+ /** Job handle for status tracking. */
1595
+ handle: WorkflowJobHandle;
1596
+ /** Raw parsed output — carries usage, finish reason, thinking trace, etc. */
1597
+ raw: unknown;
930
1598
  }
931
1599
  /** Options for individual generate() / submit() calls. */
932
1600
  interface GenerateOptions {
@@ -935,129 +1603,42 @@ interface GenerateOptions {
935
1603
  folder?: DriveFolder;
936
1604
  /** Save result to Picsart Drive via backend. Injected into the workflow payload. */
937
1605
  drive?: PayloadDriveOptions;
1606
+ /**
1607
+ * App identity stamped onto the saved generation (appId/appType).
1608
+ * TODO(backend-autosave): temporary — remove once the backend stamps these.
1609
+ */
1610
+ app?: AppIdentity;
938
1611
  }
1612
+ /** Non-text (image/video/audio) model IDs — the media generation surface. */
1613
+ type MediaModelId = Exclude<TypedModelId, TextModelId>;
939
1614
  /** AI SDK client with type-safe, model-aware method signatures. */
940
1615
  interface AiClient {
941
- /** Generate content using a model. Params are type-checked against the model's schema. */
942
- generate<M extends TypedModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<GenerateResult>;
943
- /** @deprecated Use `getCredits()` instead. */
944
- estimate<M extends TypedModelId>(model: M, params: ModelInputById[M]): Promise<number | null>;
1616
+ /** Generate content using a media model. Text/LLM models use generateText(). */
1617
+ generate<M extends MediaModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<GenerateResult>;
1618
+ /** Generate text using an LLM model. Returns the generated text plus the raw response. */
1619
+ generateText<M extends TextModelId>(model: M, params: TextModelInputById[M], options?: GenerateOptions): Promise<GenerateTextResult>;
945
1620
  /** Get exact credit cost for a model with specific parameters. */
946
1621
  getCredits<M extends TypedModelId>(model: M, params: ModelInputById[M]): Promise<number | null>;
947
- /** Submit a generation job and get a handle back. */
948
- submit<M extends TypedModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<WorkflowJobHandle>;
1622
+ /** Submit a generation job and get a handle back. Media models only. */
1623
+ submit<M extends MediaModelId>(model: M, params: ModelInputById[M], options?: GenerateOptions): Promise<WorkflowJobHandle>;
949
1624
  /** Check the current status of a submitted job. */
950
1625
  status(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<WorkflowStatusResult<unknown>>;
951
- /** Poll a submitted job until it completes and return the parsed result. */
952
- result(handle: WorkflowJobHandle, model: TypedModelId, options?: WorkflowPollOptions): Promise<GenerateResult>;
1626
+ /** Poll a submitted job until it completes and return the parsed result. Media models only. */
1627
+ result(handle: WorkflowJobHandle, model: MediaModelId, options?: WorkflowPollOptions): Promise<GenerateResult>;
953
1628
  /** Subscribe to live status updates for a submitted job. */
954
1629
  subscribe(handle: WorkflowJobHandle, options?: WorkflowSubscribeOptions): AsyncGenerator<WorkflowStatusResult<unknown>, WorkflowStatusResult<unknown>, void>;
955
1630
  /** Build the vendor-specific payload for a model without submitting. */
956
1631
  buildPayload<M extends TypedModelId>(model: M, params: ModelInputById[M]): Record<string, unknown>;
957
- /** Cancel a running job. */
958
- cancel(handle: WorkflowJobHandle, signal?: AbortSignal): Promise<void>;
959
- /** Run a raw workflow (not tied to a model). */
1632
+ /** @deprecated Use `apis.run()` instead. Run a raw workflow (not tied to a model). */
960
1633
  runWorkflow<TResult = unknown>(workflow: string, payload: Record<string, unknown>, options?: WorkflowRunOptions): Promise<TResult>;
1634
+ /**
1635
+ * Direct, low-level access to the Picsart model APIs — run any API by name.
1636
+ * See {@link ApisClient}.
1637
+ */
1638
+ apis: ApisClient;
961
1639
  /** Drive operations. Only available when drive config is provided. */
962
- drive: {
963
- ensureFolder(subfolder?: string): Promise<DriveFolder | null>;
964
- folders(): Promise<DriveFolder[]>;
965
- allFolders(): Promise<DriveFolder[]>;
966
- findFolder(name: string): Promise<DriveFolder | null>;
967
- list(options?: {
968
- folder?: DriveFolder;
969
- type?: string;
970
- }): Promise<{
971
- uid: string;
972
- url: string;
973
- name: string;
974
- type: 'image' | 'video' | 'audio';
975
- previewUrl?: string;
976
- timestamp: number;
977
- }[]>;
978
- listDetailed(options?: {
979
- folder?: DriveFolder;
980
- type?: string;
981
- }): Promise<{
982
- uid: string;
983
- url: string;
984
- name: string;
985
- type: 'image' | 'video' | 'audio';
986
- previewUrl?: string;
987
- timestamp: number;
988
- createdAt?: string;
989
- model?: string;
990
- prompt?: string;
991
- service?: string;
992
- subType?: string;
993
- duration?: string;
994
- aspectRatio?: string;
995
- resolution?: string;
996
- quality?: string;
997
- referenceImageUrls?: string[];
998
- referenceVideoUrl?: string;
999
- referenceAudioUrl?: string;
1000
- }[]>;
1001
- save(params: {
1002
- url: string;
1003
- name: string;
1004
- resourceType: string;
1005
- attributes?: Record<string, string>;
1006
- previewUrl?: string;
1007
- }, folder?: DriveFolder): Promise<DriveSaveResult | null>;
1008
- buildSaveParams(url: string, modelId: string, modelName: string, mode: string, prompt?: string): {
1009
- url: string;
1010
- name: string;
1011
- resourceType: string;
1012
- attributes?: Record<string, string>;
1013
- previewUrl?: string;
1014
- };
1015
- } | undefined;
1016
- }
1017
-
1018
- /**
1019
- * Drive client — manages folders and file saving in Picsart Drive.
1020
- *
1021
- * Uses the same authenticated fetch as the generation client.
1022
- * Root folder is auto-created on first use and cached.
1023
- */
1024
-
1025
- type MediaTypeFilter = 'image' | 'video' | 'audio';
1026
- interface DriveMediaItem {
1027
- uid: string;
1028
- url: string;
1029
- name: string;
1030
- type: MediaTypeFilter;
1031
- previewUrl?: string;
1032
- timestamp: number;
1033
- }
1034
- interface DriveFileDetails extends DriveMediaItem {
1035
- createdAt?: string;
1036
- model?: string;
1037
- prompt?: string;
1038
- service?: string;
1039
- subType?: string;
1040
- duration?: string;
1041
- aspectRatio?: string;
1042
- resolution?: string;
1043
- quality?: string;
1044
- referenceImageUrls?: string[];
1045
- referenceVideoUrl?: string;
1046
- referenceAudioUrl?: string;
1640
+ drive: DriveClient | undefined;
1047
1641
  }
1048
- interface ListOptions {
1049
- folder?: DriveFolder;
1050
- type?: MediaTypeFilter;
1051
- }
1052
- interface SaveParams {
1053
- url: string;
1054
- name: string;
1055
- resourceType: 'PHOTO' | 'VIDEO' | 'AUDIO';
1056
- attributes?: Record<string, string>;
1057
- previewUrl?: string;
1058
- }
1059
- declare function inferResourceType(mode: string): 'PHOTO' | 'VIDEO' | 'AUDIO';
1060
- declare function buildFilename(prompt: string | undefined, mode: string): string;
1061
1642
 
1062
1643
  /**
1063
1644
  * Create an AI SDK client.
@@ -1096,13 +1677,16 @@ type ModelParamSchema = Record<string, ParamSchema>;
1096
1677
  * Each model defines `params: ModelParams` (a Record of ParamEntry).
1097
1678
  * Consumers iterate descriptors generically instead of switching on named ParamConfig fields.
1098
1679
  */
1680
+ interface EnumOption<T extends string | number = string> {
1681
+ id: T;
1682
+ label?: string;
1683
+ disabled?: boolean;
1684
+ disabledReason?: string;
1685
+ }
1099
1686
  interface EnumDescriptor<T extends string | number = string> {
1100
1687
  kind: 'enum';
1101
1688
  valueType: 'string' | 'number';
1102
- options: Array<{
1103
- id: T;
1104
- label?: string;
1105
- }>;
1689
+ options: Array<EnumOption<T>>;
1106
1690
  default: T;
1107
1691
  }
1108
1692
  interface RangeDescriptor {
@@ -1118,6 +1702,7 @@ interface BooleanDescriptor {
1118
1702
  }
1119
1703
  interface TextDescriptor {
1120
1704
  kind: 'text';
1705
+ minLength?: number;
1121
1706
  maxLength?: number;
1122
1707
  placeholder?: string;
1123
1708
  }
@@ -1129,10 +1714,33 @@ interface FileDescriptor {
1129
1714
  min?: number;
1130
1715
  max?: number;
1131
1716
  };
1717
+ /**
1718
+ * Max intrinsic duration (seconds) accepted for a video/audio file. Enforced
1719
+ * client-side at upload by measuring the media before it is sent; the backend
1720
+ * worker stays the authoritative gate. Omit for no client-side cap.
1721
+ */
1722
+ maxDurationSec?: number;
1723
+ /**
1724
+ * Min intrinsic pixel count (width × height) accepted for an image/video file.
1725
+ * Enforced client-side at upload by measuring the media before it is sent; the
1726
+ * backend worker stays the authoritative gate. Omit for no client-side floor.
1727
+ */
1728
+ minPixels?: number;
1729
+ /**
1730
+ * Max intrinsic short-side length (pixels) accepted for an image/video file —
1731
+ * `min(width, height)` must not exceed this. Used by upscalers whose source
1732
+ * must stay below the target resolution. Enforced client-side at upload by
1733
+ * measuring the media before it is sent; the backend worker stays the
1734
+ * authoritative gate. Omit for no client-side ceiling.
1735
+ */
1736
+ maxShortSidePixels?: number;
1132
1737
  }
1133
1738
  interface ObjectDescriptor {
1134
1739
  kind: 'object';
1135
- fields: Record<string, ParamDescriptor>;
1740
+ /** Nested fields use the flat EntryMeta + Descriptor merge — same shape as
1741
+ * EnumEntry / RangeEntry / etc. Authors can mark a nested field optional
1742
+ * by setting `required: false`. Default is required. */
1743
+ fields: Record<string, EntryMeta & ParamDescriptor>;
1136
1744
  array?: {
1137
1745
  min?: number;
1138
1746
  max?: number;
@@ -1142,6 +1750,15 @@ type ParamDescriptor = EnumDescriptor<string> | EnumDescriptor<number> | RangeDe
1142
1750
  interface ParamEntry {
1143
1751
  label?: string;
1144
1752
  required?: boolean;
1753
+ /**
1754
+ * Role of a file input relative to the output. Drives prompt-area filmstrip
1755
+ * grouping: assets first, divider only when both groups are present, then
1756
+ * references. Only meaningful for `kind: 'file'` descriptors.
1757
+ *
1758
+ * - `asset`: direct input that becomes part of the output (start/end frame, sync audio)
1759
+ * - `reference`: guidance signal that influences the result (style/character/motion ref)
1760
+ */
1761
+ category?: 'asset' | 'reference';
1145
1762
  descriptor: ParamDescriptor;
1146
1763
  /** Original rich option objects (e.g. VoiceOption[], AvatarOption[]) preserved for UI catalogs. */
1147
1764
  catalogOptions?: readonly unknown[];
@@ -1150,7 +1767,10 @@ type ModelParams = Record<string, ParamEntry>;
1150
1767
  interface EntryMeta {
1151
1768
  label?: string;
1152
1769
  required?: boolean;
1770
+ category?: 'asset' | 'reference';
1153
1771
  catalogOptions?: readonly unknown[];
1772
+ disabled?: boolean;
1773
+ disabledReason?: string;
1154
1774
  }
1155
1775
  type EnumEntry = EntryMeta & EnumDescriptor<string | number>;
1156
1776
  type RangeEntry = EntryMeta & RangeDescriptor;
@@ -1205,12 +1825,39 @@ interface ModelParamsAccessor {
1205
1825
  transferValues(prev: Record<string, unknown>): Record<string, unknown>;
1206
1826
  }
1207
1827
 
1828
+ /** Credit range for a model — min/max credits across all pricing variants. */
1829
+ interface CreditRange {
1830
+ min: number;
1831
+ max: number;
1832
+ /** Pricing unit (e.g. 'generation', 'second', 'megapixel'). Set when all matched entries share a unit. */
1833
+ unit?: string;
1834
+ }
1835
+ /** Optional context to narrow the credit range by resolution / audio. */
1836
+ interface CreditRangeContext {
1837
+ resolution?: string;
1838
+ generateAudio?: boolean;
1839
+ }
1208
1840
  /** Top-level model accessor with grouped sub-accessors. */
1841
+ /** Result of validating generation input against a model's params. */
1842
+ interface ValidationResult$1 {
1843
+ valid: boolean;
1844
+ errors?: string[];
1845
+ }
1209
1846
  interface ModelDescriptor {
1210
1847
  readonly id: TypedModelId;
1211
1848
  readonly name: string;
1212
1849
  params(): ModelParamsAccessor;
1850
+ /** Params with constraint effects pre-applied (disabled options, hidden params). */
1851
+ paramsFor(values: Partial<GenerationContext>): ModelParamsAccessor;
1213
1852
  meta(): ModelMeta;
1853
+ /** Validate generation input against this model's params. Returns
1854
+ * `{ valid: true }` or `{ valid: false, errors }` — never throws. */
1855
+ validate(input: unknown): ValidationResult$1;
1856
+ /** Get the credit range for this model. Pass context to narrow by
1857
+ * resolution/audio. Returns the per-unit range — callers with time-based
1858
+ * parameters should scale by the value themselves (e.g. multiply by
1859
+ * duration when range.unit === 'second'). Returns null if pricing is not loaded. */
1860
+ getCreditsInfo(ctx?: CreditRangeContext): CreditRange | null;
1214
1861
  /** Workflow identifiers for this model. */
1215
1862
  readonly api: {
1216
1863
  /** Primary workflow name for generation. */
@@ -1219,19 +1866,19 @@ interface ModelDescriptor {
1219
1866
  readonly editWorkflow: string | undefined;
1220
1867
  };
1221
1868
  }
1222
- /** Filter criteria for `Model.find()`. */
1869
+ /** Filter criteria for `catalog.find()`. */
1223
1870
  interface ModelFilter$1 {
1224
1871
  output?: GenerationMode;
1225
1872
  provider?: string;
1226
1873
  }
1227
1874
 
1228
- type AppProvider = 'picsart' | 'google' | 'kling' | 'grok' | 'openai' | 'flux' | 'ideogram' | 'elevenlabs' | 'minimax' | 'wan' | 'seedance' | 'ltx' | 'seedream' | 'hunyuan' | 'pika' | 'runway' | 'luma' | 'ovi' | 'creatify' | 'veed' | 'bytedance' | 'qwen' | 'reve' | 'recraft' | 'videography' | 'topaz' | 'heygen';
1875
+ type AppProvider = 'picsart' | 'google' | 'kling' | 'grok' | 'openai' | 'flux' | 'ideogram' | 'elevenlabs' | 'minimax' | 'wan' | 'seedance' | 'ltx' | 'seedream' | 'hunyuan' | 'pika' | 'runway' | 'luma' | 'ovi' | 'creatify' | 'veed' | 'bytedance' | 'qwen' | 'reve' | 'recraft' | 'videography' | 'topaz' | 'heygen' | 'happyhorse' | 'pixverse' | 'anthropic' | 'async';
1229
1876
  /** Provider used by model definitions. */
1230
1877
  type Provider = AppProvider;
1231
1878
  /** App generation modes. */
1232
- type GenerationMode = 'video' | 'image' | 'audio';
1879
+ type GenerationMode = 'video' | 'image' | 'audio' | 'text';
1233
1880
  /** App input types. */
1234
- type InputType = 't2v' | 'i2v' | 'v2v' | 'a2v' | 't2i' | 'i2i' | 't2a' | 'v2a' | 'tts' | 'sts' | 'sfx' | 'music';
1881
+ type InputType = 't2v' | 'i2v' | 'v2v' | 'a2v' | 't2i' | 'i2i' | 't2a' | 'v2a' | 'tts' | 'sts' | 'sfx' | 'music' | 't2t' | 'i2t' | 'v2t';
1235
1882
  interface ModelFeature {
1236
1883
  label: string;
1237
1884
  variant: 'frame' | 'resolution' | 'audio' | 'duration' | 'input' | 'quality' | 'style' | 'characteristic';
@@ -1268,71 +1915,57 @@ interface GenerationContext {
1268
1915
  generateAudio?: boolean;
1269
1916
  enhancePrompt?: boolean;
1270
1917
  imageUrls?: string[];
1918
+ videoUrls?: string[];
1919
+ /** Audio URL array — reference audios (max N per model, backend enforces
1920
+ * total-duration caps). Distinct from `audioUrl` (single driving-audio). */
1921
+ audioUrls?: string[];
1271
1922
  startFrame?: string;
1272
1923
  endFrame?: string;
1273
1924
  videoUrl?: string;
1274
1925
  audioUrl?: string;
1275
- /** Audio file for voice/audio models. Accepts File (browser) or Blob (Node 18+). */
1276
- audioFile?: Blob;
1926
+ /** TTS-generated audio id (e.g. Kling Avatar audio_id, alternative to sound_file). */
1927
+ audioId?: string;
1277
1928
  voiceId?: string;
1278
1929
  videoId?: string;
1279
1930
  modelId?: string;
1280
1931
  removeBackgroundNoise?: boolean;
1932
+ /** MiniMax Music v2 worker field, sent as `lyrics_prompt` (min 10 chars). */
1933
+ lyricsPrompt?: string;
1934
+ lyricsOptimizer?: boolean;
1935
+ isInstrumental?: boolean;
1281
1936
  language?: string;
1282
1937
  accent?: string;
1283
1938
  style?: string;
1284
- substyle?: string;
1285
1939
  quality?: string;
1286
1940
  size?: string;
1287
1941
  negativePrompt?: string;
1288
1942
  cfgScale?: number;
1289
1943
  imageWeight?: number;
1290
1944
  renderingSpeed?: string;
1291
- cameraControl?: {
1292
- type: string;
1293
- config?: Record<string, number>;
1294
- };
1295
- multiShot?: boolean;
1296
- shotType?: string;
1297
- multiPrompt?: Array<{
1298
- index: number;
1299
- prompt: string;
1300
- duration: string;
1301
- }>;
1302
- elementList?: Array<{
1303
- element_id: number;
1304
- }>;
1305
- voiceList?: Array<{
1306
- voice_id: string;
1307
- }>;
1308
- dynamicMasks?: Array<{
1309
- mask: string;
1310
- trajectories: Array<{
1311
- x: number;
1312
- y: number;
1313
- }>;
1314
- }>;
1315
- staticMask?: string;
1316
- callbackUrl?: string;
1317
- externalTaskId?: string;
1945
+ /** Ideogram V4 — opt into post-generation copyright detection (Hive likeness + logo checks). */
1946
+ enableCopyrightDetection?: boolean;
1318
1947
  mentionedPersonas?: Array<{
1319
1948
  id: string;
1320
1949
  name: string;
1321
1950
  imageUrl: string;
1322
1951
  vibeId: string;
1323
1952
  }>;
1324
- background?: string;
1325
- outputFormat?: string;
1326
- guidance?: number;
1327
- seed?: number;
1328
1953
  outputMegapixels?: number;
1329
- exploreImageId?: string;
1330
1954
  sourceImageId?: string;
1331
1955
  /** Display-only URL for the source image (not sent to API, used for UI preview). */
1332
1956
  sourceImageUrl?: string;
1333
1957
  similarity?: number;
1958
+ audioSetting?: 'auto' | 'origin';
1959
+ returnLastFrame?: boolean;
1960
+ background?: string;
1961
+ outputFormat?: string;
1962
+ guidance?: number;
1963
+ seed?: number;
1964
+ substyle?: string;
1965
+ thinkingLevel?: 'minimal' | 'high';
1966
+ thinkingBudget?: number;
1334
1967
  }
1335
- type PayloadBuilder<TContext extends GenerationContext = GenerationContext> = (ctx: TContext) => Record<string, unknown>;
1968
+ type PayloadBuilder<TContext extends GenerationContext = GenerationContext> = (ctx: TContext) => object;
1336
1969
  /** Lightweight runtime schema contract used by SDK integrations. */
1337
1970
  interface RuntimeSchema<T = unknown> {
1338
1971
  parse(input: unknown): T;
@@ -1347,37 +1980,32 @@ interface RuntimeSchema<T = unknown> {
1347
1980
  * - per_video: rate (flat per video)
1348
1981
  * - per_audio: rate (flat per audio)
1349
1982
  */
1350
- type PricingUnit = 'per_second' | 'per_minute' | 'per_image' | 'per_megapixel' | 'per_character' | 'per_1k_character' | 'per_video' | 'per_audio';
1351
- /** Maps a model to its backend toolId(s) for monetization.
1352
- * Recursive — dimensions can be nested (e.g. audio inside resolution).
1353
- * - string: single flat toolId
1354
- * - { by: 'audio', on, off } — keyed by generateAudio boolean
1355
- * - { by: 'resolution', map } — keyed by resolution string, e.g. '720p' | '1080p'
1356
- * - { by: 'quality', map } — keyed by quality string, e.g. 'high' | 'medium' | 'low'
1357
- * - { by: 'renderingSpeed', map } — keyed by renderingSpeed, e.g. 'std' | 'pro'
1358
- * - { by: 'duration', map } — keyed by duration number as string, e.g. '5' | '10'
1359
- * - { by: 'megapixel', map } — keyed by MP threshold as string (e.g. '24', '48'); resolver picks smallest tier >= outputMegapixels
1360
- */
1361
- type ToolIdMapping = string | {
1362
- by: 'audio';
1363
- on: ToolIdMapping;
1364
- off: ToolIdMapping;
1365
- } | {
1366
- by: 'resolution';
1367
- map: Record<string, ToolIdMapping>;
1368
- } | {
1369
- by: 'quality';
1370
- map: Record<string, ToolIdMapping>;
1983
+ /** Condition operator: equality or existence check. */
1984
+ type ConditionOperator = {
1985
+ is: unknown;
1371
1986
  } | {
1372
- by: 'renderingSpeed';
1373
- map: Record<string, ToolIdMapping>;
1374
- } | {
1375
- by: 'duration';
1376
- map: Record<string, ToolIdMapping>;
1987
+ exists: boolean;
1988
+ };
1989
+ /** Condition map: each key maps to an operator. */
1990
+ type ConstraintCondition = Record<string, ConditionOperator>;
1991
+ /** Per-param outcome of a matching constraint rule.
1992
+ * - `allowed`: restrict this param to a subset of values.
1993
+ * - `disabled`: param is flagged as constrained — UI interprets per-param kind
1994
+ * (dropdowns grey out; text inputs like `prompt` stay editable but surface
1995
+ * the reason as an info banner).
1996
+ */
1997
+ type Restriction = {
1998
+ allowed: unknown[];
1999
+ reason?: string;
1377
2000
  } | {
1378
- by: 'megapixel';
1379
- map: Record<string, ToolIdMapping>;
2001
+ disabled: true;
2002
+ reason?: string;
1380
2003
  };
2004
+ /** Declarative rule: when condition matches, apply restrictions to params. */
2005
+ interface Constraint {
2006
+ when: ConstraintCondition;
2007
+ then: Record<string, Restriction>;
2008
+ }
1381
2009
  type BadgeType = 'new' | 'popular' | 'coming-soon' | 'fast' | 'premium' | 'hot';
1382
2010
  interface ModelDefinition {
1383
2011
  id: string;
@@ -1395,24 +2023,35 @@ interface ModelDefinition {
1395
2023
  description: string;
1396
2024
  features: ModelFeature[];
1397
2025
  badge?: BadgeType[];
2026
+ /** ISO YYYY-MM-DD date the model was added. The 'new' badge is derived from this — see core/badges.ts. */
2027
+ addedAt?: string;
2028
+ /**
2029
+ * Marks a model as operationally unavailable — backend not deployed,
2030
+ * pricing unconfirmed, catalog/runtime mismatch, etc. Expected to flip
2031
+ * back on once the gate clears. Hidden from default catalog lookups.
2032
+ */
1398
2033
  disabled?: boolean;
2034
+ /**
2035
+ * Marks a model as retired — superseded by a newer model or otherwise no
2036
+ * longer offered. Will not come back. Catalog row stays so workflow IDs
2037
+ * and toolIds remain resolvable for historical jobs and pricing. Hidden
2038
+ * from default catalog lookups, same as `disabled`.
2039
+ */
2040
+ deprecated?: boolean;
1399
2041
  mode: GenerationMode;
1400
2042
  inputType: InputType;
1401
2043
  modelId?: string;
1402
2044
  paramConfig: ModelParams;
2045
+ /** Declarative inter-parameter constraints (e.g. "1080p requires 8s duration"). */
2046
+ constraints?: Constraint[];
1403
2047
  /** Payload builder. Optional — omit for pass-through (param values sent as-is). */
1404
2048
  buildPayload?: PayloadBuilder;
1405
2049
  /** I2V/edit payload builder when different from buildPayload. */
1406
2050
  buildEditPayload?: PayloadBuilder;
1407
2051
  outputSchema?: RuntimeSchema<unknown>;
1408
- toolId?: ToolIdMapping;
1409
- editToolId?: ToolIdMapping;
1410
- pricingUnit?: PricingUnit;
1411
2052
  estimatedTime?: number | Record<string, number>;
1412
2053
  editEstimatedTime?: number | Record<string, number>;
1413
2054
  testTimeout?: number;
1414
- /** Credit prices per toolId, populated from vendor config. */
1415
- creditPrice?: Record<string, number>;
1416
2055
  }
1417
2056
 
1418
2057
  /**
@@ -1429,8 +2068,12 @@ interface ModelFilter {
1429
2068
  provider?: string;
1430
2069
  }
1431
2070
  declare const Models: {
1432
- readonly BytedanceOmnihuman: "bytedance-omnihuman";
1433
- readonly BytedanceUpscaler: "bytedance-upscaler";
2071
+ readonly AsyncFlashV1: "async-flash-v1";
2072
+ readonly BytedanceOmnihumanV15: "bytedance-omnihuman-v1.5";
2073
+ readonly BytedanceVideoUpscaler: "bytedance-video-upscaler";
2074
+ readonly ClaudeHaiku45: "claude-haiku-4-5";
2075
+ readonly ClaudeOpus48: "claude-opus-4-8";
2076
+ readonly ClaudeSonnet46: "claude-sonnet-4-6";
1434
2077
  readonly CreatifyAurora: "creatify-aurora";
1435
2078
  readonly ElevenAudioIsolation: "eleven-audio-isolation";
1436
2079
  readonly ElevenDubbing: "eleven-dubbing";
@@ -1438,10 +2081,11 @@ declare const Models: {
1438
2081
  readonly ElevenMultilingualV2: "eleven-multilingual-v2";
1439
2082
  readonly ElevenStsV2: "eleven-sts-v2";
1440
2083
  readonly ElevenV3: "eleven-v3";
2084
+ readonly ElevenVoiceCreate: "eleven-voice-create";
1441
2085
  readonly ElevenVoiceDesignV2: "eleven-voice-design-v2";
1442
2086
  readonly ElevenVoiceDesignV3: "eleven-voice-design-v3";
1443
- readonly ElevenVoicePreviews: "eleven-voice-previews";
1444
2087
  readonly ElevenVoiceRemix: "eleven-voice-remix";
2088
+ readonly ElevenlabsMusicV2: "elevenlabs-music-v2";
1445
2089
  readonly ElevenlabsSfx: "elevenlabs-sfx";
1446
2090
  readonly Flux2Flex: "flux-2-flex";
1447
2091
  readonly Flux2Max: "flux-2-max";
@@ -1451,99 +2095,150 @@ declare const Models: {
1451
2095
  readonly Gemini25FlashImage: "gemini-2.5-flash-image";
1452
2096
  readonly Gemini25FlashTts: "gemini-2.5-flash-tts";
1453
2097
  readonly Gemini25ProTts: "gemini-2.5-pro-tts";
2098
+ readonly Gemini3Pro: "gemini-3-pro";
1454
2099
  readonly Gemini3ProImage: "gemini-3-pro-image";
1455
2100
  readonly Gemini31FlashImage: "gemini-3.1-flash-image";
2101
+ readonly Gemini31FlashLiteImage: "gemini-3.1-flash-lite-image";
2102
+ readonly GeminiOmniFlashPreview: "gemini-omni-flash-preview";
2103
+ readonly Gpt55: "gpt-5.5";
1456
2104
  readonly GptImage1: "gpt-image-1";
1457
2105
  readonly GptImage15: "gpt-image-1.5";
1458
- readonly Grok: "grok";
2106
+ readonly GptImage2: "gpt-image-2";
1459
2107
  readonly GrokEditVideo: "grok-edit-video";
1460
- readonly GrokImagine: "grok-imagine";
2108
+ readonly GrokExtendVideo: "grok-extend-video";
2109
+ readonly GrokImagineImage: "grok-imagine-image";
2110
+ readonly GrokImagineImageQuality: "grok-imagine-image-quality";
2111
+ readonly GrokImagineVideo: "grok-imagine-video";
2112
+ readonly GrokImagineVideo15: "grok-imagine-video-1.5";
2113
+ readonly GrokTts: "grok-tts";
1461
2114
  readonly Hailuo23: "hailuo-2.3";
1462
2115
  readonly Hailuo23Fast: "hailuo-2.3-fast";
1463
2116
  readonly Hailuo23FastPro: "hailuo-2.3-fast-pro";
1464
2117
  readonly Hailuo23Pro: "hailuo-2.3-pro";
2118
+ readonly Happyhorse10R2v: "happyhorse-1.0-r2v";
2119
+ readonly Happyhorse10T2v: "happyhorse-1.0-t2v";
2120
+ readonly Happyhorse10VideoEdit: "happyhorse-1.0-video-edit";
2121
+ readonly Happyhorse11R2v: "happyhorse-1.1-r2v";
2122
+ readonly Happyhorse11T2v: "happyhorse-1.1-t2v";
1465
2123
  readonly HeygenTalkingPhoto: "heygen-talking-photo";
1466
2124
  readonly HeygenVideoAvatar: "heygen-video-avatar";
1467
2125
  readonly HunyuanV3: "hunyuan-v3";
1468
2126
  readonly IdeogramCharacter: "ideogram-character";
1469
2127
  readonly IdeogramV3: "ideogram-v3";
2128
+ readonly IdeogramV4: "ideogram-v4";
1470
2129
  readonly Imagen40: "imagen-4.0";
1471
2130
  readonly Imagen40Fast: "imagen-4.0-fast";
1472
2131
  readonly Imagen40Ultra: "imagen-4.0-ultra";
1473
- readonly Kling26Pro: "kling-2.6-pro";
1474
- readonly Kling26Standard: "kling-2.6-standard";
1475
2132
  readonly Kling30Image: "kling-3.0-image";
1476
- readonly Kling30Pro: "kling-3.0-pro";
1477
- readonly Kling30Standard: "kling-3.0-standard";
1478
2133
  readonly KlingAvatar: "kling-avatar";
2134
+ readonly KlingElements: "kling-elements";
1479
2135
  readonly KlingMotionControl: "kling-motion-control";
1480
2136
  readonly KlingMotionControlV3: "kling-motion-control-v3";
1481
2137
  readonly KlingMultiImage: "kling-multi-image";
1482
2138
  readonly KlingMultiImageV21: "kling-multi-image-v2-1";
1483
2139
  readonly KlingO1Image: "kling-o1-image";
1484
- readonly KlingO1Pro: "kling-o1-pro";
1485
- readonly KlingO3Pro: "kling-o3-pro";
1486
- readonly KlingO3Standard: "kling-o3-standard";
1487
- readonly KlingOmni: "kling-omni";
1488
2140
  readonly KlingT2a: "kling-t2a";
1489
2141
  readonly KlingV15Image: "kling-v1-5-image";
1490
2142
  readonly KlingV21Image: "kling-v2-1-image";
2143
+ readonly KlingV26: "kling-v2-6";
1491
2144
  readonly KlingV2Image: "kling-v2-image";
1492
2145
  readonly KlingV2NewImage: "kling-v2-new-image";
1493
2146
  readonly KlingV2a: "kling-v2a";
2147
+ readonly KlingV3: "kling-v3";
2148
+ readonly KlingV3Omni: "kling-v3-omni";
2149
+ readonly KlingV3Turbo: "kling-v3-turbo";
2150
+ readonly KlingVideoEffects: "kling-video-effects";
2151
+ readonly KlingVideoO1: "kling-video-o1";
1494
2152
  readonly Ltx23A2v: "ltx-2.3-a2v";
1495
- readonly Ltx23Extend: "ltx-2.3-extend";
1496
- readonly Ltx23FastT2v: "ltx-2.3-fast-t2v";
1497
- readonly Ltx23ProT2v: "ltx-2.3-pro-t2v";
1498
- readonly Ltx23Retake: "ltx-2.3-retake";
1499
- readonly LtxFastT2v: "ltx-fast-t2v";
1500
2153
  readonly LtxProT2v: "ltx-pro-t2v";
1501
- readonly LtxRetake: "ltx-retake";
1502
- readonly LumaFlash2I2v: "luma-flash2-i2v";
1503
- readonly LumaRay2T2v: "luma-ray2-t2v";
2154
+ readonly LtxV2Fast: "ltx-v2-fast";
2155
+ readonly LtxV2Retake: "ltx-v2-retake";
2156
+ readonly LtxV23Extend: "ltx-v2.3-extend";
2157
+ readonly LtxV23Fast: "ltx-v2.3-fast";
2158
+ readonly LtxV23Pro: "ltx-v2.3-pro";
2159
+ readonly LtxV23Retake: "ltx-v2.3-retake";
2160
+ readonly LumaRay2: "luma-ray-2";
2161
+ readonly LumaRay2ReframeVideo: "luma-ray-2-reframe-video";
2162
+ readonly LumaRay32: "luma-ray-3.2";
2163
+ readonly LumaRay32Edit: "luma-ray-3.2-edit";
2164
+ readonly LumaRay32ReframeVideo: "luma-ray-3.2-reframe-video";
2165
+ readonly LumaRayFlash2: "luma-ray-flash-2";
2166
+ readonly LumaRayFlash2ReframeVideo: "luma-ray-flash-2-reframe-video";
2167
+ readonly LumaUni1: "luma-uni-1";
2168
+ readonly LumaUni1Max: "luma-uni-1-max";
1504
2169
  readonly Lyria3Clip: "lyria-3-clip";
1505
2170
  readonly Lyria3Pro: "lyria-3-pro";
1506
2171
  readonly Minimax02Hd: "minimax-02-hd";
1507
- readonly MinimaxMusic: "minimax-music";
2172
+ readonly MinimaxMusicV2: "minimax-music-v2";
1508
2173
  readonly OpenaiTts1: "openai-tts-1";
1509
2174
  readonly OpenaiTts1Hd: "openai-tts-1-hd";
1510
- readonly OviT2v: "ovi-t2v";
2175
+ readonly Ovi: "ovi";
1511
2176
  readonly PicsartChangeBg: "picsart-change-bg";
1512
2177
  readonly PicsartEnhance: "picsart-enhance";
1513
- readonly PicsartRemoveBg: "picsart-remove-bg";
1514
- readonly PikaFrames: "pika-frames";
1515
- readonly PikaScenes: "pika-scenes";
1516
- readonly PikaT2v: "pika-t2v";
2178
+ readonly PicsartFlux2Klein: "picsart-flux-2-klein";
2179
+ readonly PicsartQwenImageEdit: "picsart-qwen-image-edit";
2180
+ readonly PicsartQwenImageEditAngle: "picsart-qwen-image-edit-angle";
2181
+ readonly PicsartQwenMakeup: "picsart-qwen-makeup";
2182
+ readonly PicsartSanaSprintV1: "picsart-sana-sprint-v1";
2183
+ readonly PicsartSodV82: "picsart-sod-v8-2";
2184
+ readonly PicsartVideography: "picsart-videography";
2185
+ readonly Pika22: "pika-2.2";
2186
+ readonly Pika22Frames: "pika-2.2-frames";
2187
+ readonly Pika22Scenes: "pika-2.2-scenes";
2188
+ readonly PixverseC1: "pixverse-c1";
2189
+ readonly PixverseC1Fusion: "pixverse-c1-fusion";
2190
+ readonly PixverseC1Image: "pixverse-c1-image";
2191
+ readonly PixverseV6: "pixverse-v6";
2192
+ readonly PixverseV6Fusion: "pixverse-v6-fusion";
2193
+ readonly PixverseV6Image: "pixverse-v6-image";
1517
2194
  readonly Qwen: "qwen";
1518
- readonly Qwen2: "qwen-2";
1519
- readonly Qwen2Pro: "qwen-2-pro";
1520
- readonly QwenEditPlus: "qwen-edit-plus";
2195
+ readonly QwenImage2: "qwen-image-2";
2196
+ readonly QwenImage2Pro: "qwen-image-2-pro";
2197
+ readonly QwenImageEditPlus: "qwen-image-edit-plus";
1521
2198
  readonly RecraftCreativeUpscale: "recraft-creative-upscale";
1522
2199
  readonly RecraftCrispUpscale: "recraft-crisp-upscale";
1523
2200
  readonly RecraftExplore: "recraft-explore";
1524
2201
  readonly RecraftExploreSimilar: "recraft-explore-similar";
1525
- readonly RecraftReplaceBg: "recraft-replace-bg";
1526
- readonly RecraftV2: "recraft-v2";
1527
- readonly RecraftV2Vector: "recraft-v2-vector";
1528
- readonly RecraftV3: "recraft-v3";
1529
- readonly RecraftV3Vector: "recraft-v3-vector";
1530
- readonly RecraftV4: "recraft-v4";
1531
- readonly RecraftV4Pro: "recraft-v4-pro";
1532
- readonly RecraftV4ProVector: "recraft-v4-pro-vector";
1533
- readonly RecraftV4Vector: "recraft-v4-vector";
1534
2202
  readonly RecraftVectorize: "recraft-vectorize";
2203
+ readonly Recraftv2: "recraftv2";
2204
+ readonly Recraftv2Vector: "recraftv2_vector";
2205
+ readonly Recraftv3: "recraftv3";
2206
+ readonly Recraftv3Vector: "recraftv3_vector";
2207
+ readonly Recraftv3ReplaceBg: "recraftv3-replace-bg";
2208
+ readonly Recraftv4: "recraftv4";
2209
+ readonly Recraftv41: "recraftv4_1";
2210
+ readonly Recraftv41Pro: "recraftv4_1_pro";
2211
+ readonly Recraftv41ProVector: "recraftv4_1_pro_vector";
2212
+ readonly Recraftv41Utility: "recraftv4_1_utility";
2213
+ readonly Recraftv41UtilityPro: "recraftv4_1_utility_pro";
2214
+ readonly Recraftv41UtilityProVector: "recraftv4_1_utility_pro_vector";
2215
+ readonly Recraftv41UtilityVector: "recraftv4_1_utility_vector";
2216
+ readonly Recraftv41Vector: "recraftv4_1_vector";
2217
+ readonly Recraftv4Pro: "recraftv4_pro";
2218
+ readonly Recraftv4ProVector: "recraftv4_pro_vector";
2219
+ readonly Recraftv4Vector: "recraftv4_vector";
1535
2220
  readonly Reve: "reve";
1536
- readonly RunwayAleph: "runway-aleph";
2221
+ readonly RunwayAleph2: "runway-aleph2";
2222
+ readonly RunwayAvatarVideo: "runway-avatar-video";
1537
2223
  readonly RunwayGen3aTurbo: "runway-gen3a-turbo";
2224
+ readonly RunwayGen4Aleph: "runway-gen4-aleph";
1538
2225
  readonly RunwayGen4Ref: "runway-gen4-ref";
1539
- readonly RunwayGen45T2v: "runway-gen45-t2v";
2226
+ readonly RunwayGen45: "runway-gen4.5";
1540
2227
  readonly Seedance15Pro: "seedance-1.5-pro";
1541
2228
  readonly Seedance20: "seedance-2.0";
1542
2229
  readonly Seedance20Fast: "seedance-2.0-fast";
2230
+ readonly Seedance20FastVideoEdit: "seedance-2.0-fast-video-edit";
2231
+ readonly Seedance20FastVideoExtend: "seedance-2.0-fast-video-extend";
2232
+ readonly Seedance20Mini: "seedance-2.0-mini";
2233
+ readonly Seedance20MiniVideoEdit: "seedance-2.0-mini-video-edit";
2234
+ readonly Seedance20MiniVideoExtend: "seedance-2.0-mini-video-extend";
2235
+ readonly Seedance20VideoEdit: "seedance-2.0-video-edit";
2236
+ readonly Seedance20VideoExtend: "seedance-2.0-video-extend";
1543
2237
  readonly SeedanceI2v: "seedance-i2v";
1544
2238
  readonly Seedream40: "seedream-4.0";
1545
2239
  readonly Seedream45: "seedream-4.5";
1546
2240
  readonly Seedream50Lite: "seedream-5.0-lite";
2241
+ readonly Seedream50Pro: "seedream-5.0-pro";
1547
2242
  readonly Sora2: "sora-2";
1548
2243
  readonly Sora2Extend: "sora-2-extend";
1549
2244
  readonly Sora2Pro: "sora-2-pro";
@@ -1556,11 +2251,11 @@ declare const Models: {
1556
2251
  readonly TopazEnhanceStandardV2: "topaz-enhance-standard-v2";
1557
2252
  readonly TopazEnhanceTextRefine: "topaz-enhance-text-refine";
1558
2253
  readonly TopazUpscaleImage: "topaz-upscale-image";
1559
- readonly VeedFabric: "veed-fabric";
1560
- readonly VeedFabricFast: "veed-fabric-fast";
2254
+ readonly VeedFabricV1: "veed-fabric-v1";
2255
+ readonly VeedFabricV1Fast: "veed-fabric-v1-fast";
1561
2256
  readonly Veo31: "veo-3.1";
1562
2257
  readonly Veo31Fast: "veo-3.1-fast";
1563
- readonly Videography: "videography";
2258
+ readonly Veo31Lite: "veo-3.1-lite";
1564
2259
  readonly Wan26Image: "wan-2.6-image";
1565
2260
  readonly Wan26R2v: "wan-2.6-r2v";
1566
2261
  readonly Wan26T2v: "wan-2.6-t2v";
@@ -1568,9 +2263,9 @@ declare const Models: {
1568
2263
  readonly Wan27R2v: "wan-2.7-r2v";
1569
2264
  readonly Wan27T2v: "wan-2.7-t2v";
1570
2265
  readonly Wan27VideoEdit: "wan-2.7-video-edit";
1571
- /** List all models, optionally filtered by mode and/or provider. */
2266
+ /** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
1572
2267
  readonly list: (filter?: ModelFilter) => ModelDefinition[];
1573
- /** Validate generation input against a model's constraints. */
2268
+ /** @deprecated Use `Model(id).validate(input)` instead. */
1574
2269
  readonly validate: (model: string, input: unknown) => ValidationResult;
1575
2270
  /** @deprecated Use `Model(id).params().toSchema()` instead. */
1576
2271
  readonly toSchema: (id: string) => ModelParamSchema;
@@ -1587,6 +2282,29 @@ declare const Models: {
1587
2282
 
1588
2283
  declare function getVoiceById(id: string, extra?: VoiceOption[]): VoiceOption | undefined;
1589
2284
 
2285
+ /**
2286
+ * Pricing internals — owns the ModelPricingClient, the per-model cache, and
2287
+ * the credit-range lookup. The Model accessor delegates to the helpers below
2288
+ * so that model-accessor.ts stays focused on descriptor logic.
2289
+ *
2290
+ * Configure once via `configurePricing(client)` from the app layer (the app
2291
+ * builds the client with its authenticated fetch and base URL), then call
2292
+ * `loadPricing()` to populate the cache. After that, `getCreditsForModel(id, ctx)`
2293
+ * resolves synchronously.
2294
+ */
2295
+
2296
+ /** Options for configuring the pricing source. The SDK constructs the underlying client. */
2297
+ type PricingOptions = ModelPricingClientOptions;
2298
+ /** Configure the pricing source. Resets any prior cache so the next loadPricing() re-runs. */
2299
+ declare function configurePricing(options: PricingOptions): void;
2300
+ /**
2301
+ * Load pricing into an in-memory map keyed by `metadata.modelId`.
2302
+ * Idempotent on success; rejected loads clear `_loadPromise` so the next call retries.
2303
+ * Returns a rejected promise (not a sync throw) when the client is not configured.
2304
+ */
2305
+ declare function loadPricing(): Promise<void>;
2306
+ declare function isPricingLoaded(): boolean;
2307
+
1590
2308
  /**
1591
2309
  * Model accessor — single entry point for all model info.
1592
2310
  *
@@ -1601,21 +2319,28 @@ declare function getVoiceById(id: string, extra?: VoiceOption[]): VoiceOption |
1601
2319
  * m.meta().provider.name // 'Flux'
1602
2320
  */
1603
2321
 
1604
- interface ModelFunction {
1605
- /** Look up a single model by ID. */
1606
- (id: string): ModelDescriptor;
1607
- /** Return all enabled models. */
1608
- all(): ModelDescriptor[];
1609
- /** Find enabled models matching filter criteria. */
1610
- find(filter: ModelFilter$1): ModelDescriptor[];
1611
- /** Case-insensitive search across model id, name, and provider. */
1612
- search(query: string): ModelDescriptor[];
1613
- }
2322
+ /** Look up a single model descriptor by id. */
2323
+ type ModelFunction = (id: string) => ModelDescriptor;
2324
+ declare function _all(): ModelDescriptor[];
2325
+ declare function _find(filter: ModelFilter$1): ModelDescriptor[];
2326
+ declare function _search(query: string): ModelDescriptor[];
2327
+ /** Look up a single model descriptor: `Model('flux-2-pro').params()`. */
2328
+ declare const Model: ModelFunction;
1614
2329
  /**
1615
- * Model accessor call as `Model(id)` or use static methods
1616
- * `Model.all()`, `Model.find()`, `Model.search()`.
2330
+ * Model catalog + subsystem ops:
2331
+ * catalog.all() / .find() / .search()
2332
+ * catalog.pricing.configure(...) / .load() / .isLoaded()
1617
2333
  */
1618
- declare const Model: ModelFunction;
2334
+ declare const catalog: {
2335
+ all: typeof _all;
2336
+ find: typeof _find;
2337
+ search: typeof _search;
2338
+ pricing: {
2339
+ configure: typeof configurePricing;
2340
+ load: typeof loadPricing;
2341
+ isLoaded: typeof isPricingLoaded;
2342
+ };
2343
+ };
1619
2344
 
1620
2345
  /** Result of decoding a deep link. */
1621
2346
  interface DeepLinkResult {
@@ -1649,9 +2374,7 @@ declare const getModel: (id: string) => ModelDefinition | undefined;
1649
2374
  /** Find a model by ID, workflow name, or display name (case-insensitive). */
1650
2375
  declare const findModel: (ref: string) => ModelDefinition | undefined;
1651
2376
 
1652
- /** Resolve a ToolIdMapping to a concrete toolId for a generation context. Recursive. */
1653
- declare function resolveToolId(mapping: ToolIdMapping | undefined, ctx: Partial<GenerationContext>): string | undefined;
1654
- /** Return all toolIds a model can resolve to (toolId + editToolId variants). Recursive. */
1655
- declare function getAllToolIds(model: ModelDefinition): string[];
2377
+ /** Effect scenes that require two input images (e.g. hugs, kisses, swaps). */
2378
+ declare const KLING_DUAL_IMAGE_EFFECTS: ReadonlySet<string>;
1656
2379
 
1657
- export { ALL_MODELS, type AiClient, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type ClientConfig, type DeepLinkResult, type DriveConfig, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerationContext, type GenerationMode, type ListOptions, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type SaveParams, type SdkTransport, type TextDescriptor, type TextEntry, type TypedModelId, type VoiceOption, type WorkflowJobHandle, buildFilename, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getAllToolIds, getModel, getModelsByMode, getVoiceById, inferResourceType, resolveToolId };
2380
+ export { ALL_MODELS, type AiClient, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type ClientConfig, type CreditRange, type CreditRangeContext, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateTextResult, type GenerationContext, type GenerationFile, type GenerationMode, KLING_DUAL_IMAGE_EFFECTS, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type TypedModelId, type UserReaction, type ValidationResult$1 as ValidationResult, type VoiceOption, type WorkflowJobHandle, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, parseGeneration };