@apicity/fal 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/zod.js CHANGED
@@ -62,13 +62,22 @@ export const FalDeletePayloadsRequestSchema = z.object({
62
62
  idempotency_key: z.string().optional(),
63
63
  });
64
64
  // ---------------------------------------------------------------------------
65
+ // Bytedance Seedance 2.0 / 2.5 shared encoding options
66
+ // ---------------------------------------------------------------------------
67
+ const SeedanceBitrateModeSchema = z
68
+ .enum(["standard", "high"])
69
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate.");
70
+ const SeedanceCodecSchema = z
71
+ .enum(["auto", "H264", "H265"])
72
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265.");
73
+ // ---------------------------------------------------------------------------
65
74
  // Bytedance Seedance 2.0 image-to-video
66
75
  // ---------------------------------------------------------------------------
67
76
  export const FalSeedance2p0ImageToVideoRequestSchema = z.object({
68
77
  prompt: z.string(),
69
78
  image_url: z.string(),
70
- end_image_url: z.string().optional(),
71
- resolution: z.enum(["480p", "720p"]).optional(),
79
+ end_image_url: z.string().nullable().optional(),
80
+ resolution: z.enum(["480p", "720p", "1080p", "4k"]).optional(),
72
81
  duration: z
73
82
  .enum([
74
83
  "auto",
@@ -90,15 +99,16 @@ export const FalSeedance2p0ImageToVideoRequestSchema = z.object({
90
99
  .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
91
100
  .optional(),
92
101
  generate_audio: z.boolean().optional(),
93
- seed: z.number().optional(),
94
- end_user_id: z.string().optional(),
102
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
103
+ codec: SeedanceCodecSchema.optional(),
104
+ end_user_id: z.string().nullable().optional(),
95
105
  });
96
106
  // ---------------------------------------------------------------------------
97
107
  // Bytedance Seedance 2.0 text-to-video
98
108
  // ---------------------------------------------------------------------------
99
109
  export const FalSeedance2p0TextToVideoRequestSchema = z.object({
100
110
  prompt: z.string(),
101
- resolution: z.enum(["480p", "720p"]).optional(),
111
+ resolution: z.enum(["480p", "720p", "1080p", "4k"]).optional(),
102
112
  duration: z
103
113
  .enum([
104
114
  "auto",
@@ -120,8 +130,9 @@ export const FalSeedance2p0TextToVideoRequestSchema = z.object({
120
130
  .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
121
131
  .optional(),
122
132
  generate_audio: z.boolean().optional(),
123
- seed: z.number().optional(),
124
- end_user_id: z.string().optional(),
133
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
134
+ codec: SeedanceCodecSchema.optional(),
135
+ end_user_id: z.string().nullable().optional(),
125
136
  });
126
137
  // ---------------------------------------------------------------------------
127
138
  // Bytedance Seedance 2.0 Fast image-to-video
@@ -129,7 +140,7 @@ export const FalSeedance2p0TextToVideoRequestSchema = z.object({
129
140
  export const FalSeedance2p0FastImageToVideoRequestSchema = z.object({
130
141
  prompt: z.string(),
131
142
  image_url: z.string(),
132
- end_image_url: z.string().optional(),
143
+ end_image_url: z.string().nullable().optional(),
133
144
  resolution: z.enum(["480p", "720p"]).optional(),
134
145
  duration: z
135
146
  .enum([
@@ -152,8 +163,9 @@ export const FalSeedance2p0FastImageToVideoRequestSchema = z.object({
152
163
  .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
153
164
  .optional(),
154
165
  generate_audio: z.boolean().optional(),
155
- seed: z.number().optional(),
156
- end_user_id: z.string().optional(),
166
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
167
+ codec: SeedanceCodecSchema.optional(),
168
+ end_user_id: z.string().nullable().optional(),
157
169
  });
158
170
  // ---------------------------------------------------------------------------
159
171
  // Bytedance Seedance 2.0 Fast text-to-video
@@ -182,8 +194,9 @@ export const FalSeedance2p0FastTextToVideoRequestSchema = z.object({
182
194
  .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
183
195
  .optional(),
184
196
  generate_audio: z.boolean().optional(),
185
- seed: z.number().optional(),
186
- end_user_id: z.string().optional(),
197
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
198
+ codec: SeedanceCodecSchema.optional(),
199
+ end_user_id: z.string().nullable().optional(),
187
200
  });
188
201
  // ---------------------------------------------------------------------------
189
202
  // Bytedance Seedance 2.0 reference-to-video
@@ -212,22 +225,37 @@ const Seedance2p0ReferenceAspectRatioSchema = z.enum([
212
225
  "3:4",
213
226
  "9:16",
214
227
  ]);
215
- export const FalSeedance2p0ReferenceToVideoRequestSchema = z.object({
228
+ const seedanceReferenceFileCount = (v) => (v.image_urls?.length ?? 0) +
229
+ (v.video_urls?.length ?? 0) +
230
+ (v.audio_urls?.length ?? 0);
231
+ const seedanceAudioHasVisual = (v) => (v.audio_urls?.length ?? 0) === 0 ||
232
+ (v.image_urls?.length ?? 0) + (v.video_urls?.length ?? 0) > 0;
233
+ export const FalSeedance2p0ReferenceToVideoRequestSchema = z
234
+ .object({
216
235
  prompt: z.string(),
217
236
  image_urls: z.array(z.string()).max(9).optional(),
218
237
  video_urls: z.array(z.string()).max(3).optional(),
219
238
  audio_urls: z.array(z.string()).max(3).optional(),
220
- resolution: z.enum(["480p", "720p"]).optional(),
239
+ resolution: z.enum(["480p", "720p", "1080p", "4k"]).optional(),
221
240
  duration: Seedance2p0ReferenceDurationSchema.optional(),
222
241
  aspect_ratio: Seedance2p0ReferenceAspectRatioSchema.optional(),
223
242
  generate_audio: z.boolean().optional(),
224
- seed: z.number().int().optional(),
225
- end_user_id: z.string().optional(),
243
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
244
+ codec: SeedanceCodecSchema.optional(),
245
+ end_user_id: z.string().nullable().optional(),
246
+ })
247
+ .refine((v) => seedanceReferenceFileCount(v) <= 12, {
248
+ message: "Total files across all modalities must not exceed 12",
249
+ })
250
+ .refine(seedanceAudioHasVisual, {
251
+ message: "Audio references require at least one image or video",
252
+ path: ["audio_urls"],
226
253
  });
227
254
  // ---------------------------------------------------------------------------
228
255
  // Bytedance Seedance 2.0 Fast reference-to-video
229
256
  // ---------------------------------------------------------------------------
230
- export const FalSeedance2p0FastReferenceToVideoRequestSchema = z.object({
257
+ export const FalSeedance2p0FastReferenceToVideoRequestSchema = z
258
+ .object({
231
259
  prompt: z.string(),
232
260
  image_urls: z.array(z.string()).max(9).optional(),
233
261
  video_urls: z.array(z.string()).max(3).optional(),
@@ -236,8 +264,16 @@ export const FalSeedance2p0FastReferenceToVideoRequestSchema = z.object({
236
264
  duration: Seedance2p0ReferenceDurationSchema.optional(),
237
265
  aspect_ratio: Seedance2p0ReferenceAspectRatioSchema.optional(),
238
266
  generate_audio: z.boolean().optional(),
239
- seed: z.number().int().optional(),
240
- end_user_id: z.string().optional(),
267
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
268
+ codec: SeedanceCodecSchema.optional(),
269
+ end_user_id: z.string().nullable().optional(),
270
+ })
271
+ .refine((v) => seedanceReferenceFileCount(v) <= 12, {
272
+ message: "Total files across all modalities must not exceed 12",
273
+ })
274
+ .refine(seedanceAudioHasVisual, {
275
+ message: "Audio references require at least one image or video",
276
+ path: ["audio_urls"],
241
277
  });
242
278
  // ---------------------------------------------------------------------------
243
279
  // Bytedance Seedance 2.5 shared vocabularies
@@ -282,51 +318,49 @@ const Seedance2p5AspectRatioSchema = z.enum([
282
318
  "3:4",
283
319
  "9:16",
284
320
  ]);
285
- const Seedance2p5BitrateModeSchema = z.enum(["standard", "high"]);
286
321
  // ---------------------------------------------------------------------------
287
322
  // Bytedance Seedance 2.5 text-to-video
288
323
  // ---------------------------------------------------------------------------
289
324
  export const FalSeedance2p5TextToVideoRequestSchema = z.object({
290
325
  prompt: z.string(),
291
326
  resolution: Seedance2p5ResolutionSchema.optional(),
327
+ draft: z
328
+ .boolean()
329
+ .describe("Generate a draft preview at 480p, overriding resolution. Returns a draft_id for completing the draft at 1080p within seven days.")
330
+ .optional(),
292
331
  duration: Seedance2p5DurationSchema.optional(),
293
332
  aspect_ratio: Seedance2p5AspectRatioSchema.optional(),
294
333
  generate_audio: z.boolean().optional(),
295
- bitrate_mode: Seedance2p5BitrateModeSchema.optional(),
296
- seed: z.number().int().optional(),
297
- end_user_id: z.string().optional(),
334
+ bitrate_mode: SeedanceBitrateModeSchema.optional(),
335
+ codec: SeedanceCodecSchema.optional(),
336
+ end_user_id: z.string().nullable().optional(),
298
337
  });
299
338
  // ---------------------------------------------------------------------------
300
339
  // Bytedance Seedance 2.5 image-to-video
301
340
  // ---------------------------------------------------------------------------
302
341
  export const FalSeedance2p5ImageToVideoRequestSchema = FalSeedance2p5TextToVideoRequestSchema.extend({
342
+ prompt: z.string().nullable().optional(),
303
343
  image_url: z.string(),
304
- end_image_url: z.string().optional(),
344
+ end_image_url: z.string().nullable().optional(),
345
+ // The live Input declares aspect_ratio const "auto" ("Always "auto" for
346
+ // image-to-video"): the output follows the input image's aspect.
347
+ aspect_ratio: z.literal("auto").optional(),
305
348
  });
306
349
  // ---------------------------------------------------------------------------
307
350
  // Bytedance Seedance 2.5 reference-to-video
308
351
  // ---------------------------------------------------------------------------
352
+ // The per-modality caps are documented in the field descriptions; together
353
+ // they also bound the documented 50-file total.
309
354
  export const FalSeedance2p5ReferenceToVideoRequestSchema = FalSeedance2p5TextToVideoRequestSchema.extend({
355
+ prompt: z.string().nullable().optional(),
356
+ task: z
357
+ .enum(["reference", "editing", "extension"])
358
+ .describe("The type of video generation task. Reference uses the supplied media as guidance. Editing modifies a reference video and automatically coerces aspect_ratio and duration to auto. Extension continues a reference video and automatically coerces aspect_ratio to auto.")
359
+ .optional(),
310
360
  image_urls: z.array(z.string()).max(30).optional(),
311
361
  video_urls: z.array(z.string()).max(10).optional(),
312
362
  audio_urls: z.array(z.string()).max(10).optional(),
313
- }).superRefine((value, context) => {
314
- const imageCount = value.image_urls?.length ?? 0;
315
- const videoCount = value.video_urls?.length ?? 0;
316
- const audioCount = value.audio_urls?.length ?? 0;
317
- if (imageCount + videoCount + audioCount > 50) {
318
- context.addIssue({
319
- code: "custom",
320
- message: "Total reference inputs must not exceed 50",
321
- });
322
- }
323
- if (audioCount > 0 && imageCount === 0 && videoCount === 0) {
324
- context.addIssue({
325
- code: "custom",
326
- path: ["audio_urls"],
327
- message: "Audio references require at least one image or video",
328
- });
329
- }
363
+ seed: z.number().int().nullable().optional(),
330
364
  });
331
365
  // ---------------------------------------------------------------------------
332
366
  // Lightricks LTX-2.5 image-to-video (pro tier)
@@ -6394,7 +6428,2503 @@ export const FalLumaAgentRayV3p2TextToVideoRequestSchema = z.object({
6394
6428
  .default(false)
6395
6429
  .describe("Also export an EXR file alongside the MP4. Requires hdr=true and HDR access."),
6396
6430
  });
6431
+ // Pinned to the live queue OpenAPI read on 2026-10-15
6432
+ // (sha256 d9b32415819fc7e1e7b4cee205718e2a16343e07a0b4fd5e4245736ae738b505). Field order follows x-fal-order-properties.
6433
+ // Docs: https://fal.ai/models/bria/fibo-edit-1.5/expand/api
6434
+ export const FalBriaFiboEdit1p5ExpandRequestSchema = z.object({
6435
+ image_url: z.string().describe("The image to expand (file or URL)."),
6436
+ canvas_size: z
6437
+ .array(z.number().int())
6438
+ .min(2)
6439
+ .max(2)
6440
+ .nullable()
6441
+ .optional()
6442
+ .describe("The desired size of the final image after the expansion, as [width, height]. Area must be under 25 megapixels. Pairs with 'original_image_location'."),
6443
+ aspect_ratio: z
6444
+ .enum(["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"])
6445
+ .nullable()
6446
+ .optional()
6447
+ .describe("The desired aspect ratio of the final image. Used over 'original_image_size' and 'original_image_location' if provided: the original is centred and the canvas grows around it."),
6448
+ original_image_size: z
6449
+ .array(z.number().int())
6450
+ .min(2)
6451
+ .max(2)
6452
+ .nullable()
6453
+ .optional()
6454
+ .describe("The desired size of the original inside the canvas, as [width, height]; it is resized to this before being placed. Ignored if 'aspect_ratio' is provided."),
6455
+ original_image_location: z
6456
+ .array(z.number().int())
6457
+ .min(2)
6458
+ .max(2)
6459
+ .nullable()
6460
+ .optional()
6461
+ .describe("Top-left corner of the original within the canvas, as [x, y]. May sit outside the canvas, in which case the original is cropped. Ignored if 'aspect_ratio' is provided."),
6462
+ prompt: z
6463
+ .string()
6464
+ .nullable()
6465
+ .optional()
6466
+ .describe("What should appear in the expanded area. Omit it and the model is asked only to extend the image, which is usually what you want for a plain canvas change."),
6467
+ seed: z
6468
+ .number()
6469
+ .int()
6470
+ .min(0)
6471
+ .max(2147483647)
6472
+ .nullable()
6473
+ .optional()
6474
+ .describe("Reuse the seed from a previous response to recreate that result. Omit it for a random one, which is reported in the response either way."),
6475
+ negative_prompt: z
6476
+ .string()
6477
+ .nullable()
6478
+ .optional()
6479
+ .describe("Not supported by this model, and refused rather than ignored -- see 'prompt'. Present only so a request written against the SDXL expansion endpoint fails loudly here instead of silently losing the field."),
6480
+ sync_mode: z
6481
+ .boolean()
6482
+ .default(false)
6483
+ .describe("If true, returns the image directly in the response (increases latency)."),
6484
+ retain_original_quality: z
6485
+ .boolean()
6486
+ .default(true)
6487
+ .describe("Keep the original's own pixels at full resolution. Generation happens near one megapixel, so a larger canvas is scaled up afterwards; leave this on and the region the mask protected is not resampled at all. Turn it off for a uniformly soft result, which can hide the seam on a textured background."),
6488
+ preserve_alpha: z
6489
+ .boolean()
6490
+ .default(true)
6491
+ .describe("Keep the input's transparency. The model works in RGB, so the alpha channel is not generated -- the original's own is extended outwards by replicating its edges, which is what expanding a cutout means. Turn it off to get a flattened RGB result."),
6492
+ return_model_output: z
6493
+ .boolean()
6494
+ .default(false)
6495
+ .describe("Also return the model's own frame, before the original was pasted back and the seam blended. Diagnostic only -- it does not change the returned image. Use it to tell a bad generation apart from a bad composite: a boundary already broken in that frame came from the model, not from post-processing."),
6496
+ });
6497
+ // Live fal OpenAPI verified 2026-10-15.
6498
+ export const FalBriaGuidedRemoveBackgroundRequestSchema = z.object({
6499
+ image_url: z
6500
+ .string()
6501
+ .default("https://labs-assets.bria.ai/api-examples/guided-remove-background/yoga_studio_input.jpg")
6502
+ .describe("Source image as a public URL, a base64 data URI (data:image/png;base64,...) or raw base64-encoded image bytes."),
6503
+ prompt: z
6504
+ .string()
6505
+ .nullable()
6506
+ .optional()
6507
+ .describe("Optional. Plain words for how to change the default cutout of the photo's obvious subject: add something ('the person with the mat and the plant'), drop something ('the woman at her desk without the lamp') or narrow it ('only the chair'). Everything kept is the original pixels with a new alpha channel. Leave it empty for the plain cutout of the obvious subject."),
6508
+ autocrop: z
6509
+ .boolean()
6510
+ .default(false)
6511
+ .describe("Tighten the output canvas to the kept content."),
6512
+ sync_mode: z
6513
+ .boolean()
6514
+ .default(false)
6515
+ .describe("If true, the function waits for the image to be generated and uploaded before returning, so the image is returned directly (base64) instead of via the CDN. Increases latency."),
6516
+ });
6517
+ // The ImageSize component publishes only 0 < side <= 14142. fal's validator
6518
+ // is stricter for an explicit size and answers 422 (free, 2026-10-15) unless
6519
+ // each side is a multiple of 16 and at most 2048 and the aspect ratio is
6520
+ // between 1:16 and 16:1, as the field description says.
6521
+ const FalMarigoldV2ImageSizeSchema = z
6522
+ .object({
6523
+ width: z
6524
+ .number()
6525
+ .int()
6526
+ .gt(0)
6527
+ .max(2048)
6528
+ .multipleOf(16)
6529
+ .default(512)
6530
+ .describe("The width of the generated image."),
6531
+ height: z
6532
+ .number()
6533
+ .int()
6534
+ .gt(0)
6535
+ .max(2048)
6536
+ .multipleOf(16)
6537
+ .default(512)
6538
+ .describe("The height of the generated image."),
6539
+ })
6540
+ .refine((size) => Math.max(size.width, size.height) / Math.min(size.width, size.height) <=
6541
+ 16, { message: "image_size aspect ratio must be between 1:16 and 16:1" });
6542
+ // Pinned to the live queue OpenAPI read on 2026-10-15
6543
+ // (sha256 f29dd92e601effe057892d51be46ec5c097c84cd5060b6f6454ed7f447a1108c). Field order follows x-fal-order-properties.
6544
+ // Docs: https://fal.ai/models/fal-ai/marigold-v2/api
6545
+ export const FalMarigoldV2RequestSchema = z.object({
6546
+ prediction_type: z
6547
+ .enum(["depth", "see-through-depth", "normals", "albedo"])
6548
+ .default("depth")
6549
+ .describe("Prediction map to generate."),
6550
+ image_url: z.string().describe("Input image url."),
6551
+ image_size: z
6552
+ .union([
6553
+ FalMarigoldV2ImageSizeSchema,
6554
+ z.enum([
6555
+ "square_hd",
6556
+ "square",
6557
+ "portrait_4_3",
6558
+ "portrait_16_9",
6559
+ "landscape_4_3",
6560
+ "landscape_16_9",
6561
+ ]),
6562
+ ])
6563
+ .nullable()
6564
+ .optional()
6565
+ .describe("Inference size as an explicit {width, height} object or a preset string (e.g. square_hd, landscape_4_3). Both dimensions must be multiples of 16 and no larger than 2048 pixels on either side, with an aspect ratio between 1:16 and 16:1. Defaults to the input image's dimensions rounded to the nearest multiple of 16."),
6566
+ seed: z
6567
+ .number()
6568
+ .int()
6569
+ .nullable()
6570
+ .optional()
6571
+ .describe("Random seed. Only affects the VAE encoder's latent sampling (the forward pass itself is a single deterministic step); the same seed and image reproduce the same output."),
6572
+ enable_safety_checker: z
6573
+ .boolean()
6574
+ .default(true)
6575
+ .describe("Authorized callers may set false to request relaxed screening."),
6576
+ });
6577
+ // Mirelo SFX 2.0 text-to-audio.
6578
+ export const FalMireloAiSfx2p0TextToAudioRequestSchema = z
6579
+ .object({
6580
+ prompt: z
6581
+ .string()
6582
+ .min(1)
6583
+ .max(2000)
6584
+ .describe("What the sound effect should sound like"),
6585
+ negative_prompt: z
6586
+ .string()
6587
+ .max(1000)
6588
+ .nullable()
6589
+ .optional()
6590
+ .describe("Sounds to keep out of the result"),
6591
+ duration: z
6592
+ .number()
6593
+ .min(0.1)
6594
+ .max(600)
6595
+ .default(30)
6596
+ .describe("Seconds of sound to generate, up to the deployment's text-to-SFX maximum"),
6597
+ // Upstream permits int64 seeds beyond Zod int()'s safe-integer range.
6598
+ seed: z
6599
+ .number()
6600
+ .refine(Number.isInteger, "Seed must be an integer")
6601
+ .min(-1)
6602
+ .max(9223372036854776000)
6603
+ .nullable()
6604
+ .optional()
6605
+ .describe("Seed of the first sample; -1 or unset is random"),
6606
+ num_samples: z
6607
+ .number()
6608
+ .int()
6609
+ .min(1)
6610
+ .max(4)
6611
+ .default(2)
6612
+ .describe("Number of samples to generate, in one batched forward"),
6613
+ upload_audio_format: z
6614
+ .enum(["wav", "mp3", "aac", "flac"])
6615
+ .default("wav")
6616
+ .describe("Audio format of each file"),
6617
+ upload_audio_bitrate_kbps: z
6618
+ .number()
6619
+ .int()
6620
+ .min(32)
6621
+ .max(320)
6622
+ .nullable()
6623
+ .optional()
6624
+ .describe("Bitrate in kbps for an mp3 or aac upload. mp3 is written at exactly this constant rate, one of 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320. aac takes 32 to 256 as a target the encoder may undershoot on mono or sparse audio. Unset keeps the default: mp3 at LAME V0 VBR, aac at a 256 kbps target. Refused with a lossless upload_audio_format."),
6625
+ })
6626
+ .refine((p) => p.upload_audio_bitrate_kbps == null ||
6627
+ p.upload_audio_format === "mp3" ||
6628
+ p.upload_audio_format === "aac", {
6629
+ path: ["upload_audio_bitrate_kbps"],
6630
+ message: "Bitrate is refused for lossless audio formats",
6631
+ })
6632
+ .refine((p) => p.upload_audio_bitrate_kbps == null ||
6633
+ p.upload_audio_format !== "mp3" ||
6634
+ [32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320].includes(p.upload_audio_bitrate_kbps), {
6635
+ path: ["upload_audio_bitrate_kbps"],
6636
+ message: "mp3 requires a supported constant bitrate",
6637
+ })
6638
+ .refine((p) => p.upload_audio_bitrate_kbps == null ||
6639
+ p.upload_audio_format !== "aac" ||
6640
+ p.upload_audio_bitrate_kbps <= 256, {
6641
+ path: ["upload_audio_bitrate_kbps"],
6642
+ message: "aac bitrate must not exceed 256 kbps",
6643
+ });
6644
+ // Mirelo SFX 2.0 video-to-audio.
6645
+ export const FalMireloAiSfx2p0VideoToAudioRequestSchema = z
6646
+ .object({
6647
+ video_url: z.string().describe("Video URL to add sound to."),
6648
+ text_prompt: z
6649
+ .string()
6650
+ .max(2000)
6651
+ .nullable()
6652
+ .optional()
6653
+ .describe("Optional text prompt guiding generation."),
6654
+ negative_prompt: z
6655
+ .string()
6656
+ .max(1000)
6657
+ .nullable()
6658
+ .optional()
6659
+ .describe("Sounds to keep out of the result, as a short comma-separated list."),
6660
+ preserve_speech: z
6661
+ .boolean()
6662
+ .default(true)
6663
+ .describe("Keep the speech in the input's audio and generate the rest of the soundtrack around it. False generates sound effects only and suppresses speech."),
6664
+ duration: z
6665
+ .number()
6666
+ .min(1)
6667
+ .max(600)
6668
+ .default(10)
6669
+ .describe("Seconds of sound to generate, at least 1 s, clamped to the video's length. Over 10 s generates in 10 s windows. A video shorter than 1 s answers 400."),
6670
+ num_samples: z
6671
+ .number()
6672
+ .int()
6673
+ .min(1)
6674
+ .max(4)
6675
+ .default(2)
6676
+ .describe("Number of variations to generate."),
6677
+ seed: z
6678
+ .number()
6679
+ .refine(Number.isInteger, "Seed must be an integer")
6680
+ .min(-1)
6681
+ .max(18446744073709552000)
6682
+ .nullable()
6683
+ .optional()
6684
+ .describe("Seed for generation. -1 or None for random."),
6685
+ upload_audio_format: z
6686
+ .enum(["wav", "mp3", "aac", "flac"])
6687
+ .default("wav")
6688
+ .describe("Audio format of each file"),
6689
+ upload_audio_bitrate_kbps: z
6690
+ .number()
6691
+ .int()
6692
+ .min(32)
6693
+ .max(320)
6694
+ .nullable()
6695
+ .optional()
6696
+ .describe("Bitrate in kbps for an mp3 or aac upload. mp3 is written at exactly this constant rate, one of 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320. aac takes 32 to 256 as a target the encoder may undershoot on mono or sparse audio. Unset keeps the default: mp3 at LAME V0 VBR, aac at a 256 kbps target. Refused with a lossless upload_audio_format."),
6697
+ })
6698
+ .refine((p) => p.upload_audio_bitrate_kbps == null ||
6699
+ p.upload_audio_format === "mp3" ||
6700
+ p.upload_audio_format === "aac", {
6701
+ path: ["upload_audio_bitrate_kbps"],
6702
+ message: "Bitrate is refused for lossless audio formats",
6703
+ })
6704
+ .refine((p) => p.upload_audio_bitrate_kbps == null ||
6705
+ p.upload_audio_format !== "mp3" ||
6706
+ [32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320].includes(p.upload_audio_bitrate_kbps), {
6707
+ path: ["upload_audio_bitrate_kbps"],
6708
+ message: "mp3 requires a supported constant bitrate",
6709
+ })
6710
+ .refine((p) => p.upload_audio_bitrate_kbps == null ||
6711
+ p.upload_audio_format !== "aac" ||
6712
+ p.upload_audio_bitrate_kbps <= 256, {
6713
+ path: ["upload_audio_bitrate_kbps"],
6714
+ message: "aac bitrate must not exceed 256 kbps",
6715
+ });
6716
+ // Mirelo SFX 2.0 video-to-video.
6717
+ export const FalMireloAiSfx2p0VideoToVideoRequestSchema = z.object({
6718
+ video_url: z.string().describe("Video URL to add sound to."),
6719
+ text_prompt: z
6720
+ .string()
6721
+ .max(2000)
6722
+ .nullable()
6723
+ .optional()
6724
+ .describe("Optional text prompt guiding generation."),
6725
+ negative_prompt: z
6726
+ .string()
6727
+ .max(1000)
6728
+ .nullable()
6729
+ .optional()
6730
+ .describe("Sounds to keep out of the result, as a short comma-separated list."),
6731
+ preserve_speech: z
6732
+ .boolean()
6733
+ .default(true)
6734
+ .describe("Keep the speech in the input's audio and generate the rest of the soundtrack around it. False generates sound effects only and suppresses speech."),
6735
+ duration: z
6736
+ .number()
6737
+ .min(1)
6738
+ .max(600)
6739
+ .default(10)
6740
+ .describe("Seconds of sound to generate, at least 1 s, clamped to the video's length. Over 10 s generates in 10 s windows. A video shorter than 1 s answers 400."),
6741
+ num_samples: z
6742
+ .number()
6743
+ .int()
6744
+ .min(1)
6745
+ .max(4)
6746
+ .default(2)
6747
+ .describe("Number of variations to generate."),
6748
+ seed: z
6749
+ .number()
6750
+ .refine(Number.isInteger, "Seed must be an integer")
6751
+ .min(-1)
6752
+ .max(18446744073709552000)
6753
+ .nullable()
6754
+ .optional()
6755
+ .describe("Seed for generation. -1 or None for random."),
6756
+ });
6757
+ // Mureka lyrics generation.
6758
+ export const FalMurekaApiGenerateLyricsRequestSchema = z.object({
6759
+ prompt: z
6760
+ .string()
6761
+ .min(1)
6762
+ .describe("Topic, theme, or title to use when writing the lyrics."),
6763
+ });
6764
+ // Mureka ships new model ids on its own cadence, so the Mureka model enums
6765
+ // are unioned with an alias instead of a bare `.or(z.string())`, which would
6766
+ // accept typos. The alias matches Mureka's id grammar: `mureka-` followed by
6767
+ // a numeric version with an optional dotted minor (mureka-8, mureka-9.5) or
6768
+ // an o-series id (mureka-o1). Anything else must be added to an enum.
6769
+ const FalMurekaModelAliasSchema = z
6770
+ .string()
6771
+ .regex(/^mureka-(?:o\d+|\d+(?:\.\d+)?)$/, "Expected a listed model or a versioned Mureka alias (e.g. mureka-10)");
6772
+ // Mureka instrumental generation.
6773
+ export const FalMurekaApiGenerateInstrumentalRequestSchema = z
6774
+ .object({
6775
+ model: z
6776
+ .enum(["mureka-7.6", "mureka-8", "mureka-9", "mureka-9.5"])
6777
+ .or(FalMurekaModelAliasSchema)
6778
+ .default("mureka-9.5")
6779
+ .describe("Model used to generate the instrumental."),
6780
+ prompt: z
6781
+ .string()
6782
+ .min(1)
6783
+ .max(1024)
6784
+ .nullable()
6785
+ .optional()
6786
+ .describe("Description of the desired instrumental. Provide exactly one of prompt or instrumental_id."),
6787
+ instrumental_id: z
6788
+ .string()
6789
+ .min(1)
6790
+ .nullable()
6791
+ .optional()
6792
+ .describe("Instrumental ID returned by /files/upload with purpose='instrumental'. Provide exactly one of instrumental_id or prompt."),
6793
+ })
6794
+ .refine((p) => (p.prompt != null) !== (p.instrumental_id != null), {
6795
+ path: ["prompt"],
6796
+ message: "Provide exactly one of prompt or instrumental_id.",
6797
+ });
6798
+ // Mureka song generation.
6799
+ export const FalMurekaApiGenerateSongRequestSchema = z
6800
+ .object({
6801
+ model: z
6802
+ .enum(["mureka-7.6", "mureka-o2", "mureka-8", "mureka-9", "mureka-9.5"])
6803
+ .or(FalMurekaModelAliasSchema)
6804
+ .default("mureka-9.5")
6805
+ .describe("The model to use for song generation."),
6806
+ lyrics: z
6807
+ .string()
6808
+ .min(1)
6809
+ .max(5000)
6810
+ .nullable()
6811
+ .optional()
6812
+ .describe("Lyrics to sing, up to 5,000 characters. Provide this for lyrics-to-song generation; otherwise provide prompt for prompt-to-song generation."),
6813
+ styles: z
6814
+ .array(z.enum([
6815
+ "pop",
6816
+ "rock",
6817
+ "jazz",
6818
+ "r&b",
6819
+ "edm",
6820
+ "ambient",
6821
+ "folk",
6822
+ "latin",
6823
+ "k-pop",
6824
+ "j-pop",
6825
+ "house",
6826
+ "gospel",
6827
+ "lo-fi",
6828
+ ]))
6829
+ .min(1)
6830
+ .nullable()
6831
+ .optional()
6832
+ .describe("One or more musical genres for prompt-to-song generation. This cannot be used when lyrics is provided."),
6833
+ prompt: z
6834
+ .string()
6835
+ .min(1)
6836
+ .max(2000)
6837
+ .nullable()
6838
+ .optional()
6839
+ .describe("Describe the desired song, mood, instrumentation, and vocals. Required when lyrics is omitted; with lyrics, it acts as a music-style control."),
6840
+ gender: z
6841
+ .enum(["female", "male"])
6842
+ .nullable()
6843
+ .optional()
6844
+ .describe("Preferred vocal gender for lyrics-to-song generation. An uploaded or cloned voice takes precedence."),
6845
+ reference_id: z
6846
+ .string()
6847
+ .min(1)
6848
+ .nullable()
6849
+ .optional()
6850
+ .describe("Reference-music ID returned by /files/upload with purpose='reference'."),
6851
+ vocal_id: z
6852
+ .string()
6853
+ .min(1)
6854
+ .nullable()
6855
+ .optional()
6856
+ .describe("Voice ID returned by /voice/clone."),
6857
+ melody_id: z
6858
+ .string()
6859
+ .min(1)
6860
+ .nullable()
6861
+ .optional()
6862
+ .describe("Melody ID returned by /files/upload with purpose='melody'. This cannot be combined with prompt, reference_id, or vocal_id."),
6863
+ })
6864
+ .refine((p) => p.lyrics != null || p.prompt != null, {
6865
+ path: ["prompt"],
6866
+ message: "Prompt is required when lyrics is omitted.",
6867
+ })
6868
+ .refine((p) => p.lyrics == null || p.styles == null, {
6869
+ path: ["styles"],
6870
+ message: "Styles cannot be used when lyrics is provided.",
6871
+ })
6872
+ .refine((p) => p.melody_id == null ||
6873
+ (p.prompt == null && p.reference_id == null && p.vocal_id == null), {
6874
+ path: ["melody_id"],
6875
+ message: "Melody ID cannot be combined with prompt, reference_id, or vocal_id.",
6876
+ });
6877
+ // Live OpenAPI checked twice on 2026-10-15; no safety-checker input.
6878
+ export const FalMurekaApiGeneratePodcastRequestSchema = z.object({
6879
+ conversations: z
6880
+ .array(z.object({
6881
+ text: z
6882
+ .string()
6883
+ .min(1)
6884
+ .max(400)
6885
+ .describe("Text spoken in this conversation turn, up to 400 characters."),
6886
+ voice: z
6887
+ .enum(["Ethan", "Victoria", "Jake", "Luna", "Emma"])
6888
+ .describe("Built-in voice used for this conversation turn."),
6889
+ }))
6890
+ .min(1)
6891
+ .max(10)
6892
+ .describe("Ordered conversation turns used to generate the podcast audio."),
6893
+ });
6894
+ // Pinned to the live queue OpenAPI read on 2026-10-15
6895
+ // (sha256 1c5ec483eb4aa2e6efbd59994755d1afaea973d23cda42c6269f43cd0772253b). Field order follows x-fal-order-properties.
6896
+ // Docs: https://fal.ai/models/google/nano-banana-2.1/api
6897
+ export const FalNanoBanana2p1TextToImageRequestSchema = z.object({
6898
+ prompt: z
6899
+ .string()
6900
+ .min(3)
6901
+ .max(50000)
6902
+ .describe("The text prompt to generate an image from."),
6903
+ num_images: z
6904
+ .number()
6905
+ .int()
6906
+ .min(1)
6907
+ .max(4)
6908
+ .default(1)
6909
+ .describe("The number of images to generate."),
6910
+ seed: z
6911
+ .number()
6912
+ .int()
6913
+ .nullable()
6914
+ .optional()
6915
+ .describe("The seed for the random number generator."),
6916
+ aspect_ratio: z
6917
+ .enum([
6918
+ "auto",
6919
+ "21:9",
6920
+ "16:9",
6921
+ "3:2",
6922
+ "4:3",
6923
+ "5:4",
6924
+ "1:1",
6925
+ "4:5",
6926
+ "3:4",
6927
+ "2:3",
6928
+ "9:16",
6929
+ "4:1",
6930
+ "1:4",
6931
+ "8:1",
6932
+ "1:8",
6933
+ ])
6934
+ .nullable()
6935
+ .default("auto")
6936
+ .describe('The aspect ratio of the generated image. Supports extreme ratios: 4:1, 1:4, 8:1, 1:8. Use "auto" to let the model decide based on the prompt.'),
6937
+ output_format: z
6938
+ .enum(["jpeg", "png", "webp"])
6939
+ .default("png")
6940
+ .describe("The format of the generated image."),
6941
+ safety_tolerance: z
6942
+ .enum(["1", "2", "3", "4", "5", "6"])
6943
+ .default("4")
6944
+ .describe("The safety tolerance level for content moderation. 1 is the most strict (blocks most content), 6 is the least strict."),
6945
+ sync_mode: z
6946
+ .boolean()
6947
+ .default(false)
6948
+ .describe("If true, the media will be returned as a data URI and the output data won't be available in the request history."),
6949
+ system_prompt: z
6950
+ .string()
6951
+ .max(50000)
6952
+ .default("")
6953
+ .describe("Optional system instruction that steers the model's persona and output style across the request. Leave blank to omit."),
6954
+ resolution: z
6955
+ .enum(["1K", "2K", "4K"])
6956
+ .default("1K")
6957
+ .describe("The resolution of the image to generate."),
6958
+ limit_generations: z
6959
+ .boolean()
6960
+ .default(true)
6961
+ .describe("Experimental: limit each round of prompting to one generation. When true, instructions in the prompt about the number of images are disregarded and intermediate images are ignored. This may affect generation quality."),
6962
+ enable_web_search: z
6963
+ .boolean()
6964
+ .default(false)
6965
+ .describe("Let the model use the latest information from the web to generate the image."),
6966
+ thinking_level: z
6967
+ .enum(["minimal", "medium", "high"])
6968
+ .nullable()
6969
+ .default("medium")
6970
+ .describe("How much the model reasons before generating. Higher levels can improve complex compositions."),
6971
+ });
6972
+ // Pinned to the live queue OpenAPI read on 2026-10-15
6973
+ // (sha256 05484a53bb030d157a1f2afd93122309b94d686760de0cdb76359562a9a1c462). Field order follows x-fal-order-properties.
6974
+ // Docs: https://fal.ai/models/google/nano-banana-2.1/edit/api
6975
+ export const FalNanoBanana2p1EditRequestSchema = z
6976
+ .object({
6977
+ prompt: z
6978
+ .string()
6979
+ .min(3)
6980
+ .max(50000)
6981
+ .describe("The prompt for image editing."),
6982
+ num_images: z
6983
+ .number()
6984
+ .int()
6985
+ .min(1)
6986
+ .max(4)
6987
+ .default(1)
6988
+ .describe("The number of images to generate."),
6989
+ seed: z
6990
+ .number()
6991
+ .int()
6992
+ .nullable()
6993
+ .optional()
6994
+ .describe("The seed for the random number generator."),
6995
+ aspect_ratio: z
6996
+ .enum([
6997
+ "auto",
6998
+ "21:9",
6999
+ "16:9",
7000
+ "3:2",
7001
+ "4:3",
7002
+ "5:4",
7003
+ "1:1",
7004
+ "4:5",
7005
+ "3:4",
7006
+ "2:3",
7007
+ "9:16",
7008
+ "4:1",
7009
+ "1:4",
7010
+ "8:1",
7011
+ "1:8",
7012
+ ])
7013
+ .nullable()
7014
+ .default("auto")
7015
+ .describe('The aspect ratio of the generated image. Supports extreme ratios: 4:1, 1:4, 8:1, 1:8. Use "auto" to let the model decide based on the prompt.'),
7016
+ output_format: z
7017
+ .enum(["jpeg", "png", "webp"])
7018
+ .default("png")
7019
+ .describe("The format of the generated image."),
7020
+ safety_tolerance: z
7021
+ .enum(["1", "2", "3", "4", "5", "6"])
7022
+ .default("4")
7023
+ .describe("The safety tolerance level for content moderation. 1 is the most strict (blocks most content), 6 is the least strict."),
7024
+ sync_mode: z
7025
+ .boolean()
7026
+ .default(false)
7027
+ .describe("If true, the media will be returned as a data URI and the output data won't be available in the request history."),
7028
+ image_urls: z
7029
+ .array(z.string())
7030
+ .optional()
7031
+ .describe("The image URLs to edit. Optional when video_url or pdf_url is provided."),
7032
+ system_prompt: z
7033
+ .string()
7034
+ .max(50000)
7035
+ .default("")
7036
+ .describe("Optional system instruction that steers the model's persona and output style across the request. Leave blank to omit."),
7037
+ resolution: z
7038
+ .enum(["1K", "2K", "4K"])
7039
+ .default("1K")
7040
+ .describe("The resolution of the image to generate."),
7041
+ video_url: z
7042
+ .string()
7043
+ .nullable()
7044
+ .optional()
7045
+ .describe("Optional video context: an http(s)/data URL (max 15MB) or a YouTube URL."),
7046
+ pdf_url: z
7047
+ .string()
7048
+ .nullable()
7049
+ .optional()
7050
+ .describe("Optional PDF context: an http(s)/data URL (max 15MB)."),
7051
+ limit_generations: z
7052
+ .boolean()
7053
+ .default(true)
7054
+ .describe("Experimental: limit each round of prompting to one generation. When true, instructions in the prompt about the number of images are disregarded and intermediate images are ignored. This may affect generation quality."),
7055
+ enable_web_search: z
7056
+ .boolean()
7057
+ .default(false)
7058
+ .describe("Let the model use the latest information from the web to generate the image."),
7059
+ thinking_level: z
7060
+ .enum(["minimal", "medium", "high"])
7061
+ .nullable()
7062
+ .default("medium")
7063
+ .describe("How much the model reasons before generating. Higher levels can improve complex compositions."),
7064
+ })
7065
+ .refine((value) => Boolean(value.image_urls?.length || value.video_url || value.pdf_url), {
7066
+ message: "Provide image_urls, video_url, or pdf_url.",
7067
+ path: ["image_urls"],
7068
+ });
7069
+ // Pinned to the live queue OpenAPI read on 2026-10-15
7070
+ // (sha256 6d9c73eca933c4393df207f09673c106c7d141ee3c8f051ff1439ba18ba8acb8). Field order follows x-fal-order-properties.
7071
+ // Free 422 probes the same day confirmed image_url as the only required
7072
+ // field, the prompt, duration and resolution validators below, and that an
7073
+ // undocumented field is ignored, so the schema is not strict.
7074
+ // Docs: https://fal.ai/models/fal-ai/vidu/q4/image-to-video/api
7075
+ export const FalViduQ4ImageToVideoRequestSchema = z.object({
7076
+ prompt: z
7077
+ .string()
7078
+ .max(5000)
7079
+ .default("")
7080
+ .describe("Text prompt for video generation, max 5000 characters"),
7081
+ image_url: z
7082
+ .string()
7083
+ .describe("URL or base64 data URI of the image to use as the first frame. Supports png, jpeg, jpg and webp up to 50 MB."),
7084
+ duration: z
7085
+ .number()
7086
+ .int()
7087
+ .min(3)
7088
+ .max(16)
7089
+ .default(5)
7090
+ .describe("Duration of the video in seconds (3-16)"),
7091
+ seed: z
7092
+ .number()
7093
+ .int()
7094
+ .nullable()
7095
+ .optional()
7096
+ .describe("Random seed for reproducibility. A random seed is chosen when it is omitted or null."),
7097
+ resolution: z
7098
+ .enum(["540p", "720p", "1080p", "2K", "4K"])
7099
+ .default("720p")
7100
+ .describe("Output video resolution"),
7101
+ enable_safety_checker: z
7102
+ .boolean()
7103
+ .default(true)
7104
+ .describe("Authorized callers may set false to request relaxed screening."),
7105
+ });
7106
+ // Pinned to the live queue OpenAPI read on 2026-10-15
7107
+ // (sha256 6e7d7ffccca066c5971c586e7ee4da9d15c97987b694c90f4010ef50cab096d2). Field order follows x-fal-order-properties.
7108
+ // The OpenAPI states the reference limits only in its descriptions. Free 422
7109
+ // probes the same day showed the validator enforces both ("Maximum 12
7110
+ // reference images are allowed", "Maximum 3 reference audio clips are
7111
+ // allowed"), so they are restated as .max(). The probes also accepted a
7112
+ // prompt with no references and ignored an undocumented field, so neither
7113
+ // list is required and the schema is not strict.
7114
+ // Docs: https://fal.ai/models/fal-ai/vidu/q4/reference-to-video/api
7115
+ export const FalViduQ4ReferenceToVideoRequestSchema = z.object({
7116
+ prompt: z
7117
+ .string()
7118
+ .min(1)
7119
+ .max(5000)
7120
+ .describe("Text prompt for video generation, max 5000 characters. Refer to references by their position in the lists: [@reference_image_1], [@reference_image_2], ... for images and [reference_audio_1], [reference_audio_2], ... for audio clips."),
7121
+ reference_image_urls: z
7122
+ .array(z.string())
7123
+ .max(12)
7124
+ .optional()
7125
+ .describe("URLs or base64 data URIs of up to 12 reference images (png, jpeg, jpg, webp) used to keep subjects consistent."),
7126
+ reference_audio_urls: z
7127
+ .array(z.string())
7128
+ .max(3)
7129
+ .optional()
7130
+ .describe("URLs or base64 data URIs of up to 3 mp3 reference audio clips (3-12 seconds each, max 50 MB) used to keep voices consistent."),
7131
+ duration: z
7132
+ .number()
7133
+ .int()
7134
+ .min(3)
7135
+ .max(16)
7136
+ .default(5)
7137
+ .describe("Duration of the video in seconds (3-16)"),
7138
+ seed: z
7139
+ .number()
7140
+ .int()
7141
+ .nullable()
7142
+ .optional()
7143
+ .describe("Random seed for reproducibility. A random seed is chosen when it is omitted or null."),
7144
+ aspect_ratio: z
7145
+ .enum(["16:9", "9:16", "4:3", "3:4", "1:1"])
7146
+ .default("16:9")
7147
+ .describe("The aspect ratio of the output video"),
7148
+ resolution: z
7149
+ .enum(["540p", "720p", "1080p", "2K", "4K"])
7150
+ .default("720p")
7151
+ .describe("Output video resolution"),
7152
+ audio: z
7153
+ .boolean()
7154
+ .default(false)
7155
+ .describe("Whether to generate audio (dialogue and sound effects) with the video. When false, the output video is silent."),
7156
+ enable_safety_checker: z
7157
+ .boolean()
7158
+ .default(true)
7159
+ .describe("Authorized callers may set false to request relaxed screening."),
7160
+ });
7161
+ // Pinned to the live queue OpenAPI read on 2026-10-15
7162
+ // (sha256 64357740e7d598378b8e14a81afc273e34c1456f9a2da4974a758e9460eeff2e, the same JSON as the planning archive). Field order follows x-fal-order-properties.
7163
+ // additionalProperties is false, and a free 422 probe the same day refused an
7164
+ // undocumented field (extra_forbidden), so the schema is strict, like recast.
7165
+ // Docs: https://fal.ai/models/minimax/h3-max/relight/api
7166
+ export const FalMinimaxH3MaxRelightRequestSchema = z
7167
+ .object({
7168
+ video_url: z
7169
+ .string()
7170
+ .min(1)
7171
+ .describe("Source video up to 15 seconds long. Converted to constant 24 fps and trimmed at the end to the closest 17n+5 frame count, with at least 56 frames (about 2.33 seconds) remaining. The output matches this prepared video's frame count and duration."),
7172
+ reference_image_url: z
7173
+ .string()
7174
+ .min(1)
7175
+ .describe("Sphere render showing the target lighting."),
7176
+ resolution: z
7177
+ .enum(["480P", "768P", "1080P", "2K"])
7178
+ .default("768P")
7179
+ .describe("Output video resolution. 480P and 768P generate natively; 1080P and 2K (1440p) use latent upscaling and refinement from 768P."),
7180
+ aspect_ratio: z
7181
+ .enum(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
7182
+ .default("16:9")
7183
+ .describe("Output video aspect ratio."),
7184
+ seed: z
7185
+ .number()
7186
+ .int()
7187
+ .nullable()
7188
+ .optional()
7189
+ .describe("Random seed for video generation."),
7190
+ enable_safety_checker: z
7191
+ .boolean()
7192
+ .default(true)
7193
+ .describe("Enable safety checking."),
7194
+ sync_mode: z
7195
+ .boolean()
7196
+ .default(false)
7197
+ .describe("Return video as a data URI."),
7198
+ })
7199
+ .strict();
7200
+ // Pinned to the live queue OpenAPI read on 2026-10-15
7201
+ // (sha256 72a97fab0452ca5c7f76a61db3139abb0b99227dda754d218f9d015c7ca1bab5). Field order follows x-fal-order-properties.
7202
+ // Free 422 probes the same day confirmed video_url as the only required field,
7203
+ // the upscale_factor set ("must be one of [2.0, 2.25, 4.0]") and the step
7204
+ // bounds, and showed an undocumented field is ignored, so the schema is not
7205
+ // strict. The multiple-of-16 rule for 2x and 4x is a model-level check that a
7206
+ // free probe cannot reach, so it stays in the description.
7207
+ // Docs: https://fal.ai/models/fal-ai/kandinsky6-vsr/api
7208
+ export const FalKandinsky6VsrRequestSchema = z.object({
7209
+ video_url: z
7210
+ .string()
7211
+ .describe("The input video to upscale. Clips are resampled to 24fps and capped at 121 frames (~5s). For 2x and 4x upscaling, width and height must be multiples of 16."),
7212
+ upscale_factor: z
7213
+ .union([z.literal(2), z.literal(2.25), z.literal(4)])
7214
+ .default(2.25)
7215
+ .describe("Total upscale factor applied to the input resolution. One of 2, 2.25 or 4."),
7216
+ num_inference_steps: z
7217
+ .number()
7218
+ .int()
7219
+ .min(2)
7220
+ .max(50)
7221
+ .default(5)
7222
+ .describe("The number of denoising steps used for each tile."),
7223
+ seed: z
7224
+ .number()
7225
+ .int()
7226
+ .nullable()
7227
+ .optional()
7228
+ .describe("The random seed used for the generation process."),
7229
+ sync_mode: z
7230
+ .boolean()
7231
+ .default(false)
7232
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7233
+ enable_safety_checker: z
7234
+ .boolean()
7235
+ .default(true)
7236
+ .describe("Authorized callers may set false to request relaxed screening."),
7237
+ });
7238
+ // Kandinsky 6.0 VSR Lite: live OpenAPI 2026-10-15.
7239
+ // OpenAPI defaults to 5 steps; the pricing card says 2. Preserve the API contract.
7240
+ // Docs: https://fal.ai/models/fal-ai/kandinsky6-vsr/lite/api
7241
+ export const FalKandinsky6VsrLiteRequestSchema = z.object({
7242
+ video_url: z
7243
+ .string()
7244
+ .describe("The input video to upscale. Clips are resampled to 24fps and capped at 121 frames (~5s). For 2x and 4x upscaling, width and height must be multiples of 16."),
7245
+ upscale_factor: z
7246
+ .union([z.literal(2), z.literal(2.25), z.literal(4)])
7247
+ .default(2.25)
7248
+ .describe("Total upscale factor applied to the input resolution. One of 2, 2.25 or 4."),
7249
+ num_inference_steps: z
7250
+ .number()
7251
+ .int()
7252
+ .min(2)
7253
+ .max(50)
7254
+ .default(5)
7255
+ .describe("The number of denoising steps used for each tile."),
7256
+ seed: z
7257
+ .number()
7258
+ .int()
7259
+ .nullable()
7260
+ .optional()
7261
+ .describe("The random seed used for the generation process."),
7262
+ sync_mode: z
7263
+ .boolean()
7264
+ .default(false)
7265
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7266
+ enable_safety_checker: z
7267
+ .boolean()
7268
+ .default(true)
7269
+ .describe("Authorized callers may set false to request relaxed screening."),
7270
+ });
7271
+ // Kandinsky 6.0 Lite text-to-video: live OpenAPI 2026-10-15.
7272
+ // Docs: https://fal.ai/models/fal-ai/kandinsky6-lite/text-to-video/api
7273
+ export const FalKandinsky6LiteTextToVideoRequestSchema = z.object({
7274
+ prompt: z
7275
+ .string()
7276
+ .describe("The text prompt describing the video and its sound."),
7277
+ aspect_ratio: z
7278
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4"])
7279
+ .default("16:9")
7280
+ .describe("The aspect ratio of the generated video."),
7281
+ generate_audio: z
7282
+ .boolean()
7283
+ .default(true)
7284
+ .describe("Whether to generate a synchronized audio track."),
7285
+ enable_prompt_expansion: z
7286
+ .boolean()
7287
+ .default(false)
7288
+ .describe("Whether to rewrite the prompt into a detailed video+audio description with the model's own Qwen2.5-VL text encoder before generating."),
7289
+ upscale_factor: z
7290
+ .union([z.literal(2), z.literal(2.25), z.literal(4)])
7291
+ .nullable()
7292
+ .optional()
7293
+ .describe("If set, upscale the generated video by this factor with Kandinsky 6 video super-resolution. One of 2, 2.25 or 4; 2.25 turns the 480p output into 1080p."),
7294
+ seed: z
7295
+ .number()
7296
+ .int()
7297
+ .nullable()
7298
+ .optional()
7299
+ .describe("The random seed used for the generation process."),
7300
+ sync_mode: z
7301
+ .boolean()
7302
+ .default(false)
7303
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7304
+ num_inference_steps: z
7305
+ .number()
7306
+ .int()
7307
+ .min(4)
7308
+ .max(16)
7309
+ .default(10)
7310
+ .describe("The number of denoising steps. Lite is tuned for 10."),
7311
+ enable_safety_checker: z
7312
+ .boolean()
7313
+ .default(true)
7314
+ .describe("Authorized callers may set false to request relaxed screening."),
7315
+ });
7316
+ // Kandinsky 6.0 Lite image-to-video: live OpenAPI 2026-10-15.
7317
+ // Docs: https://fal.ai/models/fal-ai/kandinsky6-lite/image-to-video/api
7318
+ export const FalKandinsky6LiteImageToVideoRequestSchema = z.object({
7319
+ prompt: z
7320
+ .string()
7321
+ .describe("The text prompt describing the video and its sound."),
7322
+ image_url: z
7323
+ .string()
7324
+ .describe("The image used as the first frame of the video."),
7325
+ aspect_ratio: z
7326
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4", "auto"])
7327
+ .default("auto")
7328
+ .describe("The aspect ratio of the generated video. `auto` picks the supported ratio closest to the image's; the image is center-cropped to it."),
7329
+ generate_audio: z
7330
+ .boolean()
7331
+ .default(true)
7332
+ .describe("Whether to generate a synchronized audio track."),
7333
+ enable_prompt_expansion: z
7334
+ .boolean()
7335
+ .default(false)
7336
+ .describe("Whether to rewrite the prompt into a detailed video+audio description with the model's own Qwen2.5-VL text encoder before generating."),
7337
+ upscale_factor: z
7338
+ .union([z.literal(2), z.literal(2.25), z.literal(4)])
7339
+ .nullable()
7340
+ .optional()
7341
+ .describe("If set, upscale the generated video by this factor with Kandinsky 6 video super-resolution. One of 2, 2.25 or 4; 2.25 turns the 480p output into 1080p."),
7342
+ seed: z
7343
+ .number()
7344
+ .int()
7345
+ .nullable()
7346
+ .optional()
7347
+ .describe("The random seed used for the generation process."),
7348
+ sync_mode: z
7349
+ .boolean()
7350
+ .default(false)
7351
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7352
+ num_inference_steps: z
7353
+ .number()
7354
+ .int()
7355
+ .min(4)
7356
+ .max(16)
7357
+ .default(10)
7358
+ .describe("The number of denoising steps. Lite is tuned for 10."),
7359
+ enable_safety_checker: z
7360
+ .boolean()
7361
+ .default(true)
7362
+ .describe("Authorized callers may set false to request relaxed screening."),
7363
+ });
7364
+ // Kandinsky 6.0 Pro text-to-video: live OpenAPI 2026-10-15.
7365
+ // Docs: https://fal.ai/models/fal-ai/kandinsky6-pro/text-to-video/api
7366
+ export const FalKandinsky6ProTextToVideoRequestSchema = z.object({
7367
+ prompt: z
7368
+ .string()
7369
+ .describe("The text prompt describing the video and its sound."),
7370
+ negative_prompt: z
7371
+ .string()
7372
+ .nullable()
7373
+ .optional()
7374
+ .describe("What to avoid in the video. Defaults to the model's built-in negative prompt."),
7375
+ aspect_ratio: z
7376
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4"])
7377
+ .default("16:9")
7378
+ .describe("The aspect ratio of the generated video."),
7379
+ generate_audio: z
7380
+ .boolean()
7381
+ .default(true)
7382
+ .describe("Whether to generate a synchronized audio track."),
7383
+ enable_prompt_expansion: z
7384
+ .boolean()
7385
+ .default(false)
7386
+ .describe("Whether to rewrite the prompt into a detailed video+audio description with the model's own Qwen2.5-VL text encoder before generating."),
7387
+ upscale_factor: z
7388
+ .union([z.literal(2), z.literal(2.25), z.literal(4)])
7389
+ .nullable()
7390
+ .optional()
7391
+ .describe("If set, upscale the generated video by this factor with Kandinsky 6 video super-resolution. One of 2, 2.25 or 4; 2.25 turns the 480p output into 1080p."),
7392
+ seed: z
7393
+ .number()
7394
+ .int()
7395
+ .nullable()
7396
+ .optional()
7397
+ .describe("The random seed used for the generation process."),
7398
+ sync_mode: z
7399
+ .boolean()
7400
+ .default(false)
7401
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7402
+ num_inference_steps: z
7403
+ .number()
7404
+ .int()
7405
+ .min(8)
7406
+ .max(50)
7407
+ .default(50)
7408
+ .describe("The number of denoising steps."),
7409
+ guidance_scale: z
7410
+ .number()
7411
+ .min(1)
7412
+ .max(10)
7413
+ .default(5)
7414
+ .describe("Classifier-free guidance strength."),
7415
+ enable_safety_checker: z
7416
+ .boolean()
7417
+ .default(true)
7418
+ .describe("Authorized callers may set false to request relaxed screening."),
7419
+ });
7420
+ // Kandinsky 6.0 Pro image-to-video: live OpenAPI 2026-10-15.
7421
+ // Docs: https://fal.ai/models/fal-ai/kandinsky6-pro/image-to-video/api
7422
+ export const FalKandinsky6ProImageToVideoRequestSchema = z.object({
7423
+ prompt: z
7424
+ .string()
7425
+ .describe("The text prompt describing the video and its sound."),
7426
+ image_url: z
7427
+ .string()
7428
+ .describe("The image used as the first frame of the video."),
7429
+ negative_prompt: z
7430
+ .string()
7431
+ .nullable()
7432
+ .optional()
7433
+ .describe("What to avoid in the video. Defaults to the model's built-in negative prompt."),
7434
+ aspect_ratio: z
7435
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4", "auto"])
7436
+ .default("auto")
7437
+ .describe("The aspect ratio of the generated video. `auto` picks the supported ratio closest to the image's; the image is center-cropped to it."),
7438
+ generate_audio: z
7439
+ .boolean()
7440
+ .default(true)
7441
+ .describe("Whether to generate a synchronized audio track."),
7442
+ enable_prompt_expansion: z
7443
+ .boolean()
7444
+ .default(false)
7445
+ .describe("Whether to rewrite the prompt into a detailed video+audio description with the model's own Qwen2.5-VL text encoder before generating."),
7446
+ upscale_factor: z
7447
+ .union([z.literal(2), z.literal(2.25), z.literal(4)])
7448
+ .nullable()
7449
+ .optional()
7450
+ .describe("If set, upscale the generated video by this factor with Kandinsky 6 video super-resolution. One of 2, 2.25 or 4; 2.25 turns the 480p output into 1080p."),
7451
+ seed: z
7452
+ .number()
7453
+ .int()
7454
+ .nullable()
7455
+ .optional()
7456
+ .describe("The random seed used for the generation process."),
7457
+ sync_mode: z
7458
+ .boolean()
7459
+ .default(false)
7460
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7461
+ num_inference_steps: z
7462
+ .number()
7463
+ .int()
7464
+ .min(8)
7465
+ .max(50)
7466
+ .default(50)
7467
+ .describe("The number of denoising steps."),
7468
+ guidance_scale: z
7469
+ .number()
7470
+ .min(1)
7471
+ .max(10)
7472
+ .default(5)
7473
+ .describe("Classifier-free guidance strength."),
7474
+ enable_safety_checker: z
7475
+ .boolean()
7476
+ .default(true)
7477
+ .describe("Authorized callers may set false to request relaxed screening."),
7478
+ });
7479
+ // The ImageSize component publishes only 0 < side <= 14142. The field's x-fal
7480
+ // hints (sides from 256 to 2560 in multiples of 16, at most 4194304 pixels)
7481
+ // all passed fal's validator in free 422 probes (2026-10-15), so they stay in
7482
+ // the description rather than in the schema.
7483
+ const FalFlux2FlexImageSizeSchema = z.object({
7484
+ width: z
7485
+ .number()
7486
+ .int()
7487
+ .gt(0)
7488
+ .max(14142)
7489
+ .default(512)
7490
+ .describe("The width of the generated image."),
7491
+ height: z
7492
+ .number()
7493
+ .int()
7494
+ .gt(0)
7495
+ .max(14142)
7496
+ .default(512)
7497
+ .describe("The height of the generated image."),
7498
+ });
7499
+ // FLUX.2 Flex text-to-image: live OpenAPI 2026-10-15.
7500
+ // Docs: https://fal.ai/models/fal-ai/flux-2-flex/api
7501
+ export const FalFlux2FlexRequestSchema = z.object({
7502
+ prompt: z.string().describe("The prompt to generate an image from."),
7503
+ image_size: z
7504
+ .union([
7505
+ FalFlux2FlexImageSizeSchema,
7506
+ z.enum([
7507
+ "square_hd",
7508
+ "square",
7509
+ "portrait_4_3",
7510
+ "portrait_16_9",
7511
+ "landscape_4_3",
7512
+ "landscape_16_9",
7513
+ ]),
7514
+ ])
7515
+ .default("landscape_4_3")
7516
+ .describe("The size of the generated image. fal publishes these limits for an explicit size: each side from 256 to 2560 pixels in multiples of 16, and at most 4194304 pixels in total."),
7517
+ seed: z
7518
+ .number()
7519
+ .int()
7520
+ .nullable()
7521
+ .optional()
7522
+ .describe("The seed to use for the generation."),
7523
+ safety_tolerance: z
7524
+ .enum(["1", "2", "3", "4", "5"])
7525
+ .default("2")
7526
+ .describe("The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive."),
7527
+ enable_safety_checker: z
7528
+ .boolean()
7529
+ .default(true)
7530
+ .describe("Whether to enable the safety checker. Disabling it requires account authorization; unauthorized requests are always checked."),
7531
+ output_format: z
7532
+ .enum(["jpeg", "png"])
7533
+ .default("jpeg")
7534
+ .describe("The format of the generated image."),
7535
+ sync_mode: z
7536
+ .boolean()
7537
+ .default(false)
7538
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
7539
+ guidance_scale: z
7540
+ .number()
7541
+ .min(1.5)
7542
+ .max(10)
7543
+ .default(3.5)
7544
+ .describe("The guidance scale to use for the generation."),
7545
+ num_inference_steps: z
7546
+ .number()
7547
+ .int()
7548
+ .min(2)
7549
+ .max(50)
7550
+ .default(28)
7551
+ .describe("The number of inference steps to perform."),
7552
+ });
7553
+ // Upstream refuses image_url and end_image_url unless each is "a valid HTTPS
7554
+ // URL or a Data URI" (unbilled 422 probes, 2026-10-15). An empty string, a
7555
+ // bare https://, an ftp: URL, a relative path and the upper-case HTTPS: and
7556
+ // DATA: schemes were refused; a lower-case http: URL, any data: URI (even
7557
+ // text/plain) and a leading space passed. The pattern restates what passed.
7558
+ const FalKlingVideoO3StandardImageToVideoImageUrlSchema = z
7559
+ .string()
7560
+ .regex(/^\s*(?:https?:\/\/[^\s/?#]+|data:)/, "Input must be a valid HTTPS URL or a Data URI");
7561
+ const FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema = z.object({
7562
+ prompt: z.string().describe("The prompt for this shot."),
7563
+ duration: z
7564
+ .enum([
7565
+ "1",
7566
+ "2",
7567
+ "3",
7568
+ "4",
7569
+ "5",
7570
+ "6",
7571
+ "7",
7572
+ "8",
7573
+ "9",
7574
+ "10",
7575
+ "11",
7576
+ "12",
7577
+ "13",
7578
+ "14",
7579
+ "15",
7580
+ ])
7581
+ .default("5")
7582
+ .describe("The duration of this shot in seconds"),
7583
+ });
7584
+ // Kling O3 Standard image-to-video: live OpenAPI 2026-10-15. Field order
7585
+ // follows x-fal-order-properties. The prompt-or-multi_prompt rule comes from
7586
+ // the prompt description; a guarded 422 probe cannot reach it.
7587
+ // Docs: https://fal.ai/models/fal-ai/kling-video/o3/standard/image-to-video/api
7588
+ export const FalKlingVideoO3StandardImageToVideoRequestSchema = z
7589
+ .object({
7590
+ enable_safety_checker: z
7591
+ .boolean()
7592
+ .default(true)
7593
+ .describe("Disabling safety checks requires account authorization; unauthorized requests are always checked."),
7594
+ prompt: z
7595
+ .string()
7596
+ .max(2500)
7597
+ .nullable()
7598
+ .optional()
7599
+ .describe("Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both."),
7600
+ image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.describe("URL of the start frame image. At most 50 MB, at least 300 px per side, with an aspect ratio from 0.4 to 2.5."),
7601
+ end_image_url: FalKlingVideoO3StandardImageToVideoImageUrlSchema.nullable()
7602
+ .optional()
7603
+ .describe("URL of the end frame image (optional). At most 50 MB, at least 300 px per side, with an aspect ratio from 0.4 to 2.5."),
7604
+ duration: z
7605
+ .enum([
7606
+ "3",
7607
+ "4",
7608
+ "5",
7609
+ "6",
7610
+ "7",
7611
+ "8",
7612
+ "9",
7613
+ "10",
7614
+ "11",
7615
+ "12",
7616
+ "13",
7617
+ "14",
7618
+ "15",
7619
+ ])
7620
+ .default("5")
7621
+ .describe("Video duration in seconds (3-15s)."),
7622
+ generate_audio: z
7623
+ .boolean()
7624
+ .default(false)
7625
+ .describe("Whether to generate native audio for the video."),
7626
+ multi_prompt: z
7627
+ .array(FalKlingVideoO3StandardImageToVideoKlingV3MultiPromptElementSchema)
7628
+ .nullable()
7629
+ .optional()
7630
+ .describe("List of prompts for multi-shot video generation."),
7631
+ shot_type: z
7632
+ .enum(["customize", "intelligent"])
7633
+ .default("customize")
7634
+ .describe("The type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure."),
7635
+ })
7636
+ .refine((v) => v.prompt != null || v.multi_prompt != null, {
7637
+ message: "fal-ai/kling-video/o3/standard/image-to-video needs prompt or multi_prompt",
7638
+ path: ["prompt"],
7639
+ })
7640
+ .refine((v) => !(v.prompt != null && v.multi_prompt != null), {
7641
+ message: "fal-ai/kling-video/o3/standard/image-to-video multi_prompt and prompt are mutually exclusive",
7642
+ path: ["prompt"],
7643
+ });
7644
+ // VEED Clean Audio
7645
+ export const FalVeedCleanAudioRequestSchema = z.object({
7646
+ audio_url: z
7647
+ .string()
7648
+ .describe("The recording to clean. Any audio or video ffmpeg can decode (wav, mp3, m4a, aac, ogg, mp4, mov, webm, ...); a video's audio track is used (call /video to get the video back with the cleaned track) and multi-channel input is mixed down to mono. Up to 30 minutes and 512 MB. A public URL or a data URI."),
7649
+ strength: z
7650
+ .number()
7651
+ .min(0)
7652
+ .max(1)
7653
+ .default(0.874)
7654
+ .describe("How much of the original is allowed to remain under speech: the suppression floor is 1 - strength (the default 0.874 is the validated -18 dB). Lower keeps more room tone behind the voice; silence between words is always fully cleaned."),
7655
+ target_lufs: z
7656
+ .number()
7657
+ .min(-40)
7658
+ .max(-8)
7659
+ .nullable()
7660
+ .default(-19)
7661
+ .describe("Integrated loudness of the output (ITU-R BS.1770). The default -19 LUFS is the level the VEED editor delivers; true peak is capped at -1.1 dBTP. Pass null through the API to skip loudness normalization and keep the input level."),
7662
+ output_format: z
7663
+ .enum(["flac", "wav"])
7664
+ .default("flac")
7665
+ .describe("Container for the 48 kHz mono 16-bit output. FLAC is lossless at about half the size of WAV."),
7666
+ });
7667
+ // Creatify Boreal
7668
+ export const FalCreatifyBorealRequestSchema = z.object({
7669
+ prompt: z
7670
+ .string()
7671
+ .min(1)
7672
+ .max(5000)
7673
+ .describe("Direction for the visuals, spoken dialogue, sounds, and on-screen text. Structure it with `[VISUAL]`, `[SPEECH]`, `[SOUNDS]`, and `[TEXT]` sections for best results. English is the validated language."),
7674
+ image_url: z
7675
+ .string()
7676
+ .nullable()
7677
+ .optional()
7678
+ .describe("Optional reference image to animate. Guides identity, composition, and appearance; the output follows this image's aspect ratio."),
7679
+ audio_url: z
7680
+ .string()
7681
+ .nullable()
7682
+ .optional()
7683
+ .describe("Optional driving audio (narration, dialogue, or a soundtrack). When provided it is preserved in the output instead of generated speech."),
7684
+ negative_prompt: z
7685
+ .string()
7686
+ .default("")
7687
+ .describe("Content or artifacts to avoid in the generated video."),
7688
+ resolution: z
7689
+ .enum(["720p", "1080p", "2k"])
7690
+ .default("720p")
7691
+ .describe("Delivery tier. `2k` is 2016 px on the long edge for 16:9 and 9:16, and the 1440p row for 1:1, 4:3 and 3:4."),
7692
+ aspect_ratio: z
7693
+ .enum(["auto", "16:9", "9:16", "1:1", "4:3", "3:4"])
7694
+ .default("auto")
7695
+ .describe("Frame ratio. `auto` follows the reference image's own ratio, and is landscape (16:9) when there is no image. A named ratio renders that ratio; with an image it centre-crops the image to it."),
7696
+ duration: z
7697
+ .number()
7698
+ .min(1)
7699
+ .max(20)
7700
+ .default(10)
7701
+ .describe("Length of the generated video in seconds at 24 FPS, rounded by the model to the nearest legal frame count (5 s -> 121 frames, 10 s -> 241, 15 s -> 361). With `audio_url`, the first `duration` seconds of the audio are used; shorter audio is padded with silence."),
7702
+ manifest_disclosure: z
7703
+ .boolean()
7704
+ .default(false)
7705
+ .describe("Add a visible `AI-generated` disclosure label to the video. Invisible C2PA metadata and watermarking are always applied."),
7706
+ enable_safety_checker: z
7707
+ .boolean()
7708
+ .default(true)
7709
+ .describe("Authorized callers may set false to request relaxed screening."),
7710
+ });
7711
+ // OpenRouter Decisions model IDs retain their vendor/name grammar.
7712
+ const FalOpenrouterDecisionsModelAliasSchema = z
7713
+ .string()
7714
+ .regex(/^[a-z0-9]+(?:[.-][a-z0-9]+)*\/[a-z0-9]+(?:[._:-][a-z0-9]+)*$/);
7715
+ export const FalOpenrouterRouterDecisionsRequestSchema = z
7716
+ .object({
7717
+ state: z
7718
+ .union([
7719
+ z.string(),
7720
+ z.record(z.string(), z.unknown()),
7721
+ z.array(z.unknown()),
7722
+ ])
7723
+ .describe("Text, structured JSON, or an array mixing text strings with OpenRouter media parts: image_url, input_audio, and video_url. Images and videos use base64 data URLs; input_audio uses raw base64 data and a format. Media support and limits depend on the selected Decisions model. See https://openrouter.ai/docs/guides/community/multimodal-decisions."),
7724
+ image_urls: z
7725
+ .union([z.array(z.string()), z.null()])
7726
+ .describe("Optional image URLs or base64 image data URLs appended to state. Public images are downloaded and encoded inline for OpenRouter. Inline images are limited to 16 MiB per image. Up to 128 convenience images and 32 MiB of total encoded image data (including data URL metadata) are allowed per request. The selected Decisions model must support images.")
7727
+ .optional(),
7728
+ questions: z
7729
+ .record(z.string(), z.discriminatedUnion("type", [
7730
+ z.object({
7731
+ type: z.literal("noul"),
7732
+ instructions: z
7733
+ .union([
7734
+ z.string(),
7735
+ z.record(z.string(), z.unknown()),
7736
+ z.array(z.unknown()),
7737
+ ])
7738
+ .describe("The yes/no question, as text or structured multimodal content."),
7739
+ criteria: z
7740
+ .union([
7741
+ z.object({
7742
+ true: z
7743
+ .union([
7744
+ z.string(),
7745
+ z.record(z.string(), z.unknown()),
7746
+ z.array(z.unknown()),
7747
+ ])
7748
+ .describe("What should count as a yes/true outcome."),
7749
+ false: z
7750
+ .union([
7751
+ z.string(),
7752
+ z.record(z.string(), z.unknown()),
7753
+ z.array(z.unknown()),
7754
+ ])
7755
+ .describe("What should count as a no/false outcome."),
7756
+ }),
7757
+ z.null(),
7758
+ ])
7759
+ .describe("Optional descriptions clarifying true and false outcomes.")
7760
+ .optional(),
7761
+ }),
7762
+ z.object({
7763
+ type: z.literal("choice"),
7764
+ instructions: z
7765
+ .union([
7766
+ z.string(),
7767
+ z.record(z.string(), z.unknown()),
7768
+ z.array(z.unknown()),
7769
+ ])
7770
+ .describe("The question, as text or structured multimodal content."),
7771
+ criteria: z
7772
+ .record(z.string(), z.union([
7773
+ z.string(),
7774
+ z.record(z.string(), z.unknown()),
7775
+ z.array(z.unknown()),
7776
+ z.null(),
7777
+ ]))
7778
+ .refine((value) => Object.keys(value).length >= 2, {
7779
+ message: "Must contain at least 2 entries",
7780
+ })
7781
+ .refine((value) => Object.keys(value).length <= 255, {
7782
+ message: "Must contain at most 255 entries",
7783
+ })
7784
+ .describe("Answer options mapped to descriptions of each option."),
7785
+ }),
7786
+ z.object({
7787
+ type: z.literal("score"),
7788
+ instructions: z
7789
+ .union([
7790
+ z.string(),
7791
+ z.record(z.string(), z.unknown()),
7792
+ z.array(z.unknown()),
7793
+ ])
7794
+ .describe("The property to score, as text or structured multimodal content."),
7795
+ criteria: z
7796
+ .array(z.union([
7797
+ z.string(),
7798
+ z.record(z.string(), z.unknown()),
7799
+ z.array(z.unknown()),
7800
+ ]))
7801
+ .min(2)
7802
+ .max(10)
7803
+ .describe("Ordered level descriptions, from the low end to the high end."),
7804
+ }),
7805
+ ]))
7806
+ .refine((value) => Object.keys(value).length >= 1, {
7807
+ message: "Must contain at least 1 entries",
7808
+ })
7809
+ .describe("Questions keyed by caller-defined IDs. Each question is evaluated independently against the same state."),
7810
+ model: z
7811
+ .enum(["typesafe/jev-1.13"])
7812
+ .or(FalOpenrouterDecisionsModelAliasSchema)
7813
+ .default("typesafe/jev-1.13")
7814
+ .describe("Any OpenRouter Decisions model ID or alias. Choose a model that supports the supplied input modalities."),
7815
+ session_id: z
7816
+ .union([z.string().max(256), z.null()])
7817
+ .describe("Identifier for grouping related decision requests.")
7818
+ .optional(),
7819
+ enable_safety_checker: z
7820
+ .boolean()
7821
+ .default(true)
7822
+ .describe("Authorized callers may set false to request relaxed screening."),
7823
+ })
7824
+ .strict();
7825
+ // One SO-101 joint row: shoulder pan, shoulder lift, elbow flex, wrist flex,
7826
+ // wrist roll (degrees) and gripper (percent).
7827
+ const FalFlux3ActionSo101JointRowSchema = z.array(z.number()).min(6).max(6);
7828
+ // FLUX 3 Action SO-101 robot action: live OpenAPI 2026-10-16.
7829
+ // Docs: https://fal.ai/models/fal-ai/flux-3-action/so101/api
7830
+ // Free 422 probes (2026-10-16) returned three pairing rules as field errors,
7831
+ // beyond the OpenAPI's "Requires" notes: the two histories come together, the
7832
+ // two history frames come together, and the frames need both histories.
7833
+ export const FalFlux3ActionSo101RequestSchema = z
7834
+ .object({
7835
+ prompt: z
7836
+ .string()
7837
+ .min(1)
7838
+ .max(2000)
7839
+ .describe("Natural-language task instruction for the robot."),
7840
+ scene_image_url: z
7841
+ .string()
7842
+ .describe("Current frame from the fixed scene camera (tiled left). Resized to 256x256."),
7843
+ wrist_image_url: z
7844
+ .string()
7845
+ .describe("Current frame from the wrist camera (tiled right). Resized to 256x256."),
7846
+ state: FalFlux3ActionSo101JointRowSchema.describe("Measured state: shoulder pan, shoulder lift, elbow flex, wrist flex, wrist roll (degrees), gripper (percent)."),
7847
+ state_history: z
7848
+ .array(FalFlux3ActionSo101JointRowSchema)
7849
+ .min(7)
7850
+ .max(7)
7851
+ .nullable()
7852
+ .optional()
7853
+ .describe("Measured states at the 7 control ticks (30 Hz) before `state`, oldest first. Requires `command_history`. Omit for a fresh episode."),
7854
+ command_history: z
7855
+ .array(FalFlux3ActionSo101JointRowSchema)
7856
+ .min(8)
7857
+ .max(8)
7858
+ .nullable()
7859
+ .optional()
7860
+ .describe("Absolute commands in effect at each of the 8 observation ticks, oldest first; the last row is the most recent command sent. Requires `state_history`."),
7861
+ history_scene_image_url: z
7862
+ .string()
7863
+ .nullable()
7864
+ .optional()
7865
+ .describe("Scene frame from the oldest history tick (7 ticks before now). Requires `state_history`. Defaults to the current frame."),
7866
+ history_wrist_image_url: z
7867
+ .string()
7868
+ .nullable()
7869
+ .optional()
7870
+ .describe("Wrist frame from the oldest history tick. Requires `state_history`."),
7871
+ num_inference_steps: z
7872
+ .number()
7873
+ .int()
7874
+ .min(1)
7875
+ .max(8)
7876
+ .default(4)
7877
+ .describe("Euler denoising steps. The checkpoint was validated at 4."),
7878
+ guidance_scale: z
7879
+ .number()
7880
+ .min(1)
7881
+ .max(10)
7882
+ .default(3)
7883
+ .describe("Classifier-free guidance on video and action; 1.0 disables CFG."),
7884
+ seed: z
7885
+ .number()
7886
+ .int()
7887
+ .nullable()
7888
+ .optional()
7889
+ .describe("Sampling seed. Omit for a random seed; the reference evaluation seed is 0 for DROID and 42 for SO-101."),
7890
+ })
7891
+ .refine((v) => (v.state_history == null) === (v.command_history == null), {
7892
+ message: "state_history and command_history must be provided together",
7893
+ path: ["command_history"],
7894
+ })
7895
+ .refine((v) => (v.history_scene_image_url == null) ===
7896
+ (v.history_wrist_image_url == null), {
7897
+ message: "history_scene_image_url and history_wrist_image_url must be provided together",
7898
+ path: ["history_wrist_image_url"],
7899
+ })
7900
+ .refine((v) => (v.history_scene_image_url == null &&
7901
+ v.history_wrist_image_url == null) ||
7902
+ (v.state_history != null && v.command_history != null), {
7903
+ message: "history images require state_history and command_history",
7904
+ path: ["history_wrist_image_url"],
7905
+ });
7906
+ // Grok Voice one-shot speech reply and its typed server-side tools.
7907
+ const FalXaiGrokSearchLocationSchema = z
7908
+ .object({
7909
+ timezone: z
7910
+ .string()
7911
+ .min(1)
7912
+ .max(128)
7913
+ .nullable()
7914
+ .describe("IANA timezone name, for example America/New_York.")
7915
+ .default(null),
7916
+ city: z
7917
+ .string()
7918
+ .min(1)
7919
+ .max(128)
7920
+ .nullable()
7921
+ .describe("City used to localize web-search results.")
7922
+ .default(null),
7923
+ country: z
7924
+ .string()
7925
+ .min(1)
7926
+ .max(128)
7927
+ .nullable()
7928
+ .describe("Country used to localize web-search results.")
7929
+ .default(null),
7930
+ region: z
7931
+ .string()
7932
+ .min(1)
7933
+ .max(128)
7934
+ .nullable()
7935
+ .describe("Region used to localize web-search results.")
7936
+ .default(null),
7937
+ })
7938
+ .strict();
7939
+ const FalXaiGrokWebSearchToolSchema = z
7940
+ .object({
7941
+ allowed_domains: z
7942
+ .array(z
7943
+ .string()
7944
+ .regex(/^[^:/]+$/, "Domains must contain a hostname only, without protocol or path."))
7945
+ .min(1)
7946
+ .max(5)
7947
+ .nullable()
7948
+ .describe("Restrict results to at most five domains, without protocol or path.")
7949
+ .default(null),
7950
+ excluded_domains: z
7951
+ .array(z
7952
+ .string()
7953
+ .regex(/^[^:/]+$/, "Domains must contain a hostname only, without protocol or path."))
7954
+ .min(1)
7955
+ .max(5)
7956
+ .nullable()
7957
+ .describe("Exclude results from at most five domains, without protocol or path.")
7958
+ .default(null),
7959
+ enabled: z
7960
+ .boolean()
7961
+ .describe("Whether to include web_search in session.tools. Disabled by default; set true to let the agent search the web.")
7962
+ .default(false),
7963
+ location: FalXaiGrokSearchLocationSchema.nullable()
7964
+ .describe("Optional location used to localize search results.")
7965
+ .default(null),
7966
+ enable_image_understanding: z
7967
+ .boolean()
7968
+ .nullable()
7969
+ .describe("Allow the agent to inspect images found during web search.")
7970
+ .default(null),
7971
+ })
7972
+ .strict()
7973
+ .describe("Configuration for one xAI web_search tool declaration.")
7974
+ .refine((v) => v.allowed_domains == null || v.excluded_domains == null, {
7975
+ message: "allowed_domains and excluded_domains are mutually exclusive.",
7976
+ });
7977
+ const FalXaiGrokXSearchToolSchema = z
7978
+ .object({
7979
+ from_date: z
7980
+ .string()
7981
+ .date()
7982
+ .nullable()
7983
+ .describe("Earliest post date, as ISO YYYY-MM-DD.")
7984
+ .default(null),
7985
+ allowed_x_handles: z
7986
+ .array(z.string())
7987
+ .min(1)
7988
+ .max(20)
7989
+ .nullable()
7990
+ .describe("Restrict results to posts from at most 20 X handles.")
7991
+ .default(null),
7992
+ excluded_x_handles: z
7993
+ .array(z.string())
7994
+ .min(1)
7995
+ .max(20)
7996
+ .nullable()
7997
+ .describe("Exclude posts from at most 20 X handles.")
7998
+ .default(null),
7999
+ enabled: z
8000
+ .boolean()
8001
+ .describe("Whether to include x_search in session.tools. Disabled by default; set true to let the agent search X posts.")
8002
+ .default(false),
8003
+ enable_video_understanding: z
8004
+ .boolean()
8005
+ .nullable()
8006
+ .describe("Allow the agent to inspect videos found on X.")
8007
+ .default(null),
8008
+ to_date: z
8009
+ .string()
8010
+ .date()
8011
+ .nullable()
8012
+ .describe("Latest post date, as ISO YYYY-MM-DD.")
8013
+ .default(null),
8014
+ enable_image_understanding: z
8015
+ .boolean()
8016
+ .nullable()
8017
+ .describe("Allow the agent to inspect images found on X.")
8018
+ .default(null),
8019
+ })
8020
+ .strict()
8021
+ .describe("Configuration for one xAI x_search tool declaration.")
8022
+ .refine((v) => v.allowed_x_handles == null || v.excluded_x_handles == null, {
8023
+ message: "allowed_x_handles and excluded_x_handles are mutually exclusive.",
8024
+ })
8025
+ .refine((v) => v.from_date == null || v.to_date == null || v.from_date <= v.to_date, {
8026
+ message: "from_date must be on or before to_date.",
8027
+ });
8028
+ const FalXaiGrokRemoteMCPToolSchema = z
8029
+ .object({
8030
+ server_description: z
8031
+ .string()
8032
+ .max(2000)
8033
+ .nullable()
8034
+ .describe("Description of the capabilities exposed by this server.")
8035
+ .default(null),
8036
+ allowed_tools: z
8037
+ .array(z.string())
8038
+ .min(1)
8039
+ .nullable()
8040
+ .describe("Optional allow-list of tool names exposed from this server.")
8041
+ .default(null),
8042
+ authorization: z
8043
+ .string()
8044
+ .nullable()
8045
+ .describe("Sensitive authorization value forwarded only to xAI.")
8046
+ .default(null),
8047
+ enabled: z.boolean().describe("False omits this server.").default(true),
8048
+ server_label: z
8049
+ .string()
8050
+ .min(1)
8051
+ .max(128)
8052
+ .describe("Label xAI uses to identify and prefix this server's tools."),
8053
+ server_url: z
8054
+ .string()
8055
+ .url()
8056
+ .regex(/^https?:\/\//, "URL scheme should be http or https")
8057
+ .min(1)
8058
+ .describe("Caller-selected HTTP(S) MCP endpoint. xAI makes the remote connection and supports Streaming HTTP/SSE transports. Use at your own risk; fal does not connect to or SSRF-fetch this URL."),
8059
+ headers: z
8060
+ .record(z.string(), z.string())
8061
+ .nullable()
8062
+ .describe("Sensitive MCP request headers forwarded only to xAI.")
8063
+ .default(null),
8064
+ })
8065
+ .strict()
8066
+ .describe("A caller-selected remote MCP server that xAI will connect to.\n\nUse at your own risk. The connection is made by xAI's infrastructure,\nnot by fal; choosing this tool explicitly accepts that trust boundary.\nAuthentication and headers are masked in fal error metadata and logs.");
8067
+ const FalXaiGrokToolsConfigurationSchema = z
8068
+ .object({
8069
+ web_search: FalXaiGrokWebSearchToolSchema.describe("xAI-managed web search; off unless enabled is set true.").default({
8070
+ allowed_domains: null,
8071
+ excluded_domains: null,
8072
+ enabled: false,
8073
+ location: null,
8074
+ enable_image_understanding: null,
8075
+ }),
8076
+ x_search: FalXaiGrokXSearchToolSchema.describe("xAI-managed X search; off unless enabled is set true.").default({
8077
+ from_date: null,
8078
+ allowed_x_handles: null,
8079
+ excluded_x_handles: null,
8080
+ enabled: false,
8081
+ enable_video_understanding: null,
8082
+ to_date: null,
8083
+ enable_image_understanding: null,
8084
+ }),
8085
+ mcp_servers: z
8086
+ .array(FalXaiGrokRemoteMCPToolSchema)
8087
+ .describe("Remote MCP servers that xAI connects to and executes.")
8088
+ .optional(),
8089
+ })
8090
+ .strict()
8091
+ .describe("Typed xAI tools supported by this app's convenience configuration.\n\nEvery tool is disabled in the default configuration: the searches must\nbe switched on via their ``enabled`` flags and ``mcp_servers`` starts\nempty. ``file_search`` / collections are intentionally absent and\nunsupported due to Zero Data Retention (ZDR) requirements. Caller-side\nfunction tools are likewise absent from the typed configuration — they\nrequire a client that answers callback events over /realtime, so they\nremain available only to raw ``session.update`` passthrough clients.\nRaw realtime passthrough stays generic except that ZDR-incompatible\ntool declarations are rejected in-band.");
8092
+ export const FalXaiGrokVoiceRequestSchema = z.object({
8093
+ voice: z
8094
+ .enum([
8095
+ "carina",
8096
+ "zagan",
8097
+ "helix",
8098
+ "orion",
8099
+ "luna",
8100
+ "iris",
8101
+ "altair",
8102
+ "zenith",
8103
+ "perseus",
8104
+ "helios",
8105
+ "lux",
8106
+ "kepler",
8107
+ "rigel",
8108
+ "cosmo",
8109
+ "celeste",
8110
+ "ursa",
8111
+ "sirius",
8112
+ "lumen",
8113
+ "castor",
8114
+ "naksh",
8115
+ "atlas",
8116
+ "aurora",
8117
+ "liora",
8118
+ "ara",
8119
+ "eve",
8120
+ "leo",
8121
+ "rex",
8122
+ "sal",
8123
+ ])
8124
+ .nullable()
8125
+ .describe("Built-in xAI voice for the agent's reply. Uses Grok's default voice when omitted.")
8126
+ .optional(),
8127
+ tools: FalXaiGrokToolsConfigurationSchema.describe("Server-side tools available to the agent. Web, X, and remote MCP tools are supported; every tool is disabled by default. file_search/collections are unsupported by the typed configuration due to ZDR.").prefault({
8128
+ web_search: { enabled: false },
8129
+ x_search: { enabled: false },
8130
+ mcp_servers: [],
8131
+ }),
8132
+ prompt: z
8133
+ .string()
8134
+ .max(20000)
8135
+ .nullable()
8136
+ .describe("Optional system instructions describing the agent's persona and conversation context. Uses Grok's default persona when omitted.")
8137
+ .optional(),
8138
+ enable_safety_checker: z
8139
+ .boolean()
8140
+ .describe("Authorized callers may set false to request relaxed screening.")
8141
+ .default(true),
8142
+ audio_url: z
8143
+ .string()
8144
+ .describe("URL of the audio containing the user's speech. The Grok agent listens to it and replies with speech. Most common audio formats are supported; the audio is converted to 16-bit 24 kHz mono PCM before being sent to Grok. Maximum duration 10 minutes, maximum file size 50 MB."),
8145
+ });
8146
+ // Pixelcut Looping Video
8147
+ export const FalPixelcutLoopingVideoRequestSchema = z.object({
8148
+ image_url: z
8149
+ .string()
8150
+ .describe("Input image the video starts and ends on (JPEG, PNG, or WebP)"),
8151
+ prompt: z
8152
+ .string()
8153
+ .max(4000)
8154
+ .default("")
8155
+ .describe("Optional creative direction for the motion. Camera stays locked regardless."),
8156
+ duration: z
8157
+ .number()
8158
+ .int()
8159
+ .min(5)
8160
+ .max(15)
8161
+ .default(5)
8162
+ .describe("Video duration in seconds"),
8163
+ resolution: z
8164
+ .enum(["480p", "768p", "1080p"])
8165
+ .default("1080p")
8166
+ .describe("Output resolution"),
8167
+ motion: z
8168
+ .enum(["subtle", "spin"])
8169
+ .default("subtle")
8170
+ .describe("Motion style: subtle for gentle ambient movement, spin for one full 360-degree revolution ending on the source frame"),
8171
+ include_audio: z
8172
+ .boolean()
8173
+ .default(false)
8174
+ .describe("Keep the generated audio track (off by default; the loop is silent)"),
8175
+ });
8176
+ // PixVerse VibeMV music video
8177
+ export const FalPixverseMusicVideoVibemvRequestSchema = z.object({
8178
+ audio_url: z
8179
+ .string()
8180
+ .describe("URL of an MP3 or WAV file between 10 seconds and 6 minutes."),
8181
+ image_url: z
8182
+ .string()
8183
+ .nullable()
8184
+ .describe("Optional character reference image URL.")
8185
+ .optional(),
8186
+ style_image_url: z
8187
+ .string()
8188
+ .nullable()
8189
+ .describe("Optional style reference image URL. Only used with the Custom style.")
8190
+ .optional(),
8191
+ music_style: z
8192
+ .enum([
8193
+ "Pop",
8194
+ "Rock",
8195
+ "Hip Hop",
8196
+ "R&B",
8197
+ "Jazz",
8198
+ "Reggae",
8199
+ "Country",
8200
+ "Folk",
8201
+ "Electronic",
8202
+ "Classical",
8203
+ "Soul",
8204
+ "Funk",
8205
+ "Metal",
8206
+ "Ambient",
8207
+ "Others",
8208
+ ])
8209
+ .nullable()
8210
+ .describe("Optional musical genre used to guide the visuals.")
8211
+ .optional(),
8212
+ style: z
8213
+ .enum([
8214
+ "Custom",
8215
+ "Cinematic",
8216
+ "Lo-fi",
8217
+ "Dreamscape",
8218
+ "Woolen Felt",
8219
+ "Candy",
8220
+ "Golden Age",
8221
+ "Voxel",
8222
+ "Retro Game",
8223
+ "Claymation",
8224
+ "Woodland Tale",
8225
+ "Impressionism",
8226
+ "Decadence",
8227
+ "Futuristic",
8228
+ "Chromatic Clash",
8229
+ "Holiday",
8230
+ ])
8231
+ .default("Cinematic")
8232
+ .describe("Visual style for the music video."),
8233
+ aspect_ratio: z
8234
+ .enum(["16:9", "9:16", "1:1", "4:3", "3:4"])
8235
+ .default("16:9")
8236
+ .describe("Aspect ratio of the generated video."),
8237
+ resolution: z
8238
+ .enum(["720p", "1080p"])
8239
+ .default("720p")
8240
+ .describe("Resolution of the generated video."),
8241
+ lyrics: z
8242
+ .string()
8243
+ .max(5000)
8244
+ .nullable()
8245
+ .describe("Optional lyrics to display as subtitles.")
8246
+ .optional(),
8247
+ lip_sync_switch: z
8248
+ .boolean()
8249
+ .default(false)
8250
+ .describe("Enable lip sync so characters mouth the vocals. Works best with a character reference image."),
8251
+ enable_safety_checker: z
8252
+ .boolean()
8253
+ .default(true)
8254
+ .describe("Authorized callers may set false to request relaxed screening."),
8255
+ });
8256
+ // MiniMax H3 Max VHS styled text-to-video
8257
+ export const FalMinimaxH3MaxStylesVhsRequestSchema = z
8258
+ .object({
8259
+ prompt: z
8260
+ .string()
8261
+ .min(1)
8262
+ .max(49910)
8263
+ .describe("Describe the scene, action, camera and sound. VHS style and tape damage are applied automatically."),
8264
+ image_url: z
8265
+ .string()
8266
+ .nullable()
8267
+ .describe("Optional first-frame image. Use a 4:3 image for the classic VHS frame; the image's aspect ratio determines the output canvas.")
8268
+ .optional(),
8269
+ damage_level: z
8270
+ .enum(["light", "medium", "heavy"])
8271
+ .default("medium")
8272
+ .describe("Tape wear: light adds subtle analog noise, medium adds visible damage, and heavy adds strong tracking errors and distortion."),
8273
+ duration: z
8274
+ .number()
8275
+ .int()
8276
+ .min(5)
8277
+ .max(15)
8278
+ .default(5)
8279
+ .describe("Requested video duration in seconds."),
8280
+ aspect_ratio: z
8281
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8282
+ .default("16:9")
8283
+ .describe("Video aspect ratio for text-only generation. Ignored when image_url is provided."),
8284
+ seed: z
8285
+ .number()
8286
+ .int()
8287
+ .nullable()
8288
+ .describe("Random seed. Omit to choose one automatically.")
8289
+ .optional(),
8290
+ })
8291
+ .strict();
8292
+ // MiniMax H3 Max Retro Toon 70s styled text-to-video
8293
+ export const FalMinimaxH3MaxStylesRetroToon70sRequestSchema = z
8294
+ .object({
8295
+ prompt: z
8296
+ .string()
8297
+ .min(1)
8298
+ .max(49864)
8299
+ .describe("Describe the scene, action, camera and sound. The retro 1970s hand-painted animation style is applied automatically."),
8300
+ image_url: z
8301
+ .string()
8302
+ .nullable()
8303
+ .describe("Optional first-frame image. Use painted-style artwork for the most consistent look; the image's aspect ratio determines the output canvas.")
8304
+ .optional(),
8305
+ duration: z
8306
+ .number()
8307
+ .int()
8308
+ .min(5)
8309
+ .max(15)
8310
+ .default(5)
8311
+ .describe("Requested video duration in seconds."),
8312
+ aspect_ratio: z
8313
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8314
+ .default("16:9")
8315
+ .describe("Video aspect ratio for text-only generation. Ignored when image_url is provided."),
8316
+ seed: z
8317
+ .number()
8318
+ .int()
8319
+ .nullable()
8320
+ .describe("Random seed. Omit to choose one automatically.")
8321
+ .optional(),
8322
+ })
8323
+ .strict();
8324
+ // MiniMax H3 Max Low Poly styled text-to-video
8325
+ export const FalMinimaxH3MaxStylesLowPolyRequestSchema = z
8326
+ .object({
8327
+ prompt: z
8328
+ .string()
8329
+ .min(1)
8330
+ .max(49914)
8331
+ .describe("Describe the scene, action, camera and sound. The retro low-poly 3D style is applied automatically."),
8332
+ image_url: z
8333
+ .string()
8334
+ .nullable()
8335
+ .describe("Optional first-frame image. Use low-poly or retro 3D artwork for the most consistent look; the image's aspect ratio determines the output canvas.")
8336
+ .optional(),
8337
+ duration: z
8338
+ .number()
8339
+ .int()
8340
+ .min(5)
8341
+ .max(15)
8342
+ .default(5)
8343
+ .describe("Requested video duration in seconds."),
8344
+ aspect_ratio: z
8345
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8346
+ .default("16:9")
8347
+ .describe("Video aspect ratio for text-only generation. Ignored when image_url is provided."),
8348
+ seed: z
8349
+ .number()
8350
+ .int()
8351
+ .nullable()
8352
+ .describe("Random seed. Omit to choose one automatically.")
8353
+ .optional(),
8354
+ })
8355
+ .strict();
8356
+ // MiniMax H3 Max Hand Drawn styled text-to-video
8357
+ export const FalMinimaxH3MaxStylesHandDrawnRequestSchema = z
8358
+ .object({
8359
+ prompt: z
8360
+ .string()
8361
+ .min(1)
8362
+ .max(49868)
8363
+ .describe("Describe the scene, action, camera and sound. The Hand drawn style is applied automatically."),
8364
+ image_url: z
8365
+ .string()
8366
+ .nullable()
8367
+ .describe("Optional first-frame image. Use pencil artwork for the most consistent look; the image's aspect ratio determines the output canvas.")
8368
+ .optional(),
8369
+ duration: z
8370
+ .number()
8371
+ .int()
8372
+ .min(5)
8373
+ .max(15)
8374
+ .default(5)
8375
+ .describe("Requested video duration in seconds."),
8376
+ aspect_ratio: z
8377
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8378
+ .default("16:9")
8379
+ .describe("Video aspect ratio for text-only generation. Ignored when image_url is provided."),
8380
+ seed: z
8381
+ .number()
8382
+ .int()
8383
+ .nullable()
8384
+ .describe("Random seed. Omit to choose one automatically.")
8385
+ .optional(),
8386
+ })
8387
+ .strict();
8388
+ // MiniMax H3 Max 16-bit Pixel styled text-to-video
8389
+ export const FalMinimaxH3MaxStylesSixteenBitPixelRequestSchema = z
8390
+ .object({
8391
+ prompt: z
8392
+ .string()
8393
+ .min(1)
8394
+ .max(49815)
8395
+ .describe("Describe the scene, action, camera and sound. The 16-bit pixel style is applied automatically."),
8396
+ image_url: z
8397
+ .string()
8398
+ .nullable()
8399
+ .describe("Optional first-frame image. Use pixel artwork for the most consistent style. When provided, its aspect ratio determines the output canvas.")
8400
+ .optional(),
8401
+ duration: z
8402
+ .number()
8403
+ .int()
8404
+ .min(5)
8405
+ .max(15)
8406
+ .default(5)
8407
+ .describe("Requested video duration in seconds."),
8408
+ aspect_ratio: z
8409
+ .enum(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8410
+ .default("16:9")
8411
+ .describe("Video aspect ratio for text-only generation. Ignored when image_url is provided."),
8412
+ seed: z
8413
+ .number()
8414
+ .int()
8415
+ .nullable()
8416
+ .describe("Random seed. Omit to choose one automatically.")
8417
+ .optional(),
8418
+ })
8419
+ .strict();
8420
+ // Bytedance Seedance 2.0 US text-to-video
8421
+ export const FalBytedanceSeedance2p0UsTextToVideoRequestSchema = z.object({
8422
+ prompt: z.string().describe("The text prompt used to generate the video"),
8423
+ resolution: z
8424
+ .enum(["480p", "720p", "1080p", "4k"])
8425
+ .default("720p")
8426
+ .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality, 4k for highest quality."),
8427
+ duration: z
8428
+ .enum([
8429
+ "auto",
8430
+ "4",
8431
+ "5",
8432
+ "6",
8433
+ "7",
8434
+ "8",
8435
+ "9",
8436
+ "10",
8437
+ "11",
8438
+ "12",
8439
+ "13",
8440
+ "14",
8441
+ "15",
8442
+ ])
8443
+ .default("auto")
8444
+ .describe("Duration of the video in seconds. Supports 4 to 15 seconds, or auto to let the model decide based on the prompt."),
8445
+ aspect_ratio: z
8446
+ .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8447
+ .default("auto")
8448
+ .describe("The aspect ratio of the generated video. Use 16:9 for landscape, 9:16 for portrait/vertical, 1:1 for square, 21:9 for ultrawide cinematic, or auto to let the model decide."),
8449
+ generate_audio: z
8450
+ .boolean()
8451
+ .default(true)
8452
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
8453
+ bitrate_mode: z
8454
+ .enum(["standard", "high"])
8455
+ .default("standard")
8456
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
8457
+ codec: z
8458
+ .enum(["auto", "H264", "H265"])
8459
+ .default("auto")
8460
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8461
+ end_user_id: z
8462
+ .string()
8463
+ .nullable()
8464
+ .describe("The unique user ID of the end user.")
8465
+ .optional(),
8466
+ });
8467
+ // Bytedance Seedance 2.0 US image-to-video
8468
+ export const FalBytedanceSeedance2p0UsImageToVideoRequestSchema = z.object({
8469
+ prompt: z
8470
+ .string()
8471
+ .describe("The text prompt describing the desired motion and action for the video."),
8472
+ image_url: z
8473
+ .string()
8474
+ .describe("The URL of the starting frame image to animate. Supported formats: JPEG, PNG, WebP. Max 30 MB."),
8475
+ end_image_url: z
8476
+ .string()
8477
+ .nullable()
8478
+ .optional()
8479
+ .describe("The URL of the image to use as the last frame of the video. When provided, the generated video will transition from the starting image to this ending image. Supported formats: JPEG, PNG, WebP. Max 30 MB."),
8480
+ resolution: z
8481
+ .enum(["480p", "720p", "1080p", "4k"])
8482
+ .default("720p")
8483
+ .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality, 4k for highest quality."),
8484
+ duration: z
8485
+ .enum([
8486
+ "auto",
8487
+ "4",
8488
+ "5",
8489
+ "6",
8490
+ "7",
8491
+ "8",
8492
+ "9",
8493
+ "10",
8494
+ "11",
8495
+ "12",
8496
+ "13",
8497
+ "14",
8498
+ "15",
8499
+ ])
8500
+ .default("auto")
8501
+ .describe("Duration of the video in seconds. Supports 4 to 15 seconds, or auto to let the model decide based on the prompt."),
8502
+ aspect_ratio: z
8503
+ .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8504
+ .default("auto")
8505
+ .describe("The aspect ratio of the generated video. Use 16:9 for landscape, 9:16 for portrait/vertical, 1:1 for square, 21:9 for ultrawide cinematic, or auto to infer from the input image."),
8506
+ generate_audio: z
8507
+ .boolean()
8508
+ .default(true)
8509
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
8510
+ bitrate_mode: z
8511
+ .enum(["standard", "high"])
8512
+ .default("standard")
8513
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
8514
+ codec: z
8515
+ .enum(["auto", "H264", "H265"])
8516
+ .default("auto")
8517
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8518
+ end_user_id: z
8519
+ .string()
8520
+ .nullable()
8521
+ .describe("The unique user ID of the end user.")
8522
+ .optional(),
8523
+ });
8524
+ // Bytedance Seedance 2.0 US reference-to-video
8525
+ export const FalBytedanceSeedance2p0UsReferenceToVideoRequestSchema = z
8526
+ .object({
8527
+ prompt: z.string().describe("The text prompt used to generate the video."),
8528
+ image_urls: z
8529
+ .array(z.string())
8530
+ .max(9)
8531
+ .optional()
8532
+ .describe("Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc. Supported formats: JPEG, PNG, WebP. Max 30 MB per image. Up to 9 images. Total files across all modalities must not exceed 12."),
8533
+ video_urls: z
8534
+ .array(z.string())
8535
+ .max(3)
8536
+ .optional()
8537
+ .describe("Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Up to 3 videos, combined duration must be between 2 and 15 seconds, total size under 50 MB. Each video must be between ~480p (640x640) and ~720p (834x1112) in resolution."),
8538
+ audio_urls: z
8539
+ .array(z.string())
8540
+ .max(3)
8541
+ .optional()
8542
+ .describe("Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 3 files, combined duration must not exceed 15 seconds. Max 15 MB per file. At least one reference image or video is required."),
8543
+ resolution: z
8544
+ .enum(["480p", "720p", "1080p", "4k"])
8545
+ .default("720p")
8546
+ .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality, 4k for highest quality."),
8547
+ duration: z
8548
+ .enum([
8549
+ "auto",
8550
+ "4",
8551
+ "5",
8552
+ "6",
8553
+ "7",
8554
+ "8",
8555
+ "9",
8556
+ "10",
8557
+ "11",
8558
+ "12",
8559
+ "13",
8560
+ "14",
8561
+ "15",
8562
+ ])
8563
+ .default("auto")
8564
+ .describe("Duration of the video in seconds. Supports 4 to 15 seconds, or auto to let the model decide based on the prompt."),
8565
+ aspect_ratio: z
8566
+ .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8567
+ .default("auto")
8568
+ .describe("The aspect ratio of the generated video. Use 16:9 for landscape, 9:16 for portrait/vertical, 1:1 for square, 21:9 for ultrawide cinematic, or auto to let the model decide."),
8569
+ generate_audio: z
8570
+ .boolean()
8571
+ .default(true)
8572
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
8573
+ bitrate_mode: z
8574
+ .enum(["standard", "high"])
8575
+ .default("standard")
8576
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
8577
+ codec: z
8578
+ .enum(["auto", "H264", "H265"])
8579
+ .default("auto")
8580
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8581
+ end_user_id: z
8582
+ .string()
8583
+ .nullable()
8584
+ .describe("The unique user ID of the end user.")
8585
+ .optional(),
8586
+ })
8587
+ // Both rules are documented in the field descriptions only; fal's 422
8588
+ // validator does not report them, so they are restated here.
8589
+ .refine((v) => (v.image_urls?.length ?? 0) +
8590
+ (v.video_urls?.length ?? 0) +
8591
+ (v.audio_urls?.length ?? 0) <=
8592
+ 12, { message: "Total files across all modalities must not exceed 12" })
8593
+ .refine((v) => (v.audio_urls?.length ?? 0) === 0 ||
8594
+ (v.image_urls?.length ?? 0) + (v.video_urls?.length ?? 0) > 0, {
8595
+ message: "Audio references require at least one image or video",
8596
+ path: ["audio_urls"],
8597
+ });
8598
+ // Bytedance Seedance 2.5 US text-to-video
8599
+ export const FalBytedanceSeedance2p5UsTextToVideoRequestSchema = z.object({
8600
+ prompt: z.string().describe("The text prompt used to generate the video"),
8601
+ resolution: z
8602
+ .enum(["480p", "720p", "1080p"])
8603
+ .default("720p")
8604
+ .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality."),
8605
+ duration: z
8606
+ .enum([
8607
+ "auto",
8608
+ "4",
8609
+ "5",
8610
+ "6",
8611
+ "7",
8612
+ "8",
8613
+ "9",
8614
+ "10",
8615
+ "11",
8616
+ "12",
8617
+ "13",
8618
+ "14",
8619
+ "15",
8620
+ "16",
8621
+ "17",
8622
+ "18",
8623
+ "19",
8624
+ "20",
8625
+ "21",
8626
+ "22",
8627
+ "23",
8628
+ "24",
8629
+ "25",
8630
+ "26",
8631
+ "27",
8632
+ "28",
8633
+ "29",
8634
+ "30",
8635
+ ])
8636
+ .default("auto")
8637
+ .describe("Duration of the video in seconds. Supports 4 to 30 seconds, or auto to let the model decide based on the prompt."),
8638
+ aspect_ratio: z
8639
+ .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8640
+ .default("auto")
8641
+ .describe("The aspect ratio of the generated video. Use 16:9 for landscape, 9:16 for portrait/vertical, 1:1 for square, 21:9 for ultrawide cinematic, or auto to let the model decide."),
8642
+ generate_audio: z
8643
+ .boolean()
8644
+ .default(true)
8645
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
8646
+ bitrate_mode: z
8647
+ .enum(["standard", "high"])
8648
+ .default("standard")
8649
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
8650
+ codec: z
8651
+ .enum(["auto", "H264", "H265"])
8652
+ .default("auto")
8653
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8654
+ end_user_id: z
8655
+ .string()
8656
+ .nullable()
8657
+ .describe("The unique user ID of the end user.")
8658
+ .optional(),
8659
+ });
8660
+ // Bytedance Seedance 2.5 US image-to-video
8661
+ export const FalBytedanceSeedance2p5UsImageToVideoRequestSchema = z.object({
8662
+ prompt: z
8663
+ .string()
8664
+ .nullable()
8665
+ .optional()
8666
+ .describe("The text prompt describing the desired motion and action for the video."),
8667
+ image_url: z
8668
+ .string()
8669
+ .describe("The URL of the starting frame image to animate. Supported formats: JPEG, PNG, WebP. Max 30 MB."),
8670
+ end_image_url: z
8671
+ .string()
8672
+ .nullable()
8673
+ .optional()
8674
+ .describe("The URL of the image to use as the last frame of the video. When provided, the generated video will transition from the starting image to this ending image. Supported formats: JPEG, PNG, WebP. Max 30 MB."),
8675
+ resolution: z
8676
+ .enum(["480p", "720p", "1080p"])
8677
+ .default("720p")
8678
+ .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality."),
8679
+ duration: z
8680
+ .enum([
8681
+ "auto",
8682
+ "4",
8683
+ "5",
8684
+ "6",
8685
+ "7",
8686
+ "8",
8687
+ "9",
8688
+ "10",
8689
+ "11",
8690
+ "12",
8691
+ "13",
8692
+ "14",
8693
+ "15",
8694
+ "16",
8695
+ "17",
8696
+ "18",
8697
+ "19",
8698
+ "20",
8699
+ "21",
8700
+ "22",
8701
+ "23",
8702
+ "24",
8703
+ "25",
8704
+ "26",
8705
+ "27",
8706
+ "28",
8707
+ "29",
8708
+ "30",
8709
+ ])
8710
+ .default("auto")
8711
+ .describe("Duration of the video in seconds. Supports 4 to 30 seconds, or auto to let the model decide based on the prompt."),
8712
+ // The live Input declares const "auto"; fal's validator does not enforce it.
8713
+ aspect_ratio: z
8714
+ .literal("auto")
8715
+ .default("auto")
8716
+ .describe('The aspect ratio of the generated video. Always "auto" for image-to-video'),
8717
+ generate_audio: z
8718
+ .boolean()
8719
+ .default(true)
8720
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
8721
+ bitrate_mode: z
8722
+ .enum(["standard", "high"])
8723
+ .default("standard")
8724
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
8725
+ codec: z
8726
+ .enum(["auto", "H264", "H265"])
8727
+ .default("auto")
8728
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8729
+ end_user_id: z
8730
+ .string()
8731
+ .nullable()
8732
+ .describe("The unique user ID of the end user.")
8733
+ .optional(),
8734
+ });
8735
+ // Bytedance Seedance 2.5 US reference-to-video. The per-modality caps are
8736
+ // documented in the field descriptions only (fal's 422 validator does not
8737
+ // report them); together they also bound the documented 50-file total.
8738
+ export const FalBytedanceSeedance2p5UsReferenceToVideoRequestSchema = z.object({
8739
+ prompt: z
8740
+ .string()
8741
+ .nullable()
8742
+ .optional()
8743
+ .describe("The text prompt used to generate the video."),
8744
+ task: z
8745
+ .enum(["reference", "editing", "extension"])
8746
+ .default("reference")
8747
+ .describe("The type of video generation task. Reference uses the supplied media as guidance. Editing modifies a reference video and automatically coerces aspect_ratio and duration to auto. Extension continues a reference video and automatically coerces aspect_ratio to auto."),
8748
+ image_urls: z
8749
+ .array(z.string())
8750
+ .max(30)
8751
+ .optional()
8752
+ .describe("Reference images to guide video generation. Refer to them in the prompt as @Image1, @Image2, etc. Supported formats: JPG, PNG, WebP, BMP, TIFF, GIF, HEIC, HEIF. Max 30 MB per image. Up to 30 images. Total files across all modalities must not exceed 50."),
8753
+ video_urls: z
8754
+ .array(z.string())
8755
+ .max(10)
8756
+ .optional()
8757
+ .describe("Reference videos to guide video generation. Refer to them in the prompt as @Video1, @Video2, etc. Supported formats: MP4, MOV. Up to 10 videos. Each video must be 1.8 to 30.2 seconds and no larger than 200 MB; combined duration must not exceed 30.2 seconds. Dimensions must be 300 to 6,000 pixels per side, aspect ratio 0.4 to 2.5, and frame rate 24 to 60 FPS."),
8758
+ audio_urls: z
8759
+ .array(z.string())
8760
+ .max(10)
8761
+ .optional()
8762
+ .describe("Reference audio to guide video generation. Refer to them in the prompt as @Audio1, @Audio2, etc. Supported formats: MP3, WAV. Up to 10 files. Each file must be 1.8 to 30.2 seconds and no larger than 15 MB; combined duration must not exceed 30.2 seconds."),
8763
+ resolution: z
8764
+ .enum(["480p", "720p", "1080p"])
8765
+ .default("720p")
8766
+ .describe("Video resolution - 480p for faster generation, 720p for balance, 1080p for high quality."),
8767
+ duration: z
8768
+ .enum([
8769
+ "auto",
8770
+ "4",
8771
+ "5",
8772
+ "6",
8773
+ "7",
8774
+ "8",
8775
+ "9",
8776
+ "10",
8777
+ "11",
8778
+ "12",
8779
+ "13",
8780
+ "14",
8781
+ "15",
8782
+ "16",
8783
+ "17",
8784
+ "18",
8785
+ "19",
8786
+ "20",
8787
+ "21",
8788
+ "22",
8789
+ "23",
8790
+ "24",
8791
+ "25",
8792
+ "26",
8793
+ "27",
8794
+ "28",
8795
+ "29",
8796
+ "30",
8797
+ ])
8798
+ .default("auto")
8799
+ .describe("Duration of the video in seconds. Supports 4 to 30 seconds, or auto to let the model decide based on the prompt."),
8800
+ aspect_ratio: z
8801
+ .enum(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"])
8802
+ .default("auto")
8803
+ .describe("The aspect ratio of the generated video. Use 16:9 for landscape, 9:16 for portrait/vertical, 1:1 for square, 21:9 for ultrawide cinematic, or auto to let the model decide."),
8804
+ generate_audio: z
8805
+ .boolean()
8806
+ .default(true)
8807
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
8808
+ bitrate_mode: z
8809
+ .enum(["standard", "high"])
8810
+ .default("standard")
8811
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
8812
+ codec: z
8813
+ .enum(["auto", "H264", "H265"])
8814
+ .default("auto")
8815
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8816
+ seed: z
8817
+ .number()
8818
+ .int()
8819
+ .nullable()
8820
+ .optional()
8821
+ .describe("Random seed for reproducibility. Note that results may still vary slightly even with the same seed."),
8822
+ end_user_id: z
8823
+ .string()
8824
+ .nullable()
8825
+ .describe("The unique user ID of the end user.")
8826
+ .optional(),
8827
+ });
8828
+ // Bytedance Seedance 2.5 draft completion
8829
+ export const FalBytedanceSeedance2p5DraftCompleteRequestSchema = z.object({
8830
+ draft_id: z
8831
+ .string()
8832
+ .min(1)
8833
+ .max(8192)
8834
+ .describe("The draft_id returned with draft enabled. Valid for seven days and only for the original caller."),
8835
+ resolution: z
8836
+ .literal("1080p")
8837
+ .default("1080p")
8838
+ .describe("Completed drafts only support 1080p output."),
8839
+ codec: z
8840
+ .enum(["auto", "H264", "H265"])
8841
+ .default("auto")
8842
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
8843
+ });
8844
+ // Meshy 6 Lite retexture
8845
+ export const FalMeshyV6LiteRetextureRequestSchema = z
8846
+ .object({
8847
+ model_url: z
8848
+ .string()
8849
+ .describe("URL or base64 data URI of a 3D model to texture. Supports .glb, .gltf, .obj, .fbx, .stl formats. Can be a publicly accessible URL or data URI with MIME type application/octet-stream."),
8850
+ text_style_prompt: z
8851
+ .string()
8852
+ .max(600)
8853
+ .nullable()
8854
+ .optional()
8855
+ .describe("Describe your desired texture style using text. Maximum 600 characters. Required if image_style_url is not provided."),
8856
+ image_style_url: z
8857
+ .string()
8858
+ .nullable()
8859
+ .optional()
8860
+ .describe("2D image to guide the texturing process. Supports .jpg, .jpeg, and .png formats. Required if text_style_prompt is not provided. If both are provided, image_style_url takes precedence."),
8861
+ texture_resolution: z
8862
+ .enum(["2k", "4k", "8k"])
8863
+ .default("2k")
8864
+ .describe("Base color resolution: 2k (2048), 4k (4096), or 8k (8192). 4k and 8k require Meshy 6 or 7, so this Meshy 6 Lite endpoint supports 2k only. At 8k, PBR maps are 4k and no emission map is generated."),
8865
+ enable_original_uv: z
8866
+ .boolean()
8867
+ .default(true)
8868
+ .describe("Use the original UV mapping of the model instead of generating new UVs. If the model has no original UV, output quality may be reduced."),
8869
+ enable_pbr: z
8870
+ .boolean()
8871
+ .default(false)
8872
+ .describe("Generate PBR Maps (metallic, roughness, normal) in addition to base color."),
8873
+ enable_safety_checker: z
8874
+ .boolean()
8875
+ .default(true)
8876
+ .describe("If set to true, input data will be checked for safety before processing."),
8877
+ })
8878
+ // Documented in the field descriptions only; fal's 422 validator does not
8879
+ // report it, so it is restated here.
8880
+ .refine((v) => v.text_style_prompt != null || v.image_style_url != null, {
8881
+ message: "Either text_style_prompt or image_style_url is required",
8882
+ path: ["text_style_prompt"],
8883
+ });
6397
8884
  export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
8885
+ "meshy/v6-lite/retexture": FalMeshyV6LiteRetextureRequestSchema,
8886
+ "bytedance/seedance-2.5/draft/complete": FalBytedanceSeedance2p5DraftCompleteRequestSchema,
8887
+ "bytedance/seedance-2.5/us/reference-to-video": FalBytedanceSeedance2p5UsReferenceToVideoRequestSchema,
8888
+ "bytedance/seedance-2.5/us/image-to-video": FalBytedanceSeedance2p5UsImageToVideoRequestSchema,
8889
+ "bytedance/seedance-2.5/us/text-to-video": FalBytedanceSeedance2p5UsTextToVideoRequestSchema,
8890
+ "bytedance/seedance-2.0/us/reference-to-video": FalBytedanceSeedance2p0UsReferenceToVideoRequestSchema,
8891
+ "bytedance/seedance-2.0/us/image-to-video": FalBytedanceSeedance2p0UsImageToVideoRequestSchema,
8892
+ "bytedance/seedance-2.0/us/text-to-video": FalBytedanceSeedance2p0UsTextToVideoRequestSchema,
8893
+ "minimax/h3-max/styles/16bit-pixel": FalMinimaxH3MaxStylesSixteenBitPixelRequestSchema,
8894
+ "minimax/h3-max/styles/hand-drawn": FalMinimaxH3MaxStylesHandDrawnRequestSchema,
8895
+ "minimax/h3-max/styles/low-poly": FalMinimaxH3MaxStylesLowPolyRequestSchema,
8896
+ "minimax/h3-max/styles/retro-toon-70s": FalMinimaxH3MaxStylesRetroToon70sRequestSchema,
8897
+ "minimax/h3-max/styles/vhs": FalMinimaxH3MaxStylesVhsRequestSchema,
8898
+ "pixverse/music-video/vibemv": FalPixverseMusicVideoVibemvRequestSchema,
8899
+ "pixelcut/looping-video": FalPixelcutLoopingVideoRequestSchema,
8900
+ "xai/grok-voice": FalXaiGrokVoiceRequestSchema,
8901
+ "fal-ai/flux-3-action/so101": FalFlux3ActionSo101RequestSchema,
8902
+ "openrouter/router/decisions": FalOpenrouterRouterDecisionsRequestSchema,
8903
+ "creatify/boreal": FalCreatifyBorealRequestSchema,
8904
+ "veed/clean-audio": FalVeedCleanAudioRequestSchema,
8905
+ "fal-ai/kling-video/o3/standard/image-to-video": FalKlingVideoO3StandardImageToVideoRequestSchema,
8906
+ "fal-ai/flux-2-flex": FalFlux2FlexRequestSchema,
8907
+ "fal-ai/kandinsky6-pro/image-to-video": FalKandinsky6ProImageToVideoRequestSchema,
8908
+ "fal-ai/kandinsky6-pro/text-to-video": FalKandinsky6ProTextToVideoRequestSchema,
8909
+ "fal-ai/kandinsky6-lite/image-to-video": FalKandinsky6LiteImageToVideoRequestSchema,
8910
+ "fal-ai/kandinsky6-lite/text-to-video": FalKandinsky6LiteTextToVideoRequestSchema,
8911
+ "fal-ai/kandinsky6-vsr/lite": FalKandinsky6VsrLiteRequestSchema,
8912
+ "fal-ai/kandinsky6-vsr": FalKandinsky6VsrRequestSchema,
8913
+ "minimax/h3-max/relight": FalMinimaxH3MaxRelightRequestSchema,
8914
+ "fal-ai/vidu/q4/reference-to-video": FalViduQ4ReferenceToVideoRequestSchema,
8915
+ "fal-ai/vidu/q4/image-to-video": FalViduQ4ImageToVideoRequestSchema,
8916
+ "google/nano-banana-2.1/edit": FalNanoBanana2p1EditRequestSchema,
8917
+ "google/nano-banana-2.1": FalNanoBanana2p1TextToImageRequestSchema,
8918
+ "mureka/api/generate/podcast": FalMurekaApiGeneratePodcastRequestSchema,
8919
+ "mureka/api/generate/song": FalMurekaApiGenerateSongRequestSchema,
8920
+ "mureka/api/generate/instrumental": FalMurekaApiGenerateInstrumentalRequestSchema,
8921
+ "mureka/api/generate/lyrics": FalMurekaApiGenerateLyricsRequestSchema,
8922
+ "mirelo-ai/sfx2.0/video-to-video": FalMireloAiSfx2p0VideoToVideoRequestSchema,
8923
+ "mirelo-ai/sfx2.0/video-to-audio": FalMireloAiSfx2p0VideoToAudioRequestSchema,
8924
+ "mirelo-ai/sfx2.0/text-to-audio": FalMireloAiSfx2p0TextToAudioRequestSchema,
8925
+ "fal-ai/marigold-v2": FalMarigoldV2RequestSchema,
8926
+ "bria/guided-remove-background": FalBriaGuidedRemoveBackgroundRequestSchema,
8927
+ "bria/fibo-edit-1.5/expand": FalBriaFiboEdit1p5ExpandRequestSchema,
6398
8928
  "luma/agent/ray/v3.2/text-to-video": FalLumaAgentRayV3p2TextToVideoRequestSchema,
6399
8929
  "luma/agent/ray/v3.2/image-to-video": FalLumaAgentRayV3p2ImageToVideoRequestSchema,
6400
8930
  "luma/agent/ray/v3.2/video-to-video": FalLumaAgentRayV3p2VideoToVideoRequestSchema,