@apicity/fal 0.29.0 → 0.31.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
@@ -1268,6 +1268,77 @@ export const FalSeedreamV5ProEditRequestSchema = z.object({
1268
1268
  enable_safety_checker: z.boolean().optional(),
1269
1269
  });
1270
1270
  // ---------------------------------------------------------------------------
1271
+ // Bytedance Seedream 5.5 edit
1272
+ // ---------------------------------------------------------------------------
1273
+ // Queue OpenAPI re-read 2026-11-20
1274
+ // (sha256 717a8bfaa7293167665dcaeb6bc9d35ab4b16793fc45402fa7626c6dfc19e3c6).
1275
+ // The route was not probed: a rejected body can still be billed.
1276
+ // Docs: https://fal.ai/models/bytedance/seedream/v5.5/edit/api
1277
+ const FalSeedreamV55ImageSizeSchema = z.union([
1278
+ z.enum([
1279
+ "square_hd",
1280
+ "square",
1281
+ "portrait_4_3",
1282
+ "portrait_16_9",
1283
+ "landscape_4_3",
1284
+ "landscape_16_9",
1285
+ "auto_1K",
1286
+ "auto_1.5K",
1287
+ "auto_2K",
1288
+ ]),
1289
+ z.object({
1290
+ width: z
1291
+ .number()
1292
+ .int()
1293
+ .min(1)
1294
+ .max(14142)
1295
+ .describe("The width of the generated image."),
1296
+ height: z
1297
+ .number()
1298
+ .int()
1299
+ .min(1)
1300
+ .max(14142)
1301
+ .describe("The height of the generated image."),
1302
+ }),
1303
+ ]);
1304
+ export const FalSeedreamV55EditRequestSchema = z.object({
1305
+ prompt: z.string().describe("The text prompt used to edit the image."),
1306
+ image_size: FalSeedreamV55ImageSizeSchema.default("auto_2K").describe("The size of the generated image. Total pixels must be between 921600 and 4624220, with aspect ratio between 1/16 and 16."),
1307
+ num_images: z
1308
+ .number()
1309
+ .int()
1310
+ .min(1)
1311
+ .max(6)
1312
+ .default(1)
1313
+ .describe("Number of separate model generations to run with the prompt."),
1314
+ output_format: z
1315
+ .enum(["jpeg", "png"])
1316
+ .default("png")
1317
+ .describe("The file format of the generated image."),
1318
+ watermark: z
1319
+ .boolean()
1320
+ .default(false)
1321
+ .describe("Whether to add the provider's visible watermark."),
1322
+ sync_mode: z
1323
+ .boolean()
1324
+ .default(false)
1325
+ .describe("If `True`, the media will be returned as a data URI and the output data won't be available in the request history."),
1326
+ enable_safety_checker: z
1327
+ .boolean()
1328
+ .default(true)
1329
+ .describe("If set to true, the safety checker will be enabled. Disabling it requires account authorization; unauthorized requests are always checked."),
1330
+ background: z
1331
+ .enum(["auto", "opaque", "transparent"])
1332
+ .default("auto")
1333
+ .describe("`auto` lets the model choose from the prompt and output format. `transparent` returns an RGBA image and requires `output_format=png`."),
1334
+ // Upstream keeps at most the last 10 images and does not reject a longer
1335
+ // list, so the cap is not encoded. The list is required and non-empty.
1336
+ image_urls: z
1337
+ .array(z.string())
1338
+ .min(1)
1339
+ .describe("List of URLs of input reference images. Up to 10 images are supported; if more are sent, only the last 10 are used."),
1340
+ });
1341
+ // ---------------------------------------------------------------------------
1271
1342
  // Bytedance Seed Speech TTS v2
1272
1343
  // ---------------------------------------------------------------------------
1273
1344
  const FalSeedSpeechTtsV2VoiceSchema = z.enum([
@@ -2971,7 +3042,10 @@ const Flux3MaxAspectRatioSchema = z.enum([
2971
3042
  "3:4",
2972
3043
  "9:16",
2973
3044
  ]);
2974
- const Flux3MaxResolutionSchema = z.enum(["720p", "1080p"]);
3045
+ // The live OpenAPI, re-read 2026-11-25, adds "2K" (1440p) and "4K" (2160p),
3046
+ // upscaled from the 720p generation. Unlike FLUX 3 ("1440p" / "2160p"), Max
3047
+ // spells them "2K" and "4K"; the enum is case-sensitive.
3048
+ const Flux3MaxResolutionSchema = z.enum(["720p", "1080p", "2K", "4K"]);
2975
3049
  const Flux3MaxDurationSchema = z.number().int().min(5).max(20);
2976
3050
  const Flux3MaxReasoningLevelSchema = z.enum(["low", "high"]);
2977
3051
  const Flux3MaxVideoRequestBaseSchema = z.object({
@@ -11202,6 +11276,137 @@ export const FalBytedanceSeedance2p5UsImageToVideoRequestSchema = z.object({
11202
11276
  .describe("The unique user ID of the end user.")
11203
11277
  .optional(),
11204
11278
  });
11279
+ // Bytedance Seedance 2.5 Flash image-to-video, from the live queue OpenAPI
11280
+ // read 2026-11-25 (Seedance25FlashImageToVideoInput). It matches the
11281
+ // standard 2.5 image-to-video Input without draft, and with resolution
11282
+ // limited to 480p and 720p.
11283
+ export const FalBytedanceSeedance2p5FlashImageToVideoRequestSchema = z.object({
11284
+ prompt: z
11285
+ .string()
11286
+ .nullable()
11287
+ .optional()
11288
+ .describe("The text prompt describing the desired motion and action for the video."),
11289
+ image_url: z
11290
+ .string()
11291
+ .describe("The URL of the starting frame image to animate. Supported formats: JPEG, PNG, WebP, BMP, TIFF, GIF, HEIC, HEIF. Max 30 MB."),
11292
+ end_image_url: z
11293
+ .string()
11294
+ .nullable()
11295
+ .optional()
11296
+ .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, BMP, TIFF, GIF, HEIC, HEIF. Max 30 MB."),
11297
+ resolution: z
11298
+ .enum(["480p", "720p"])
11299
+ .default("720p")
11300
+ .describe("Video resolution: 480p or 720p."),
11301
+ duration: z
11302
+ .enum([
11303
+ "auto",
11304
+ "4",
11305
+ "5",
11306
+ "6",
11307
+ "7",
11308
+ "8",
11309
+ "9",
11310
+ "10",
11311
+ "11",
11312
+ "12",
11313
+ "13",
11314
+ "14",
11315
+ "15",
11316
+ "16",
11317
+ "17",
11318
+ "18",
11319
+ "19",
11320
+ "20",
11321
+ "21",
11322
+ "22",
11323
+ "23",
11324
+ "24",
11325
+ "25",
11326
+ "26",
11327
+ "27",
11328
+ "28",
11329
+ "29",
11330
+ "30",
11331
+ ])
11332
+ .default("auto")
11333
+ .describe("Duration of the video in seconds. Supports 4 to 30 seconds, or auto to let the model decide based on the prompt."),
11334
+ // The live Input declares const "auto": the output follows the input image.
11335
+ aspect_ratio: z
11336
+ .literal("auto")
11337
+ .default("auto")
11338
+ .describe('The aspect ratio of the generated video. Always "auto" for image-to-video'),
11339
+ generate_audio: z
11340
+ .boolean()
11341
+ .default(true)
11342
+ .describe("Whether to generate synchronized audio for the video, including sound effects, ambient sounds, and lip-synced speech."),
11343
+ bitrate_mode: z
11344
+ .enum(["standard", "high"])
11345
+ .default("standard")
11346
+ .describe("Output bitrate mode. 'high' requests a higher-quality, larger-file encode from the model; 'standard' uses the default bitrate."),
11347
+ codec: z
11348
+ .enum(["auto", "H264", "H265"])
11349
+ .default("auto")
11350
+ .describe("'auto' retains default video codec behaviour; 'H264' uses H.264; 'H265' uses H.265."),
11351
+ output_format: z
11352
+ .enum(["mp4", "mov"])
11353
+ .default("mp4")
11354
+ .describe("Output video format. 'mp4' is broadly compatible; 'mov' targets professional post-production but may not be supported by all players."),
11355
+ return_last_frame: z
11356
+ .boolean()
11357
+ .default(false)
11358
+ .describe("If true, also return the last frame of the generated video as an image."),
11359
+ end_user_id: z
11360
+ .string()
11361
+ .nullable()
11362
+ .describe("The unique user ID of the end user.")
11363
+ .optional(),
11364
+ });
11365
+ // fal queue OpenAPI, Seedance25FlashReferenceToVideoInput (2026-11-25).
11366
+ // The reference limits are published in the individual field descriptions.
11367
+ export const FalBytedanceSeedance2p5FlashReferenceToVideoRequestSchema = z.object({
11368
+ prompt: z
11369
+ .string()
11370
+ .nullable()
11371
+ .optional()
11372
+ .describe("Describe the video to generate."),
11373
+ task: z
11374
+ .enum(["auto", "reference", "editing", "extension"])
11375
+ .default("reference")
11376
+ .describe("Reference uses the supplied media as guidance. Editing modifies a reference video and sets aspect ratio and duration to auto. Extension continues a video and sets its aspect ratio to auto. Auto lets the model choose the task."),
11377
+ image_urls: z
11378
+ .array(z.string())
11379
+ .max(10)
11380
+ .optional()
11381
+ .describe("Up to 10 reference images, 30 MB each. Refer to them as @Image1, @Image2, etc."),
11382
+ video_urls: z
11383
+ .array(z.string())
11384
+ .max(5)
11385
+ .optional()
11386
+ .describe("Up to 5 reference videos, totaling up to 30.2 seconds. A single extension video may be up to 120 seconds, of which the last 30.2 seconds are used. Refer to them as @Video1, @Video2, etc."),
11387
+ audio_urls: z
11388
+ .array(z.string())
11389
+ .max(5)
11390
+ .optional()
11391
+ .describe("Up to 5 audio references, totaling up to 30.2 seconds. Refer to them as @Audio1, @Audio2, etc."),
11392
+ resolution: FalBytedanceSeedance2p5FlashImageToVideoRequestSchema.shape.resolution,
11393
+ duration: FalBytedanceSeedance2p5FlashImageToVideoRequestSchema.shape.duration,
11394
+ aspect_ratio: Seedance2p5AspectRatioSchema.default("auto").describe("Output aspect ratio. Auto lets the model choose."),
11395
+ ...FalBytedanceSeedance2p5FlashImageToVideoRequestSchema.pick({
11396
+ generate_audio: true,
11397
+ bitrate_mode: true,
11398
+ codec: true,
11399
+ output_format: true,
11400
+ return_last_frame: true,
11401
+ }).shape,
11402
+ seed: z
11403
+ .number()
11404
+ .int()
11405
+ .nullable()
11406
+ .optional()
11407
+ .describe("Random seed for generation."),
11408
+ end_user_id: FalBytedanceSeedance2p5FlashImageToVideoRequestSchema.shape.end_user_id,
11409
+ });
11205
11410
  // Bytedance Seedance 2.5 US reference-to-video. The per-modality caps are
11206
11411
  // documented in the field descriptions only (fal's 422 validator does not
11207
11412
  // report them); together they also bound the documented 50-file total.
@@ -11948,11 +12153,15 @@ export const FalHeygenHeygenVideoImageToVideoRequestSchema = z
11948
12153
  // Free 422 probes the same day returned "At least one reference image or
11949
12154
  // video is required" at reference_video_urls whenever neither list had an
11950
12155
  // item (audio references alone do not count), and refused null lists.
12156
+ // The queue OpenAPI re-read on 2026-11-25
12157
+ // (sha256 101dbb959290d787746b1eb9d6e2c9bd06474ce6826dd859d67c238f7d0a24a0)
12158
+ // raised duration's maximum from 15 to 30 seconds; the model page prose still
12159
+ // says 5 to 15, but the machine-readable input schema is the contract.
11951
12160
  // Docs: https://fal.ai/models/heygen/heygen-video/reference-to-video/api
11952
12161
  export const FalHeygenHeygenVideoReferenceToVideoRequestSchema = z
11953
12162
  .object({
11954
12163
  prompt: z.string().min(1).max(32000),
11955
- duration: z.number().int().min(5).max(15).default(5),
12164
+ duration: z.number().int().min(5).max(30).default(5),
11956
12165
  resolution: z.enum(["480p", "768p", "1080p", "2k"]).default("768p"),
11957
12166
  prompt_enhancement: z
11958
12167
  .enum(["turbo", "quality", "ultraquality", "disabled"])
@@ -14162,6 +14371,99 @@ export const FalKlingV4VideoToVideoEditRequestSchema = z.object({
14162
14371
  .default("1080p")
14163
14372
  .describe("Output resolution."),
14164
14373
  });
14374
+ // Pinned to the live queue OpenAPI read on 2026-11-20
14375
+ // (sha256 15c4978af1d2649f0bd7a10ea685c2bab1223116df919226194a23eb29708990).
14376
+ // Field order follows x-fal-order-properties. The input is open. The media
14377
+ // URL rule is the one free 422 probes confirmed on the four kling/v4 video
14378
+ // endpoints; this image route was not probed, because a rejected body can
14379
+ // still be billed. Images and elements combined must stay at or under 10;
14380
+ // that limit is documented and not checked here.
14381
+ // Docs: https://fal.ai/models/kling/v4/image-to-image/api
14382
+ export const FalKlingV4ImageToImageRequestSchema = z.object({
14383
+ prompt: z
14384
+ .string()
14385
+ .min(1)
14386
+ .max(50000)
14387
+ .describe("Text prompt. Reference images as @Image1, @Image2, ... and elements as @Element1, @Element2, ..."),
14388
+ image_urls: z
14389
+ .array(KlingV4MediaUrlSchema)
14390
+ .min(1)
14391
+ .max(10)
14392
+ .describe("Reference images (1-10).\n\nMax file size: 30.0MB, Min width: 300px, Min height: 300px, Min aspect ratio: 0.40, Max aspect ratio: 2.50, Timeout: 20.0s"),
14393
+ elements: z
14394
+ .array(KlingV4ImageElementSchema)
14395
+ .max(7)
14396
+ .nullable()
14397
+ .optional()
14398
+ .describe("Elements, referenced as @Element1, @Element2, ... (max 7). Images and elements combined must not exceed 10."),
14399
+ result_type: z
14400
+ .enum(["single", "series"])
14401
+ .default("single")
14402
+ .describe("'single' returns independent images; 'series' returns a coherent set of related images."),
14403
+ num_images: z
14404
+ .number()
14405
+ .int()
14406
+ .min(1)
14407
+ .max(9)
14408
+ .default(1)
14409
+ .describe("Number of independent images to generate (1-9). Only used when result_type is 'single'."),
14410
+ series_amount: z
14411
+ .union([z.number().int().min(2).max(10), z.literal("auto")])
14412
+ .default(4)
14413
+ .describe("Number of images in the series (2-10), or 'auto' to let the model choose. Only used when result_type is 'series'."),
14414
+ resolution: z
14415
+ .enum(["2K", "4K", "8K"])
14416
+ .default("2K")
14417
+ .describe("Output resolution."),
14418
+ aspect_ratio: z
14419
+ .enum(["auto", "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9"])
14420
+ .default("auto")
14421
+ .describe("Aspect ratio of generated images. 'auto' picks one from the input content."),
14422
+ sync_mode: z
14423
+ .boolean()
14424
+ .default(false)
14425
+ .describe("If `True`, the media will be returned as a data URI."),
14426
+ });
14427
+ // Pinned to the live queue OpenAPI read on 2026-11-20
14428
+ // (sha256 a6a499f3f677057d97bc6a9cc076c8b801a2323ce8250f85e3a9cf4fa9ad0c74).
14429
+ // Field order follows x-fal-order-properties. The input is open. llms.txt
14430
+ // still says $0.063 per units, matching the 2026-11-19 survey. This route
14431
+ // was not probed with a rejected body, because a rejection can still be billed.
14432
+ // Docs: https://fal.ai/models/kling/v4/text-to-image/api
14433
+ export const FalKlingV4TextToImageRequestSchema = z.object({
14434
+ prompt: z
14435
+ .string()
14436
+ .min(1)
14437
+ .max(50000)
14438
+ .describe("Text prompt for image generation."),
14439
+ result_type: z
14440
+ .enum(["single", "series"])
14441
+ .default("single")
14442
+ .describe("'single' returns independent images; 'series' returns a coherent set of related images."),
14443
+ num_images: z
14444
+ .number()
14445
+ .int()
14446
+ .min(1)
14447
+ .max(9)
14448
+ .default(1)
14449
+ .describe("Number of independent images to generate (1-9). Only used when result_type is 'single'."),
14450
+ series_amount: z
14451
+ .union([z.number().int().min(2).max(10), z.literal("auto")])
14452
+ .default(4)
14453
+ .describe("Number of images in the series (2-10), or 'auto' to let the model choose. Only used when result_type is 'series'."),
14454
+ resolution: z
14455
+ .enum(["2K", "4K", "8K"])
14456
+ .default("2K")
14457
+ .describe("Output resolution."),
14458
+ aspect_ratio: z
14459
+ .enum(["auto", "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9"])
14460
+ .default("auto")
14461
+ .describe("Aspect ratio of generated images. 'auto' picks one from the input content."),
14462
+ sync_mode: z
14463
+ .boolean()
14464
+ .default(false)
14465
+ .describe("If `True`, the media will be returned as a data URI."),
14466
+ });
14165
14467
  // Pinned to the live queue OpenAPI read on 2026-10-23
14166
14468
  // (sha256 896571542e77dada6cfd0bcabc34f17f1db6e4b7afdfa75784e8b3a72461bb05).
14167
14469
  // Field order follows x-fal-order-properties. The input is open; free 422
@@ -14248,6 +14550,8 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
14248
14550
  "fal-ai/heygen/v2/video-agent": FalHeygenV2VideoAgentRequestSchema,
14249
14551
  "kling/v4/video-to-video/edit": FalKlingV4VideoToVideoEditRequestSchema,
14250
14552
  "kling/v4/reference-to-video": FalKlingV4ReferenceToVideoRequestSchema,
14553
+ "kling/v4/image-to-image": FalKlingV4ImageToImageRequestSchema,
14554
+ "kling/v4/text-to-image": FalKlingV4TextToImageRequestSchema,
14251
14555
  "kling/v4/image-to-video": FalKlingV4ImageToVideoRequestSchema,
14252
14556
  "kling/v4/text-to-video": FalKlingV4TextToVideoRequestSchema,
14253
14557
  "fal-ai/heygen/v3/filler-word-removal": FalHeygenV3FillerWordRemovalRequestSchema,
@@ -14271,6 +14575,8 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
14271
14575
  "bytedance/seedance-2.5/us/draft/complete": FalBytedanceSeedance2p5UsDraftCompleteRequestSchema,
14272
14576
  "bytedance/seedance-2.5/us/reference-to-video": FalBytedanceSeedance2p5UsReferenceToVideoRequestSchema,
14273
14577
  "bytedance/seedance-2.5/us/image-to-video": FalBytedanceSeedance2p5UsImageToVideoRequestSchema,
14578
+ "bytedance/seedance-2.5/flash/image-to-video": FalBytedanceSeedance2p5FlashImageToVideoRequestSchema,
14579
+ "bytedance/seedance-2.5/flash/reference-to-video": FalBytedanceSeedance2p5FlashReferenceToVideoRequestSchema,
14274
14580
  "bytedance/seedance-2.5/us/text-to-video": FalBytedanceSeedance2p5UsTextToVideoRequestSchema,
14275
14581
  "bytedance/seedance-2.0/us/reference-to-video": FalBytedanceSeedance2p0UsReferenceToVideoRequestSchema,
14276
14582
  "bytedance/seedance-2.0/us/image-to-video": FalBytedanceSeedance2p0UsImageToVideoRequestSchema,
@@ -14467,6 +14773,7 @@ export const FAL_ENDPOINT_REQUEST_SCHEMAS = {
14467
14773
  "bytedance/seedream/v5/pro/layerize": FalSeedreamV5ProLayerizeRequestSchema,
14468
14774
  "bytedance/seedream/v5/pro/text-to-image": FalSeedreamV5ProTextToImageRequestSchema,
14469
14775
  "bytedance/seedream/v5/pro/edit": FalSeedreamV5ProEditRequestSchema,
14776
+ "bytedance/seedream/v5.5/edit": FalSeedreamV55EditRequestSchema,
14470
14777
  "fal-ai/bytedance/seed-speech/tts/v2": FalSeedSpeechTtsV2RequestSchema,
14471
14778
  "minimax/music-3": FalMinimaxMusic3RequestSchema,
14472
14779
  "fal-ai/elevenlabs/speech-to-text/scribe-v2": FalElevenlabsSpeechToTextScribeV2RequestSchema,