@fungi.computer/darkroom 0.7.0 → 0.8.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/README.md +49 -0
- package/dist/app-media-contracts.d.ts +103 -12
- package/dist/audio-providers/elevenlabs.d.ts +40 -0
- package/dist/audio-providers/elevenlabs.js +69 -0
- package/dist/audio-reference-types.d.ts +28 -0
- package/dist/audio-reference-types.js +16 -0
- package/dist/audio-references.d.ts +14 -0
- package/dist/audio-references.js +69 -0
- package/dist/cloudflare/provider.d.ts +6 -4
- package/dist/cloudflare/provider.js +37 -19
- package/dist/gateway-models.d.ts +12 -8
- package/dist/gateway-models.js +38 -17
- package/dist/index.d.ts +70 -15
- package/dist/index.js +118 -7
- package/dist/media-binding.d.ts +60 -7
- package/dist/media-binding.js +41 -19
- package/dist/media-generation.js +12 -3
- package/dist/media-operation-contract.d.ts +7 -3
- package/dist/media-operation-contract.js +6 -4
- package/dist/media-operation-owner.d.ts +2 -2
- package/dist/media-operation-owner.js +48 -6
- package/dist/media-operation.js +4 -2
- package/dist/model-catalog.d.ts +169 -4
- package/dist/model-catalog.js +180 -4
- package/dist/server.d.ts +14 -7
- package/dist/server.js +9 -4
- package/dist/video-providers/reference-encoding.d.ts +7 -2
- package/dist/video-providers/reference-encoding.js +14 -3
- package/dist/video-providers/types.d.ts +2 -2
- package/dist/video-providers/unified.d.ts +1 -0
- package/dist/video-providers/unified.js +4 -2
- package/docs/api/app-media-contracts.md +46 -10
- package/docs/api/cloudflare.md +3 -3
- package/docs/api/index.md +598 -84
- package/docs/api/server.md +129 -62
- package/package.json +3 -2
package/docs/api/index.md
CHANGED
|
@@ -23,14 +23,15 @@ Invalid generation settings or unsupported model parameters.
|
|
|
23
23
|
##### Constructor
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
new MediaSettingsError(message): MediaSettingsError;
|
|
26
|
+
new MediaSettingsError(message, options?): MediaSettingsError;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
###### Parameters
|
|
30
30
|
|
|
31
|
-
| Parameter
|
|
32
|
-
|
|
|
33
|
-
| `message`
|
|
31
|
+
| Parameter | Type |
|
|
32
|
+
| ---------- | -------------- |
|
|
33
|
+
| `message` | `string` |
|
|
34
|
+
| `options?` | `ErrorOptions` |
|
|
34
35
|
|
|
35
36
|
###### Returns
|
|
36
37
|
|
|
@@ -44,6 +45,36 @@ Error.constructor;
|
|
|
44
45
|
|
|
45
46
|
## Type Aliases
|
|
46
47
|
|
|
48
|
+
### MediaAudioReferenceBytes
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
type MediaAudioReferenceBytes = Readonly<{
|
|
52
|
+
bytes: Uint8Array;
|
|
53
|
+
mimeType: AudioReferenceMimeType;
|
|
54
|
+
durationSeconds: number;
|
|
55
|
+
filename?: string;
|
|
56
|
+
}>;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
One reference clip with the facts the provider request and the 30-second budget
|
|
60
|
+
need.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### AudioReferenceMimeType
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
type AudioReferenceMimeType =
|
|
68
|
+
"audio/mpeg" | "audio/mp4" | "audio/wav" | "audio/ogg";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Containers a clip may arrive in: `mp3`, `m4a`, `wav`, `ogg` and `opus` files.
|
|
72
|
+
Seedance 2.5 states only that clips are "base64 data:audio/... URIs" and does
|
|
73
|
+
not list formats, so Darkroom admits what the gallery plays.
|
|
74
|
+
https://developers.cloudflare.com/ai/models/bytedance/seedance-2.5/schema-input.json
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
47
78
|
### ImageParams
|
|
48
79
|
|
|
49
80
|
```ts
|
|
@@ -153,10 +184,11 @@ MIME type corresponding to a supported image encoding.
|
|
|
153
184
|
### MediaOutputFormat
|
|
154
185
|
|
|
155
186
|
```ts
|
|
156
|
-
type MediaOutputFormat = ImageFormat | "mp4";
|
|
187
|
+
type MediaOutputFormat = ImageFormat | "mp4" | "mp3";
|
|
157
188
|
```
|
|
158
189
|
|
|
159
|
-
A saved generation: an image,
|
|
190
|
+
A saved generation: an image, an MP4 from a video model, or an MP3 from an audio
|
|
191
|
+
model.
|
|
160
192
|
|
|
161
193
|
---
|
|
162
194
|
|
|
@@ -182,14 +214,16 @@ Decoded reference bytes and the dimensions sent to the provider.
|
|
|
182
214
|
type MediaGenerationSettings = Readonly<{
|
|
183
215
|
model: string;
|
|
184
216
|
prompt: string;
|
|
185
|
-
width
|
|
186
|
-
height
|
|
217
|
+
width?: number;
|
|
218
|
+
height?: number;
|
|
187
219
|
steps?: number;
|
|
188
220
|
durationSeconds?: number;
|
|
221
|
+
voiceId?: string;
|
|
189
222
|
resolution?: MediaVideoResolution;
|
|
190
223
|
aspectRatio?: MediaVideoAspectRatio;
|
|
191
224
|
generateAudio?: boolean;
|
|
192
225
|
references?: readonly MediaReference[];
|
|
226
|
+
audioReferences?: readonly MediaReference[];
|
|
193
227
|
}>;
|
|
194
228
|
```
|
|
195
229
|
|
|
@@ -205,6 +239,7 @@ type MediaProvider = (
|
|
|
205
239
|
references,
|
|
206
240
|
signal?,
|
|
207
241
|
outputFormat?,
|
|
242
|
+
audioReferences?,
|
|
208
243
|
) => Promise<
|
|
209
244
|
Readonly<{
|
|
210
245
|
bytes: Uint8Array;
|
|
@@ -218,12 +253,13 @@ out. Hosts may bind it to Workers AI or their own transport.
|
|
|
218
253
|
|
|
219
254
|
#### Parameters
|
|
220
255
|
|
|
221
|
-
| Parameter
|
|
222
|
-
|
|
|
223
|
-
| `settings`
|
|
224
|
-
| `references`
|
|
225
|
-
| `signal?`
|
|
226
|
-
| `outputFormat?`
|
|
256
|
+
| Parameter | Type |
|
|
257
|
+
| ------------------ | ------------------------------------------------------------------ |
|
|
258
|
+
| `settings` | [`MediaGenerationSettings`](#mediagenerationsettings) |
|
|
259
|
+
| `references` | readonly [`MediaReferenceBytes`](#mediareferencebytes)[] |
|
|
260
|
+
| `signal?` | `AbortSignal` |
|
|
261
|
+
| `outputFormat?` | `"png"` \| `"jpeg"` \| `"webp"` |
|
|
262
|
+
| `audioReferences?` | readonly [`MediaAudioReferenceBytes`](#mediaaudioreferencebytes)[] |
|
|
227
263
|
|
|
228
264
|
#### Returns
|
|
229
265
|
|
|
@@ -319,6 +355,18 @@ One path-only video reference.
|
|
|
319
355
|
|
|
320
356
|
---
|
|
321
357
|
|
|
358
|
+
### MediaAudioReferenceSelection
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
type MediaAudioReferenceSelection = z.output<
|
|
362
|
+
typeof mediaAudioReferenceSelectionSchema
|
|
363
|
+
>;
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
One path-only audio reference.
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
322
370
|
### MediaVideoSelectionInput
|
|
323
371
|
|
|
324
372
|
```ts
|
|
@@ -342,6 +390,7 @@ type MediaVideoSelection = Readonly<{
|
|
|
342
390
|
durationSeconds: number;
|
|
343
391
|
generateAudio?: boolean;
|
|
344
392
|
references?: readonly Readonly<MediaVideoReference>[];
|
|
393
|
+
audioReferences?: readonly Readonly<MediaAudioReferenceSelection>[];
|
|
345
394
|
}>;
|
|
346
395
|
```
|
|
347
396
|
|
|
@@ -350,6 +399,16 @@ hydration.
|
|
|
350
399
|
|
|
351
400
|
---
|
|
352
401
|
|
|
402
|
+
### MediaAudioSelectionInput
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
type MediaAudioSelectionInput = z.input<typeof mediaAudioSelectionSchema>;
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
Caller audio selection before defaults and model-specific refinements.
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
353
412
|
### MediaReferenceReader
|
|
354
413
|
|
|
355
414
|
```ts
|
|
@@ -565,6 +624,36 @@ Immutable video capability and price metadata.
|
|
|
565
624
|
|
|
566
625
|
---
|
|
567
626
|
|
|
627
|
+
### MediaAudioModelId
|
|
628
|
+
|
|
629
|
+
```ts
|
|
630
|
+
type MediaAudioModelId = z.output<typeof mediaAudioModelIdSchema>;
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
Verified audio model identifier.
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
### MediaAudioVoice
|
|
638
|
+
|
|
639
|
+
```ts
|
|
640
|
+
type MediaAudioVoice = z.output<typeof mediaAudioVoiceSchema>;
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
One premade speech voice.
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
### MediaAudioModel
|
|
648
|
+
|
|
649
|
+
```ts
|
|
650
|
+
type MediaAudioModel = z.output<typeof mediaAudioSchema>;
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
Immutable audio capability and price metadata.
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
568
657
|
### MediaModelInput
|
|
569
658
|
|
|
570
659
|
```ts
|
|
@@ -603,8 +692,46 @@ type MediaCatalogue = readonly MediaCatalogueModel[];
|
|
|
603
692
|
|
|
604
693
|
One provider's model list: the typed bounds every request is checked against.
|
|
605
694
|
|
|
695
|
+
---
|
|
696
|
+
|
|
697
|
+
### MediaPictureModel
|
|
698
|
+
|
|
699
|
+
```ts
|
|
700
|
+
type MediaPictureModel = Omit<MediaModel, "kind" | "audio"> & object;
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
A catalog entry that is a picture or video model.
|
|
704
|
+
|
|
705
|
+
#### Type Declaration
|
|
706
|
+
|
|
707
|
+
| Name | Type | Description |
|
|
708
|
+
| ------- | ---------------------- | --------------------------------------------- |
|
|
709
|
+
| `kind` | `"image"` \| `"video"` | Still-image or video generation; never audio. |
|
|
710
|
+
| `audio` | `null` | Always null for a picture or video model. |
|
|
711
|
+
|
|
606
712
|
## Variables
|
|
607
713
|
|
|
714
|
+
### MAX\_AUDIO\_REFERENCE\_BYTES
|
|
715
|
+
|
|
716
|
+
```ts
|
|
717
|
+
const MAX_AUDIO_REFERENCE_BYTES: number;
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
Decoded bytes of one reference clip: well past 30 seconds of any admitted
|
|
721
|
+
container.
|
|
722
|
+
|
|
723
|
+
---
|
|
724
|
+
|
|
725
|
+
### MAX\_AUDIO\_REFERENCE\_BODY\_BYTES
|
|
726
|
+
|
|
727
|
+
```ts
|
|
728
|
+
const MAX_AUDIO_REFERENCE_BODY_BYTES: number;
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
Decoded bytes across every clip of one request; base64 adds a third.
|
|
732
|
+
|
|
733
|
+
---
|
|
734
|
+
|
|
608
735
|
### mediaFailureStageSchema
|
|
609
736
|
|
|
610
737
|
```ts
|
|
@@ -690,6 +817,17 @@ Maximum retained still-image output bytes.
|
|
|
690
817
|
|
|
691
818
|
---
|
|
692
819
|
|
|
820
|
+
### MAX\_AUDIO\_REFERENCE\_COUNT
|
|
821
|
+
|
|
822
|
+
```ts
|
|
823
|
+
const MAX_AUDIO_REFERENCE_COUNT: 10 = 10;
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
Schema ceiling for audio reference lists; each model's own `audioReferences.max`
|
|
827
|
+
is enforced after parsing.
|
|
828
|
+
|
|
829
|
+
---
|
|
830
|
+
|
|
693
831
|
### mediaGenerationSettingsSchema
|
|
694
832
|
|
|
695
833
|
```ts
|
|
@@ -697,10 +835,11 @@ const mediaGenerationSettingsSchema: ZodObject<
|
|
|
697
835
|
{
|
|
698
836
|
model: ZodString;
|
|
699
837
|
prompt: ZodString;
|
|
700
|
-
width: ZodNumber
|
|
701
|
-
height: ZodNumber
|
|
838
|
+
width: ZodOptional<ZodNumber>;
|
|
839
|
+
height: ZodOptional<ZodNumber>;
|
|
702
840
|
steps: ZodOptional<ZodNumber>;
|
|
703
841
|
durationSeconds: ZodOptional<ZodNumber>;
|
|
842
|
+
voiceId: ZodOptional<ZodString>;
|
|
704
843
|
resolution: ZodOptional<
|
|
705
844
|
ZodEnum<{
|
|
706
845
|
p480: "480p";
|
|
@@ -740,6 +879,17 @@ const mediaGenerationSettingsSchema: ZodObject<
|
|
|
740
879
|
>
|
|
741
880
|
>
|
|
742
881
|
>;
|
|
882
|
+
audioReferences: ZodOptional<
|
|
883
|
+
ZodArray<
|
|
884
|
+
ZodObject<
|
|
885
|
+
{
|
|
886
|
+
computerId: ZodString;
|
|
887
|
+
path: ZodString;
|
|
888
|
+
},
|
|
889
|
+
$strict
|
|
890
|
+
>
|
|
891
|
+
>
|
|
892
|
+
>;
|
|
743
893
|
},
|
|
744
894
|
$strict
|
|
745
895
|
>;
|
|
@@ -756,10 +906,11 @@ const mediaGenerationSelectionSchema: ZodObject<
|
|
|
756
906
|
{
|
|
757
907
|
model: ZodString;
|
|
758
908
|
prompt: ZodString;
|
|
759
|
-
width: ZodNumber
|
|
760
|
-
height: ZodNumber
|
|
909
|
+
width: ZodOptional<ZodNumber>;
|
|
910
|
+
height: ZodOptional<ZodNumber>;
|
|
761
911
|
steps: ZodOptional<ZodNumber>;
|
|
762
912
|
durationSeconds: ZodOptional<ZodNumber>;
|
|
913
|
+
voiceId: ZodOptional<ZodString>;
|
|
763
914
|
resolution: ZodOptional<
|
|
764
915
|
ZodEnum<{
|
|
765
916
|
p480: "480p";
|
|
@@ -799,6 +950,17 @@ const mediaGenerationSelectionSchema: ZodObject<
|
|
|
799
950
|
>
|
|
800
951
|
>
|
|
801
952
|
>;
|
|
953
|
+
audioReferences: ZodOptional<
|
|
954
|
+
ZodArray<
|
|
955
|
+
ZodObject<
|
|
956
|
+
{
|
|
957
|
+
computerId: ZodOptional<ZodString>;
|
|
958
|
+
path: ZodString;
|
|
959
|
+
},
|
|
960
|
+
$strict
|
|
961
|
+
>
|
|
962
|
+
>
|
|
963
|
+
>;
|
|
802
964
|
},
|
|
803
965
|
$strict
|
|
804
966
|
>;
|
|
@@ -830,6 +992,23 @@ Path-only video reference; the host supplies authority and reads its bytes.
|
|
|
830
992
|
|
|
831
993
|
---
|
|
832
994
|
|
|
995
|
+
### mediaAudioReferenceSelectionSchema
|
|
996
|
+
|
|
997
|
+
```ts
|
|
998
|
+
const mediaAudioReferenceSelectionSchema: ZodLazy<
|
|
999
|
+
ZodObject<
|
|
1000
|
+
{
|
|
1001
|
+
path: ZodString;
|
|
1002
|
+
},
|
|
1003
|
+
$strict
|
|
1004
|
+
>
|
|
1005
|
+
>;
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
Path-only audio reference; the host supplies authority and reads its bytes.
|
|
1009
|
+
|
|
1010
|
+
---
|
|
1011
|
+
|
|
833
1012
|
### mediaVideoSelectionSchema
|
|
834
1013
|
|
|
835
1014
|
```ts
|
|
@@ -885,6 +1064,18 @@ const mediaVideoSelectionSchema: ZodLazy<
|
|
|
885
1064
|
>
|
|
886
1065
|
>
|
|
887
1066
|
>;
|
|
1067
|
+
audioReferences: ZodOptional<
|
|
1068
|
+
ZodArray<
|
|
1069
|
+
ZodLazy<
|
|
1070
|
+
ZodObject<
|
|
1071
|
+
{
|
|
1072
|
+
path: ZodString;
|
|
1073
|
+
},
|
|
1074
|
+
$strict
|
|
1075
|
+
>
|
|
1076
|
+
>
|
|
1077
|
+
>
|
|
1078
|
+
>;
|
|
888
1079
|
},
|
|
889
1080
|
$strict
|
|
890
1081
|
>
|
|
@@ -896,6 +1087,31 @@ validateMediaVideoSelection.
|
|
|
896
1087
|
|
|
897
1088
|
---
|
|
898
1089
|
|
|
1090
|
+
### mediaAudioSelectionSchema
|
|
1091
|
+
|
|
1092
|
+
```ts
|
|
1093
|
+
const mediaAudioSelectionSchema: ZodLazy<
|
|
1094
|
+
ZodObject<
|
|
1095
|
+
{
|
|
1096
|
+
model: ZodEnum<{
|
|
1097
|
+
multilingual: "elevenlabs/eleven-multilingual-v2";
|
|
1098
|
+
v3: "elevenlabs/eleven-v3";
|
|
1099
|
+
music: "elevenlabs/music-v2";
|
|
1100
|
+
}>;
|
|
1101
|
+
prompt: ZodString;
|
|
1102
|
+
voiceId: ZodOptional<ZodString>;
|
|
1103
|
+
durationSeconds: ZodOptional<ZodNumber>;
|
|
1104
|
+
},
|
|
1105
|
+
$strict
|
|
1106
|
+
>
|
|
1107
|
+
>;
|
|
1108
|
+
```
|
|
1109
|
+
|
|
1110
|
+
Neutral audio selection: speech takes a voice, music a length; model-specific
|
|
1111
|
+
limits are checked by validateMediaGenerationSettings.
|
|
1112
|
+
|
|
1113
|
+
---
|
|
1114
|
+
|
|
899
1115
|
### mediaProviderWireSchema
|
|
900
1116
|
|
|
901
1117
|
```ts
|
|
@@ -983,7 +1199,8 @@ const mediaModelInputSchema: ZodLazy<
|
|
|
983
1199
|
>;
|
|
984
1200
|
```
|
|
985
1201
|
|
|
986
|
-
Media's provider catalog: Workers AI images plus gateway image and
|
|
1202
|
+
Media's provider catalog: Workers AI images plus gateway image, video and audio
|
|
1203
|
+
models.
|
|
987
1204
|
|
|
988
1205
|
---
|
|
989
1206
|
|
|
@@ -1150,6 +1367,10 @@ const mediaVideoSchema: ZodLazy<ZodReadonly<ZodObject<{
|
|
|
1150
1367
|
p1080: "1080p";
|
|
1151
1368
|
p4k: "4k";
|
|
1152
1369
|
}>>>;
|
|
1370
|
+
audioReferences: ZodNullable<ZodReadonly<ZodObject<{
|
|
1371
|
+
max: ZodNumber;
|
|
1372
|
+
totalSeconds: ZodNumber;
|
|
1373
|
+
}, $strict>>>;
|
|
1153
1374
|
prices: ZodReadonly<ZodArray<ZodReadonly<ZodObject<{
|
|
1154
1375
|
resolution: ZodEnum<{
|
|
1155
1376
|
p480: ...;
|
|
@@ -1168,6 +1389,107 @@ Verified video parameters and provider costs, checked 2026-10-11.
|
|
|
1168
1389
|
|
|
1169
1390
|
---
|
|
1170
1391
|
|
|
1392
|
+
### mediaAudioModelIdSchema
|
|
1393
|
+
|
|
1394
|
+
```ts
|
|
1395
|
+
const mediaAudioModelIdSchema: ZodEnum<{
|
|
1396
|
+
multilingual: "elevenlabs/eleven-multilingual-v2";
|
|
1397
|
+
v3: "elevenlabs/eleven-v3";
|
|
1398
|
+
music: "elevenlabs/music-v2";
|
|
1399
|
+
}>;
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
Verified ElevenLabs model identifiers on Cloudflare's Unified Billing, from the
|
|
1403
|
+
model pages under https://developers.cloudflare.com/ai/models/elevenlabs/
|
|
1404
|
+
(checked 2026-11-13). Cloudflare offers no sound-effects model. Eleven Flash
|
|
1405
|
+
v2.5 and Turbo v2.5 are listed there but a live Unified Billing call to Flash
|
|
1406
|
+
answered 403 code 2047 ("not available via unified billing. Please use BYOK"),
|
|
1407
|
+
so they are not offered. Multilingual v2 is the default voice model.
|
|
1408
|
+
|
|
1409
|
+
---
|
|
1410
|
+
|
|
1411
|
+
### mediaAudioVoiceSchema
|
|
1412
|
+
|
|
1413
|
+
```ts
|
|
1414
|
+
const mediaAudioVoiceSchema: ZodLazy<
|
|
1415
|
+
ZodReadonly<
|
|
1416
|
+
ZodObject<
|
|
1417
|
+
{
|
|
1418
|
+
id: ZodString;
|
|
1419
|
+
label: ZodString;
|
|
1420
|
+
},
|
|
1421
|
+
$strict
|
|
1422
|
+
>
|
|
1423
|
+
>
|
|
1424
|
+
>;
|
|
1425
|
+
```
|
|
1426
|
+
|
|
1427
|
+
One premade voice a speech model may speak with.
|
|
1428
|
+
|
|
1429
|
+
---
|
|
1430
|
+
|
|
1431
|
+
### mediaAudioSchema
|
|
1432
|
+
|
|
1433
|
+
```ts
|
|
1434
|
+
const mediaAudioSchema: ZodLazy<
|
|
1435
|
+
ZodReadonly<
|
|
1436
|
+
ZodObject<
|
|
1437
|
+
{
|
|
1438
|
+
provider: ZodLiteral<"elevenlabs">;
|
|
1439
|
+
mode: ZodEnum<{
|
|
1440
|
+
speech: "speech";
|
|
1441
|
+
music: "music";
|
|
1442
|
+
}>;
|
|
1443
|
+
voices: ZodReadonly<
|
|
1444
|
+
ZodArray<
|
|
1445
|
+
ZodLazy<
|
|
1446
|
+
ZodReadonly<
|
|
1447
|
+
ZodObject<
|
|
1448
|
+
{
|
|
1449
|
+
id: ZodString;
|
|
1450
|
+
label: ZodString;
|
|
1451
|
+
},
|
|
1452
|
+
$strict
|
|
1453
|
+
>
|
|
1454
|
+
>
|
|
1455
|
+
>
|
|
1456
|
+
>
|
|
1457
|
+
>;
|
|
1458
|
+
defaultVoiceId: ZodNullable<ZodString>;
|
|
1459
|
+
seconds: ZodNullable<
|
|
1460
|
+
ZodReadonly<
|
|
1461
|
+
ZodObject<
|
|
1462
|
+
{
|
|
1463
|
+
min: ZodNumber;
|
|
1464
|
+
max: ZodNumber;
|
|
1465
|
+
default: ZodNumber;
|
|
1466
|
+
},
|
|
1467
|
+
$strict
|
|
1468
|
+
>
|
|
1469
|
+
>
|
|
1470
|
+
>;
|
|
1471
|
+
milliunitsPerUnit: ZodNumber;
|
|
1472
|
+
},
|
|
1473
|
+
$strict
|
|
1474
|
+
>
|
|
1475
|
+
>
|
|
1476
|
+
>;
|
|
1477
|
+
```
|
|
1478
|
+
|
|
1479
|
+
Verified audio parameters and provider cost, checked 2026-11-13.
|
|
1480
|
+
|
|
1481
|
+
---
|
|
1482
|
+
|
|
1483
|
+
### AUDIO\_CHARACTER\_BLOCK
|
|
1484
|
+
|
|
1485
|
+
```ts
|
|
1486
|
+
const AUDIO_CHARACTER_BLOCK: 100 = 100;
|
|
1487
|
+
```
|
|
1488
|
+
|
|
1489
|
+
Characters one speech billing block covers.
|
|
1490
|
+
|
|
1491
|
+
---
|
|
1492
|
+
|
|
1171
1493
|
### MAX\_MEDIA\_PROMPT\_LENGTH
|
|
1172
1494
|
|
|
1173
1495
|
```ts
|
|
@@ -1188,6 +1510,7 @@ const mediaModelSchema: ZodReadonly<ZodObject<{
|
|
|
1188
1510
|
kind: ZodEnum<{
|
|
1189
1511
|
image: "image";
|
|
1190
1512
|
video: "video";
|
|
1513
|
+
audio: "audio";
|
|
1191
1514
|
}>;
|
|
1192
1515
|
tier: ZodEnum<{
|
|
1193
1516
|
draft: "draft";
|
|
@@ -1262,8 +1585,20 @@ const mediaModelSchema: ZodReadonly<ZodObject<{
|
|
|
1262
1585
|
referenceRoles: ZodReadonly<ZodArray<ZodEnum<...>>>;
|
|
1263
1586
|
maxReferenceImages: ZodNumber;
|
|
1264
1587
|
referenceResolutions: ZodReadonly<ZodArray<ZodEnum<...>>>;
|
|
1588
|
+
audioReferences: ZodNullable<ZodReadonly<ZodObject<..., ...>>>;
|
|
1265
1589
|
prices: ZodReadonly<ZodArray<ZodReadonly<...>>>;
|
|
1266
1590
|
}, $strict>>>>;
|
|
1591
|
+
audio: ZodNullable<ZodLazy<ZodReadonly<ZodObject<{
|
|
1592
|
+
provider: ZodLiteral<"elevenlabs">;
|
|
1593
|
+
mode: ZodEnum<{
|
|
1594
|
+
speech: "speech";
|
|
1595
|
+
music: "music";
|
|
1596
|
+
}>;
|
|
1597
|
+
voices: ZodReadonly<ZodArray<ZodLazy<...>>>;
|
|
1598
|
+
defaultVoiceId: ZodNullable<ZodString>;
|
|
1599
|
+
seconds: ZodNullable<ZodReadonly<ZodObject<..., ...>>>;
|
|
1600
|
+
milliunitsPerUnit: ZodNumber;
|
|
1601
|
+
}, $strict>>>>;
|
|
1267
1602
|
}, $strict>>;
|
|
1268
1603
|
```
|
|
1269
1604
|
|
|
@@ -1277,7 +1612,7 @@ Public wire grammar for a catalog entry returned by the Media owner.
|
|
|
1277
1612
|
const mediaModels: readonly MediaModel[] = models;
|
|
1278
1613
|
```
|
|
1279
1614
|
|
|
1280
|
-
The Fungi gateway provider's own immutable image and
|
|
1615
|
+
The Fungi gateway provider's own immutable image, video and audio model catalog.
|
|
1281
1616
|
|
|
1282
1617
|
---
|
|
1283
1618
|
|
|
@@ -1290,6 +1625,7 @@ const mediaCatalogueModelSchema: ZodReadonly<ZodObject<{
|
|
|
1290
1625
|
kind: ZodEnum<{
|
|
1291
1626
|
image: "image";
|
|
1292
1627
|
video: "video";
|
|
1628
|
+
audio: "audio";
|
|
1293
1629
|
}>;
|
|
1294
1630
|
tier: ZodEnum<{
|
|
1295
1631
|
draft: "draft";
|
|
@@ -1332,6 +1668,17 @@ const mediaCatalogueModelSchema: ZodReadonly<ZodObject<{
|
|
|
1332
1668
|
}>;
|
|
1333
1669
|
}, $strict>>>;
|
|
1334
1670
|
sizes: ZodNullable<ZodReadonly<ZodArray<ZodString>>>;
|
|
1671
|
+
audio: ZodDefault<ZodNullable<ZodReadonly<ZodObject<{
|
|
1672
|
+
provider: ZodLiteral<"elevenlabs">;
|
|
1673
|
+
mode: ZodEnum<{
|
|
1674
|
+
speech: "speech";
|
|
1675
|
+
music: "music";
|
|
1676
|
+
}>;
|
|
1677
|
+
voices: ZodReadonly<ZodArray<ZodLazy<...>>>;
|
|
1678
|
+
defaultVoiceId: ZodNullable<ZodString>;
|
|
1679
|
+
seconds: ZodNullable<ZodReadonly<ZodObject<..., ...>>>;
|
|
1680
|
+
milliunitsPerUnit: ZodNumber;
|
|
1681
|
+
}, $strict>>>>;
|
|
1335
1682
|
video: ZodNullable<ZodReadonly<ZodObject<{
|
|
1336
1683
|
minSeconds: ZodNumber;
|
|
1337
1684
|
maxSeconds: ZodNumber;
|
|
@@ -1370,6 +1717,7 @@ const mediaCatalogueModelSchema: ZodReadonly<ZodObject<{
|
|
|
1370
1717
|
p4k: ...;
|
|
1371
1718
|
}>>>;
|
|
1372
1719
|
prices: ZodReadonly<ZodArray<ZodReadonly<ZodObject<..., ...>>>>;
|
|
1720
|
+
audioReferences: ZodDefault<ZodNullable<ZodReadonly<ZodObject<..., ...>>>>;
|
|
1373
1721
|
provider: ZodEnum<{
|
|
1374
1722
|
seedance: "seedance";
|
|
1375
1723
|
veo: "veo";
|
|
@@ -1395,6 +1743,7 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1395
1743
|
kind: ZodEnum<{
|
|
1396
1744
|
image: "image";
|
|
1397
1745
|
video: "video";
|
|
1746
|
+
audio: "audio";
|
|
1398
1747
|
}>;
|
|
1399
1748
|
tier: ZodEnum<{
|
|
1400
1749
|
draft: "draft";
|
|
@@ -1437,6 +1786,14 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1437
1786
|
}>;
|
|
1438
1787
|
}, $strict>>>;
|
|
1439
1788
|
sizes: ZodNullable<ZodReadonly<ZodArray<ZodString>>>;
|
|
1789
|
+
audio: ZodDefault<ZodNullable<ZodReadonly<ZodObject<{
|
|
1790
|
+
provider: ZodLiteral<...>;
|
|
1791
|
+
mode: ZodEnum<...>;
|
|
1792
|
+
voices: ZodReadonly<...>;
|
|
1793
|
+
defaultVoiceId: ZodNullable<...>;
|
|
1794
|
+
seconds: ZodNullable<...>;
|
|
1795
|
+
milliunitsPerUnit: ZodNumber;
|
|
1796
|
+
}, $strict>>>>;
|
|
1440
1797
|
video: ZodNullable<ZodReadonly<ZodObject<{
|
|
1441
1798
|
minSeconds: ZodNumber;
|
|
1442
1799
|
maxSeconds: ZodNumber;
|
|
@@ -1465,6 +1822,7 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1465
1822
|
maxReferenceImages: ZodNumber;
|
|
1466
1823
|
referenceResolutions: ZodReadonly<ZodArray<...>>;
|
|
1467
1824
|
prices: ZodReadonly<ZodArray<...>>;
|
|
1825
|
+
audioReferences: ZodDefault<ZodNullable<...>>;
|
|
1468
1826
|
provider: ZodEnum<{
|
|
1469
1827
|
seedance: ...;
|
|
1470
1828
|
veo: ...;
|
|
@@ -1475,7 +1833,7 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1475
1833
|
}, $strict>>>, ZodTransform<MediaCatalogue, Readonly<{
|
|
1476
1834
|
id: string;
|
|
1477
1835
|
label: string;
|
|
1478
|
-
kind: "image" | "video";
|
|
1836
|
+
kind: "image" | "video" | "audio";
|
|
1479
1837
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
1480
1838
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
1481
1839
|
maxPromptLength: number;
|
|
@@ -1495,6 +1853,23 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1495
1853
|
referenceFormat: "png" | "webp";
|
|
1496
1854
|
}>;
|
|
1497
1855
|
sizes: readonly string[] | null;
|
|
1856
|
+
audio: | Readonly<{
|
|
1857
|
+
provider: "elevenlabs";
|
|
1858
|
+
mode: "music" | "speech";
|
|
1859
|
+
voices: readonly Readonly<{
|
|
1860
|
+
id: ...;
|
|
1861
|
+
label: ...;
|
|
1862
|
+
}>[];
|
|
1863
|
+
defaultVoiceId: string | null;
|
|
1864
|
+
seconds: | Readonly<{
|
|
1865
|
+
min: ...;
|
|
1866
|
+
max: ...;
|
|
1867
|
+
default: ...;
|
|
1868
|
+
}>
|
|
1869
|
+
| null;
|
|
1870
|
+
milliunitsPerUnit: number;
|
|
1871
|
+
}>
|
|
1872
|
+
| null;
|
|
1498
1873
|
video: | Readonly<{
|
|
1499
1874
|
minSeconds: number;
|
|
1500
1875
|
maxSeconds: number;
|
|
@@ -1518,6 +1893,11 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1518
1893
|
silentMilliunitsPerSecond: ...;
|
|
1519
1894
|
audioMilliunitsPerSecond: ...;
|
|
1520
1895
|
}>[];
|
|
1896
|
+
audioReferences: | Readonly<{
|
|
1897
|
+
max: ...;
|
|
1898
|
+
totalSeconds: ...;
|
|
1899
|
+
}>
|
|
1900
|
+
| null;
|
|
1521
1901
|
provider: "seedance" | "veo" | "minimax" | "host";
|
|
1522
1902
|
}>
|
|
1523
1903
|
| null;
|
|
@@ -1583,6 +1963,40 @@ Quote the same estimate in milliunits (1 cent = 1,000 milliunits).
|
|
|
1583
1963
|
|
|
1584
1964
|
---
|
|
1585
1965
|
|
|
1966
|
+
### mediaSettingsInput()
|
|
1967
|
+
|
|
1968
|
+
```ts
|
|
1969
|
+
function mediaSettingsInput(settings): object;
|
|
1970
|
+
```
|
|
1971
|
+
|
|
1972
|
+
Mutable caller input for already-normalized settings, so they can be validated
|
|
1973
|
+
again.
|
|
1974
|
+
|
|
1975
|
+
#### Parameters
|
|
1976
|
+
|
|
1977
|
+
| Parameter | Type |
|
|
1978
|
+
| ---------- | ----------------------------------------------------- |
|
|
1979
|
+
| `settings` | [`MediaGenerationSettings`](#mediagenerationsettings) |
|
|
1980
|
+
|
|
1981
|
+
#### Returns
|
|
1982
|
+
|
|
1983
|
+
| Name | Type | Description |
|
|
1984
|
+
| ------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
1985
|
+
| `model` | `string` | Provider catalog model identifier. |
|
|
1986
|
+
| `prompt` | `string` | Generation prompt; each model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
1987
|
+
| `width?` | `number` | Requested image width or nominal video selector; absent for audio. |
|
|
1988
|
+
| `height?` | `number` | Requested image height or nominal video selector; absent for audio. |
|
|
1989
|
+
| `steps?` | `number` | Model-specific inference step count. |
|
|
1990
|
+
| `durationSeconds?` | `number` | Requested video or music length in whole seconds. |
|
|
1991
|
+
| `voiceId?` | `string` | Speech models only: a premade voice from the catalog; the default when omitted. |
|
|
1992
|
+
| `resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | Video resolution; must match the nominal width/height selector. |
|
|
1993
|
+
| `aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | Video aspect; must match the nominal width/height selector. |
|
|
1994
|
+
| `generateAudio?` | `boolean` | Video audio selection. |
|
|
1995
|
+
| `references?` | `object`[] | Host-authorized reference images. |
|
|
1996
|
+
| `audioReferences?` | `object`[] | Host-authorized reference audio clips; only a model declaring `audioReferences` takes them. |
|
|
1997
|
+
|
|
1998
|
+
---
|
|
1999
|
+
|
|
1586
2000
|
### validateMediaGenerationSettings()
|
|
1587
2001
|
|
|
1588
2002
|
```ts
|
|
@@ -1597,20 +2011,22 @@ Validate caller settings against `catalogue`, the active provider's model list
|
|
|
1597
2011
|
|
|
1598
2012
|
#### Parameters
|
|
1599
2013
|
|
|
1600
|
-
| Parameter | Type
|
|
1601
|
-
| ---------------------- |
|
|
1602
|
-
| `raw` | \{ `model`: `string`; `prompt`: `string`; `width
|
|
1603
|
-
| `raw.model` | `string`
|
|
1604
|
-
| `raw.prompt` | `string`
|
|
1605
|
-
| `raw.width
|
|
1606
|
-
| `raw.height
|
|
1607
|
-
| `raw.steps?` | `number`
|
|
1608
|
-
| `raw.durationSeconds?` | `number`
|
|
1609
|
-
| `raw.
|
|
1610
|
-
| `raw.
|
|
1611
|
-
| `raw.
|
|
1612
|
-
| `raw.
|
|
1613
|
-
| `
|
|
2014
|
+
| Parameter | Type | Default value | Description |
|
|
2015
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------- |
|
|
2016
|
+
| `raw` | \{ `model`: `string`; `prompt`: `string`; `width?`: `number`; `height?`: `number`; `steps?`: `number`; `durationSeconds?`: `number`; `voiceId?`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: `object`[]; `audioReferences?`: `object`[]; \} | `undefined` | - |
|
|
2017
|
+
| `raw.model` | `string` | `...` | Provider catalog model identifier. |
|
|
2018
|
+
| `raw.prompt` | `string` | `...` | Generation prompt; each model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
2019
|
+
| `raw.width?` | `number` | `...` | Requested image width or nominal video selector; absent for audio. |
|
|
2020
|
+
| `raw.height?` | `number` | `...` | Requested image height or nominal video selector; absent for audio. |
|
|
2021
|
+
| `raw.steps?` | `number` | `...` | Model-specific inference step count. |
|
|
2022
|
+
| `raw.durationSeconds?` | `number` | `...` | Requested video or music length in whole seconds. |
|
|
2023
|
+
| `raw.voiceId?` | `string` | `...` | Speech models only: a premade voice from the catalog; the default when omitted. |
|
|
2024
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | `...` | Video resolution; must match the nominal width/height selector. |
|
|
2025
|
+
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | `...` | Video aspect; must match the nominal width/height selector. |
|
|
2026
|
+
| `raw.generateAudio?` | `boolean` | `...` | Video audio selection. |
|
|
2027
|
+
| `raw.references?` | `object`[] | `...` | Host-authorized reference images. |
|
|
2028
|
+
| `raw.audioReferences?` | `object`[] | `...` | Host-authorized reference audio clips; only a model declaring `audioReferences` takes them. |
|
|
2029
|
+
| `catalogue` | [`MediaCatalogue`](#mediacatalogue) | `mediaModels` | - |
|
|
1614
2030
|
|
|
1615
2031
|
#### Returns
|
|
1616
2032
|
|
|
@@ -1624,32 +2040,36 @@ Validate caller settings against `catalogue`, the active provider's model list
|
|
|
1624
2040
|
function validateMediaGenerationSelection(
|
|
1625
2041
|
raw,
|
|
1626
2042
|
catalogue?,
|
|
1627
|
-
): Readonly<
|
|
2043
|
+
): Readonly<
|
|
2044
|
+
Omit<MediaGenerationSettings, "references" | "audioReferences"> & object
|
|
2045
|
+
>;
|
|
1628
2046
|
```
|
|
1629
2047
|
|
|
1630
2048
|
Validate selections without granting Computer authority.
|
|
1631
2049
|
|
|
1632
2050
|
#### Parameters
|
|
1633
2051
|
|
|
1634
|
-
| Parameter | Type
|
|
1635
|
-
| ---------------------- |
|
|
1636
|
-
| `raw` | \{ `model`: `string`; `prompt`: `string`; `width
|
|
1637
|
-
| `raw.model` | `string`
|
|
1638
|
-
| `raw.prompt` | `string`
|
|
1639
|
-
| `raw.width
|
|
1640
|
-
| `raw.height
|
|
1641
|
-
| `raw.steps?` | `number`
|
|
1642
|
-
| `raw.durationSeconds?` | `number`
|
|
1643
|
-
| `raw.
|
|
1644
|
-
| `raw.
|
|
1645
|
-
| `raw.
|
|
1646
|
-
| `raw.
|
|
1647
|
-
| `
|
|
2052
|
+
| Parameter | Type | Default value | Description |
|
|
2053
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------- |
|
|
2054
|
+
| `raw` | \{ `model`: `string`; `prompt`: `string`; `width?`: `number`; `height?`: `number`; `steps?`: `number`; `durationSeconds?`: `number`; `voiceId?`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: `object`[]; `audioReferences?`: `object`[]; \} | `undefined` | - |
|
|
2055
|
+
| `raw.model` | `string` | `...` | Provider catalog model identifier. |
|
|
2056
|
+
| `raw.prompt` | `string` | `...` | Generation prompt; each model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
2057
|
+
| `raw.width?` | `number` | `...` | Requested image width or nominal video selector; absent for audio. |
|
|
2058
|
+
| `raw.height?` | `number` | `...` | Requested image height or nominal video selector; absent for audio. |
|
|
2059
|
+
| `raw.steps?` | `number` | `...` | Model-specific inference step count. |
|
|
2060
|
+
| `raw.durationSeconds?` | `number` | `...` | Requested video or music length in whole seconds. |
|
|
2061
|
+
| `raw.voiceId?` | `string` | `...` | Speech models only: a premade voice from the catalog; the default when omitted. |
|
|
2062
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | `...` | Video resolution; must match the nominal width/height selector. |
|
|
2063
|
+
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | `...` | Video aspect; must match the nominal width/height selector. |
|
|
2064
|
+
| `raw.generateAudio?` | `boolean` | `...` | Video audio selection. |
|
|
2065
|
+
| `raw.references?` | `object`[] | `...` | Host-authorized reference images. |
|
|
2066
|
+
| `raw.audioReferences?` | `object`[] | `...` | Host-authorized reference audio clips. |
|
|
2067
|
+
| `catalogue` | [`MediaCatalogue`](#mediacatalogue) | `mediaModels` | - |
|
|
1648
2068
|
|
|
1649
2069
|
#### Returns
|
|
1650
2070
|
|
|
1651
2071
|
`Readonly`\<`Omit`\<[`MediaGenerationSettings`](#mediagenerationsettings),
|
|
1652
|
-
`"references"`\> & `object`\>
|
|
2072
|
+
`"references"` \| `"audioReferences"`\> & `object`\>
|
|
1653
2073
|
|
|
1654
2074
|
---
|
|
1655
2075
|
|
|
@@ -1664,17 +2084,18 @@ or billing admission.
|
|
|
1664
2084
|
|
|
1665
2085
|
#### Parameters
|
|
1666
2086
|
|
|
1667
|
-
| Parameter | Type
|
|
1668
|
-
| ---------------------- |
|
|
1669
|
-
| `raw` | \{ `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; `model`: `string`; \} | `undefined` | - |
|
|
1670
|
-
| `raw.prompt` | `string`
|
|
1671
|
-
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`
|
|
1672
|
-
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`
|
|
1673
|
-
| `raw.durationSeconds?` | `number`
|
|
1674
|
-
| `raw.generateAudio?` | `boolean`
|
|
1675
|
-
| `raw.references?` | `object`[]
|
|
1676
|
-
| `raw.
|
|
1677
|
-
| `
|
|
2087
|
+
| Parameter | Type | Default value | Description |
|
|
2088
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
2089
|
+
| `raw` | \{ `prompt`: `string`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `durationSeconds?`: `number`; `generateAudio?`: `boolean`; `references?`: `object`[]; `audioReferences?`: `object`[]; `model`: `string`; \} | `undefined` | - |
|
|
2090
|
+
| `raw.prompt` | `string` | `...` | Trimmed prompt; the selected model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
2091
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | `...` | Model-specific resolution, default 720p. |
|
|
2092
|
+
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | `...` | Model-specific aspect, default 16:9. |
|
|
2093
|
+
| `raw.durationSeconds?` | `number` | `...` | Whole seconds; Seedance 2.0 4–12, Seedance 2.5 4–30, Veo exactly 4/6/8, MiniMax H3 Max 5–15. |
|
|
2094
|
+
| `raw.generateAudio?` | `boolean` | `...` | Veo defaults true; Seedance omits the provider option when unset; MiniMax H3 Max has no audio field and refuses an explicit choice. |
|
|
2095
|
+
| `raw.references?` | `object`[] | `...` | Up to four references, with provider-specific roles and mode limits. |
|
|
2096
|
+
| `raw.audioReferences?` | `object`[] | `...` | Reference audio clips, for a model declaring `audioReferences` (Seedance 2.5: 10 clips, 30 seconds). |
|
|
2097
|
+
| `raw.model` | `string` | `...` | - |
|
|
2098
|
+
| `catalogue` | [`MediaCatalogue`](#mediacatalogue) | `mediaModels` | - |
|
|
1678
2099
|
|
|
1679
2100
|
#### Returns
|
|
1680
2101
|
|
|
@@ -1863,7 +2284,7 @@ first problem.
|
|
|
1863
2284
|
function listMediaModels(): readonly Readonly<{
|
|
1864
2285
|
id: string;
|
|
1865
2286
|
label: string;
|
|
1866
|
-
kind: "image" | "video";
|
|
2287
|
+
kind: "image" | "video" | "audio";
|
|
1867
2288
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
1868
2289
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
1869
2290
|
maxPromptLength: number;
|
|
@@ -1905,12 +2326,31 @@ function listMediaModels(): readonly Readonly<{
|
|
|
1905
2326
|
referenceResolutions: readonly (
|
|
1906
2327
|
"480p" | "720p" | "768p" | "1080p" | "4k"
|
|
1907
2328
|
)[];
|
|
2329
|
+
audioReferences: Readonly<{
|
|
2330
|
+
max: number;
|
|
2331
|
+
totalSeconds: number;
|
|
2332
|
+
}> | null;
|
|
1908
2333
|
prices: readonly Readonly<{
|
|
1909
2334
|
resolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
1910
2335
|
silentMilliunitsPerSecond: number;
|
|
1911
2336
|
audioMilliunitsPerSecond: number;
|
|
1912
2337
|
}>[];
|
|
1913
2338
|
}> | null;
|
|
2339
|
+
audio: Readonly<{
|
|
2340
|
+
provider: "elevenlabs";
|
|
2341
|
+
mode: "music" | "speech";
|
|
2342
|
+
voices: readonly Readonly<{
|
|
2343
|
+
id: string;
|
|
2344
|
+
label: string;
|
|
2345
|
+
}>[];
|
|
2346
|
+
defaultVoiceId: string | null;
|
|
2347
|
+
seconds: Readonly<{
|
|
2348
|
+
min: number;
|
|
2349
|
+
max: number;
|
|
2350
|
+
default: number;
|
|
2351
|
+
}> | null;
|
|
2352
|
+
milliunitsPerUnit: number;
|
|
2353
|
+
}> | null;
|
|
1914
2354
|
}>[];
|
|
1915
2355
|
```
|
|
1916
2356
|
|
|
@@ -1919,8 +2359,8 @@ List the gateway provider's models in catalog order.
|
|
|
1919
2359
|
#### Returns
|
|
1920
2360
|
|
|
1921
2361
|
readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
1922
|
-
`"video"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
1923
|
-
`outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2362
|
+
`"video"` \| `"audio"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2363
|
+
`"max"`; `outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
1924
2364
|
`maxPromptLength`: `number`; `input`: `Readonly`\<\{ `transport`: `"json"` \|
|
|
1925
2365
|
`"multipart"`; `dimensions`: `"none"` \| `"own"`; `maxDimension`: `number` \|
|
|
1926
2366
|
`null`; `maxDimensionDocumented`: `boolean`; `defaultWidth`: `number`;
|
|
@@ -1940,10 +2380,33 @@ readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
|
1940
2380
|
`boolean`; `defaultGenerateAudio`: `boolean` \| `null`; `referenceRoles`:
|
|
1941
2381
|
readonly (`"first-frame"` \| `"last-frame"` \| `"reference"`)[];
|
|
1942
2382
|
`maxReferenceImages`: `number`; `referenceResolutions`: readonly (`"480p"` \|
|
|
1943
|
-
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `
|
|
1944
|
-
`Readonly`\<\{ `
|
|
1945
|
-
`
|
|
1946
|
-
`
|
|
2383
|
+
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `audioReferences`: \|
|
|
2384
|
+
`Readonly`\<\{ `max`: `number`; `totalSeconds`: `number`; \}\> \| `null`;
|
|
2385
|
+
`prices`: readonly `Readonly`\<\{ `resolution`: `"480p"` \| `"720p"` \| `"768p"`
|
|
2386
|
+
\| `"1080p"` \| `"4k"`; `silentMilliunitsPerSecond`: `number`;
|
|
2387
|
+
`audioMilliunitsPerSecond`: `number`; \}\>[]; \}\> \| `null`; `audio`: \|
|
|
2388
|
+
`Readonly`\<\{ `provider`: `"elevenlabs"`; `mode`: `"music"` \| `"speech"`;
|
|
2389
|
+
`voices`: readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; \}\>[];
|
|
2390
|
+
`defaultVoiceId`: `string` \| `null`; `seconds`: \| `Readonly`\<\{ `min`:
|
|
2391
|
+
`number`; `max`: `number`; `default`: `number`; \}\> \| `null`;
|
|
2392
|
+
`milliunitsPerUnit`: `number`; \}\> \| `null`; \}\>[]
|
|
2393
|
+
|
|
2394
|
+
---
|
|
2395
|
+
|
|
2396
|
+
### listPictureMediaModels()
|
|
2397
|
+
|
|
2398
|
+
```ts
|
|
2399
|
+
function listPictureMediaModels(): readonly MediaPictureModel[];
|
|
2400
|
+
```
|
|
2401
|
+
|
|
2402
|
+
The gateway models Apps and browsers list and pick from: pictures and video. The
|
|
2403
|
+
Agar and Prints catalog decoders know no `audio` kind yet, and one unknown row
|
|
2404
|
+
fails the whole list, so audio models are generated by id until the Prints audio
|
|
2405
|
+
UI lands and lists them.
|
|
2406
|
+
|
|
2407
|
+
#### Returns
|
|
2408
|
+
|
|
2409
|
+
readonly [`MediaPictureModel`](#mediapicturemodel)[]
|
|
1947
2410
|
|
|
1948
2411
|
---
|
|
1949
2412
|
|
|
@@ -1954,7 +2417,7 @@ function getGatewayModel(id):
|
|
|
1954
2417
|
| Readonly<{
|
|
1955
2418
|
id: string;
|
|
1956
2419
|
label: string;
|
|
1957
|
-
kind: "image" | "video";
|
|
2420
|
+
kind: "image" | "video" | "audio";
|
|
1958
2421
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
1959
2422
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
1960
2423
|
maxPromptLength: number;
|
|
@@ -1997,12 +2460,31 @@ function getGatewayModel(id):
|
|
|
1997
2460
|
referenceResolutions: readonly (
|
|
1998
2461
|
"480p" | "720p" | "768p" | "1080p" | "4k"
|
|
1999
2462
|
)[];
|
|
2463
|
+
audioReferences: Readonly<{
|
|
2464
|
+
max: number;
|
|
2465
|
+
totalSeconds: number;
|
|
2466
|
+
}> | null;
|
|
2000
2467
|
prices: readonly Readonly<{
|
|
2001
2468
|
resolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
2002
2469
|
silentMilliunitsPerSecond: number;
|
|
2003
2470
|
audioMilliunitsPerSecond: number;
|
|
2004
2471
|
}>[];
|
|
2005
2472
|
}> | null;
|
|
2473
|
+
audio: Readonly<{
|
|
2474
|
+
provider: "elevenlabs";
|
|
2475
|
+
mode: "music" | "speech";
|
|
2476
|
+
voices: readonly Readonly<{
|
|
2477
|
+
id: string;
|
|
2478
|
+
label: string;
|
|
2479
|
+
}>[];
|
|
2480
|
+
defaultVoiceId: string | null;
|
|
2481
|
+
seconds: Readonly<{
|
|
2482
|
+
min: number;
|
|
2483
|
+
max: number;
|
|
2484
|
+
default: number;
|
|
2485
|
+
}> | null;
|
|
2486
|
+
milliunitsPerUnit: number;
|
|
2487
|
+
}> | null;
|
|
2006
2488
|
}>
|
|
2007
2489
|
| undefined;
|
|
2008
2490
|
```
|
|
@@ -2019,8 +2501,8 @@ sees a custom provider's models.
|
|
|
2019
2501
|
#### Returns
|
|
2020
2502
|
|
|
2021
2503
|
\| `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
2022
|
-
`"video"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2023
|
-
`outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2504
|
+
`"video"` \| `"audio"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2505
|
+
`"max"`; `outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2024
2506
|
`maxPromptLength`: `number`; `input`: `Readonly`\<\{ `transport`: `"json"` \|
|
|
2025
2507
|
`"multipart"`; `dimensions`: `"none"` \| `"own"`; `maxDimension`: `number` \|
|
|
2026
2508
|
`null`; `maxDimensionDocumented`: `boolean`; `defaultWidth`: `number`;
|
|
@@ -2040,10 +2522,16 @@ sees a custom provider's models.
|
|
|
2040
2522
|
`boolean`; `defaultGenerateAudio`: `boolean` \| `null`; `referenceRoles`:
|
|
2041
2523
|
readonly (`"first-frame"` \| `"last-frame"` \| `"reference"`)[];
|
|
2042
2524
|
`maxReferenceImages`: `number`; `referenceResolutions`: readonly (`"480p"` \|
|
|
2043
|
-
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `
|
|
2044
|
-
`Readonly`\<\{ `
|
|
2045
|
-
`
|
|
2046
|
-
`
|
|
2525
|
+
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `audioReferences`: \|
|
|
2526
|
+
`Readonly`\<\{ `max`: `number`; `totalSeconds`: `number`; \}\> \| `null`;
|
|
2527
|
+
`prices`: readonly `Readonly`\<\{ `resolution`: `"480p"` \| `"720p"` \| `"768p"`
|
|
2528
|
+
\| `"1080p"` \| `"4k"`; `silentMilliunitsPerSecond`: `number`;
|
|
2529
|
+
`audioMilliunitsPerSecond`: `number`; \}\>[]; \}\> \| `null`; `audio`: \|
|
|
2530
|
+
`Readonly`\<\{ `provider`: `"elevenlabs"`; `mode`: `"music"` \| `"speech"`;
|
|
2531
|
+
`voices`: readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; \}\>[];
|
|
2532
|
+
`defaultVoiceId`: `string` \| `null`; `seconds`: \| `Readonly`\<\{ `min`:
|
|
2533
|
+
`number`; `max`: `number`; `default`: `number`; \}\> \| `null`;
|
|
2534
|
+
`milliunitsPerUnit`: `number`; \}\> \| `null`; \}\> \| `undefined`
|
|
2047
2535
|
|
|
2048
2536
|
---
|
|
2049
2537
|
|
|
@@ -2057,7 +2545,7 @@ function getMediaModel(
|
|
|
2057
2545
|
| Readonly<{
|
|
2058
2546
|
id: string;
|
|
2059
2547
|
label: string;
|
|
2060
|
-
kind: "image" | "video";
|
|
2548
|
+
kind: "image" | "video" | "audio";
|
|
2061
2549
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
2062
2550
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
2063
2551
|
maxPromptLength: number;
|
|
@@ -2077,6 +2565,21 @@ function getMediaModel(
|
|
|
2077
2565
|
referenceFormat: "png" | "webp";
|
|
2078
2566
|
}>;
|
|
2079
2567
|
sizes: readonly string[] | null;
|
|
2568
|
+
audio: Readonly<{
|
|
2569
|
+
provider: "elevenlabs";
|
|
2570
|
+
mode: "music" | "speech";
|
|
2571
|
+
voices: readonly Readonly<{
|
|
2572
|
+
id: string;
|
|
2573
|
+
label: string;
|
|
2574
|
+
}>[];
|
|
2575
|
+
defaultVoiceId: string | null;
|
|
2576
|
+
seconds: Readonly<{
|
|
2577
|
+
min: number;
|
|
2578
|
+
max: number;
|
|
2579
|
+
default: number;
|
|
2580
|
+
}> | null;
|
|
2581
|
+
milliunitsPerUnit: number;
|
|
2582
|
+
}> | null;
|
|
2080
2583
|
video: Readonly<{
|
|
2081
2584
|
minSeconds: number;
|
|
2082
2585
|
maxSeconds: number;
|
|
@@ -2104,6 +2607,10 @@ function getMediaModel(
|
|
|
2104
2607
|
silentMilliunitsPerSecond: number;
|
|
2105
2608
|
audioMilliunitsPerSecond: number;
|
|
2106
2609
|
}>[];
|
|
2610
|
+
audioReferences: Readonly<{
|
|
2611
|
+
max: number;
|
|
2612
|
+
totalSeconds: number;
|
|
2613
|
+
}> | null;
|
|
2107
2614
|
provider: "seedance" | "veo" | "minimax" | "host";
|
|
2108
2615
|
}> | null;
|
|
2109
2616
|
}>
|
|
@@ -2123,8 +2630,8 @@ absent.
|
|
|
2123
2630
|
#### Returns
|
|
2124
2631
|
|
|
2125
2632
|
\| `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
2126
|
-
`"video"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2127
|
-
`outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2633
|
+
`"video"` \| `"audio"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2634
|
+
`"max"`; `outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2128
2635
|
`maxPromptLength`: `number`; `input`: `Readonly`\<\{ `transport`: `"json"` \|
|
|
2129
2636
|
`"multipart"`; `dimensions`: `"none"` \| `"own"`; `maxDimension`: `number` \|
|
|
2130
2637
|
`null`; `maxDimensionDocumented`: `boolean`; `defaultWidth`: `number`;
|
|
@@ -2132,9 +2639,14 @@ absent.
|
|
|
2132
2639
|
`maxSteps`: `number` \| `null`; `defaultSteps`: `number` \| `null`;
|
|
2133
2640
|
`referenceField`: `string` \| `null`; `maxReferences`: `number`;
|
|
2134
2641
|
`referenceDimension`: `number` \| `null`; `referenceFormat`: `"png"` \|
|
|
2135
|
-
`"webp"`; \}\>; `sizes`: readonly `string`[] \| `null`; `
|
|
2136
|
-
`Readonly`\<\{ `
|
|
2137
|
-
`
|
|
2642
|
+
`"webp"`; \}\>; `sizes`: readonly `string`[] \| `null`; `audio`: \|
|
|
2643
|
+
`Readonly`\<\{ `provider`: `"elevenlabs"`; `mode`: `"music"` \| `"speech"`;
|
|
2644
|
+
`voices`: readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; \}\>[];
|
|
2645
|
+
`defaultVoiceId`: `string` \| `null`; `seconds`: \| `Readonly`\<\{ `min`:
|
|
2646
|
+
`number`; `max`: `number`; `default`: `number`; \}\> \| `null`;
|
|
2647
|
+
`milliunitsPerUnit`: `number`; \}\> \| `null`; `video`: \| `Readonly`\<\{
|
|
2648
|
+
`minSeconds`: `number`; `maxSeconds`: `number`; `defaultSeconds`: `number`;
|
|
2649
|
+
`durations`: readonly `number`[]; `formats`: readonly `Readonly`\<\{
|
|
2138
2650
|
`resolution`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`;
|
|
2139
2651
|
`aspectRatio`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"`
|
|
2140
2652
|
\| `"9:21"`; `width`: `number`; `height`: `number`; \}\>[]; `defaultResolution`:
|
|
@@ -2146,8 +2658,10 @@ absent.
|
|
|
2146
2658
|
readonly (`"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `prices`:
|
|
2147
2659
|
readonly `Readonly`\<\{ `resolution`: `"480p"` \| `"720p"` \| `"768p"` \|
|
|
2148
2660
|
`"1080p"` \| `"4k"`; `silentMilliunitsPerSecond`: `number`;
|
|
2149
|
-
`audioMilliunitsPerSecond`: `number`; \}\>[]; `
|
|
2150
|
-
`
|
|
2661
|
+
`audioMilliunitsPerSecond`: `number`; \}\>[]; `audioReferences`: \|
|
|
2662
|
+
`Readonly`\<\{ `max`: `number`; `totalSeconds`: `number`; \}\> \| `null`;
|
|
2663
|
+
`provider`: `"seedance"` \| `"veo"` \| `"minimax"` \| `"host"`; \}\> \| `null`;
|
|
2664
|
+
\}\> \| `undefined`
|
|
2151
2665
|
|
|
2152
2666
|
---
|
|
2153
2667
|
|