@fungi.computer/darkroom 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +155 -4
- package/dist/model-catalog.js +173 -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 +564 -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
|
|
@@ -605,6 +694,27 @@ One provider's model list: the typed bounds every request is checked against.
|
|
|
605
694
|
|
|
606
695
|
## Variables
|
|
607
696
|
|
|
697
|
+
### MAX\_AUDIO\_REFERENCE\_BYTES
|
|
698
|
+
|
|
699
|
+
```ts
|
|
700
|
+
const MAX_AUDIO_REFERENCE_BYTES: number;
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
Decoded bytes of one reference clip: well past 30 seconds of any admitted
|
|
704
|
+
container.
|
|
705
|
+
|
|
706
|
+
---
|
|
707
|
+
|
|
708
|
+
### MAX\_AUDIO\_REFERENCE\_BODY\_BYTES
|
|
709
|
+
|
|
710
|
+
```ts
|
|
711
|
+
const MAX_AUDIO_REFERENCE_BODY_BYTES: number;
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
Decoded bytes across every clip of one request; base64 adds a third.
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
608
718
|
### mediaFailureStageSchema
|
|
609
719
|
|
|
610
720
|
```ts
|
|
@@ -690,6 +800,17 @@ Maximum retained still-image output bytes.
|
|
|
690
800
|
|
|
691
801
|
---
|
|
692
802
|
|
|
803
|
+
### MAX\_AUDIO\_REFERENCE\_COUNT
|
|
804
|
+
|
|
805
|
+
```ts
|
|
806
|
+
const MAX_AUDIO_REFERENCE_COUNT: 10 = 10;
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
Schema ceiling for audio reference lists; each model's own `audioReferences.max`
|
|
810
|
+
is enforced after parsing.
|
|
811
|
+
|
|
812
|
+
---
|
|
813
|
+
|
|
693
814
|
### mediaGenerationSettingsSchema
|
|
694
815
|
|
|
695
816
|
```ts
|
|
@@ -697,10 +818,11 @@ const mediaGenerationSettingsSchema: ZodObject<
|
|
|
697
818
|
{
|
|
698
819
|
model: ZodString;
|
|
699
820
|
prompt: ZodString;
|
|
700
|
-
width: ZodNumber
|
|
701
|
-
height: ZodNumber
|
|
821
|
+
width: ZodOptional<ZodNumber>;
|
|
822
|
+
height: ZodOptional<ZodNumber>;
|
|
702
823
|
steps: ZodOptional<ZodNumber>;
|
|
703
824
|
durationSeconds: ZodOptional<ZodNumber>;
|
|
825
|
+
voiceId: ZodOptional<ZodString>;
|
|
704
826
|
resolution: ZodOptional<
|
|
705
827
|
ZodEnum<{
|
|
706
828
|
p480: "480p";
|
|
@@ -740,6 +862,17 @@ const mediaGenerationSettingsSchema: ZodObject<
|
|
|
740
862
|
>
|
|
741
863
|
>
|
|
742
864
|
>;
|
|
865
|
+
audioReferences: ZodOptional<
|
|
866
|
+
ZodArray<
|
|
867
|
+
ZodObject<
|
|
868
|
+
{
|
|
869
|
+
computerId: ZodString;
|
|
870
|
+
path: ZodString;
|
|
871
|
+
},
|
|
872
|
+
$strict
|
|
873
|
+
>
|
|
874
|
+
>
|
|
875
|
+
>;
|
|
743
876
|
},
|
|
744
877
|
$strict
|
|
745
878
|
>;
|
|
@@ -756,10 +889,11 @@ const mediaGenerationSelectionSchema: ZodObject<
|
|
|
756
889
|
{
|
|
757
890
|
model: ZodString;
|
|
758
891
|
prompt: ZodString;
|
|
759
|
-
width: ZodNumber
|
|
760
|
-
height: ZodNumber
|
|
892
|
+
width: ZodOptional<ZodNumber>;
|
|
893
|
+
height: ZodOptional<ZodNumber>;
|
|
761
894
|
steps: ZodOptional<ZodNumber>;
|
|
762
895
|
durationSeconds: ZodOptional<ZodNumber>;
|
|
896
|
+
voiceId: ZodOptional<ZodString>;
|
|
763
897
|
resolution: ZodOptional<
|
|
764
898
|
ZodEnum<{
|
|
765
899
|
p480: "480p";
|
|
@@ -799,6 +933,17 @@ const mediaGenerationSelectionSchema: ZodObject<
|
|
|
799
933
|
>
|
|
800
934
|
>
|
|
801
935
|
>;
|
|
936
|
+
audioReferences: ZodOptional<
|
|
937
|
+
ZodArray<
|
|
938
|
+
ZodObject<
|
|
939
|
+
{
|
|
940
|
+
computerId: ZodOptional<ZodString>;
|
|
941
|
+
path: ZodString;
|
|
942
|
+
},
|
|
943
|
+
$strict
|
|
944
|
+
>
|
|
945
|
+
>
|
|
946
|
+
>;
|
|
802
947
|
},
|
|
803
948
|
$strict
|
|
804
949
|
>;
|
|
@@ -830,6 +975,23 @@ Path-only video reference; the host supplies authority and reads its bytes.
|
|
|
830
975
|
|
|
831
976
|
---
|
|
832
977
|
|
|
978
|
+
### mediaAudioReferenceSelectionSchema
|
|
979
|
+
|
|
980
|
+
```ts
|
|
981
|
+
const mediaAudioReferenceSelectionSchema: ZodLazy<
|
|
982
|
+
ZodObject<
|
|
983
|
+
{
|
|
984
|
+
path: ZodString;
|
|
985
|
+
},
|
|
986
|
+
$strict
|
|
987
|
+
>
|
|
988
|
+
>;
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
Path-only audio reference; the host supplies authority and reads its bytes.
|
|
992
|
+
|
|
993
|
+
---
|
|
994
|
+
|
|
833
995
|
### mediaVideoSelectionSchema
|
|
834
996
|
|
|
835
997
|
```ts
|
|
@@ -885,6 +1047,18 @@ const mediaVideoSelectionSchema: ZodLazy<
|
|
|
885
1047
|
>
|
|
886
1048
|
>
|
|
887
1049
|
>;
|
|
1050
|
+
audioReferences: ZodOptional<
|
|
1051
|
+
ZodArray<
|
|
1052
|
+
ZodLazy<
|
|
1053
|
+
ZodObject<
|
|
1054
|
+
{
|
|
1055
|
+
path: ZodString;
|
|
1056
|
+
},
|
|
1057
|
+
$strict
|
|
1058
|
+
>
|
|
1059
|
+
>
|
|
1060
|
+
>
|
|
1061
|
+
>;
|
|
888
1062
|
},
|
|
889
1063
|
$strict
|
|
890
1064
|
>
|
|
@@ -896,6 +1070,31 @@ validateMediaVideoSelection.
|
|
|
896
1070
|
|
|
897
1071
|
---
|
|
898
1072
|
|
|
1073
|
+
### mediaAudioSelectionSchema
|
|
1074
|
+
|
|
1075
|
+
```ts
|
|
1076
|
+
const mediaAudioSelectionSchema: ZodLazy<
|
|
1077
|
+
ZodObject<
|
|
1078
|
+
{
|
|
1079
|
+
model: ZodEnum<{
|
|
1080
|
+
multilingual: "elevenlabs/eleven-multilingual-v2";
|
|
1081
|
+
v3: "elevenlabs/eleven-v3";
|
|
1082
|
+
music: "elevenlabs/music-v2";
|
|
1083
|
+
}>;
|
|
1084
|
+
prompt: ZodString;
|
|
1085
|
+
voiceId: ZodOptional<ZodString>;
|
|
1086
|
+
durationSeconds: ZodOptional<ZodNumber>;
|
|
1087
|
+
},
|
|
1088
|
+
$strict
|
|
1089
|
+
>
|
|
1090
|
+
>;
|
|
1091
|
+
```
|
|
1092
|
+
|
|
1093
|
+
Neutral audio selection: speech takes a voice, music a length; model-specific
|
|
1094
|
+
limits are checked by validateMediaGenerationSettings.
|
|
1095
|
+
|
|
1096
|
+
---
|
|
1097
|
+
|
|
899
1098
|
### mediaProviderWireSchema
|
|
900
1099
|
|
|
901
1100
|
```ts
|
|
@@ -983,7 +1182,8 @@ const mediaModelInputSchema: ZodLazy<
|
|
|
983
1182
|
>;
|
|
984
1183
|
```
|
|
985
1184
|
|
|
986
|
-
Media's provider catalog: Workers AI images plus gateway image and
|
|
1185
|
+
Media's provider catalog: Workers AI images plus gateway image, video and audio
|
|
1186
|
+
models.
|
|
987
1187
|
|
|
988
1188
|
---
|
|
989
1189
|
|
|
@@ -1150,6 +1350,10 @@ const mediaVideoSchema: ZodLazy<ZodReadonly<ZodObject<{
|
|
|
1150
1350
|
p1080: "1080p";
|
|
1151
1351
|
p4k: "4k";
|
|
1152
1352
|
}>>>;
|
|
1353
|
+
audioReferences: ZodNullable<ZodReadonly<ZodObject<{
|
|
1354
|
+
max: ZodNumber;
|
|
1355
|
+
totalSeconds: ZodNumber;
|
|
1356
|
+
}, $strict>>>;
|
|
1153
1357
|
prices: ZodReadonly<ZodArray<ZodReadonly<ZodObject<{
|
|
1154
1358
|
resolution: ZodEnum<{
|
|
1155
1359
|
p480: ...;
|
|
@@ -1168,6 +1372,107 @@ Verified video parameters and provider costs, checked 2026-10-11.
|
|
|
1168
1372
|
|
|
1169
1373
|
---
|
|
1170
1374
|
|
|
1375
|
+
### mediaAudioModelIdSchema
|
|
1376
|
+
|
|
1377
|
+
```ts
|
|
1378
|
+
const mediaAudioModelIdSchema: ZodEnum<{
|
|
1379
|
+
multilingual: "elevenlabs/eleven-multilingual-v2";
|
|
1380
|
+
v3: "elevenlabs/eleven-v3";
|
|
1381
|
+
music: "elevenlabs/music-v2";
|
|
1382
|
+
}>;
|
|
1383
|
+
```
|
|
1384
|
+
|
|
1385
|
+
Verified ElevenLabs model identifiers on Cloudflare's Unified Billing, from the
|
|
1386
|
+
model pages under https://developers.cloudflare.com/ai/models/elevenlabs/
|
|
1387
|
+
(checked 2026-11-13). Cloudflare offers no sound-effects model. Eleven Flash
|
|
1388
|
+
v2.5 and Turbo v2.5 are listed there but a live Unified Billing call to Flash
|
|
1389
|
+
answered 403 code 2047 ("not available via unified billing. Please use BYOK"),
|
|
1390
|
+
so they are not offered. Multilingual v2 is the default voice model.
|
|
1391
|
+
|
|
1392
|
+
---
|
|
1393
|
+
|
|
1394
|
+
### mediaAudioVoiceSchema
|
|
1395
|
+
|
|
1396
|
+
```ts
|
|
1397
|
+
const mediaAudioVoiceSchema: ZodLazy<
|
|
1398
|
+
ZodReadonly<
|
|
1399
|
+
ZodObject<
|
|
1400
|
+
{
|
|
1401
|
+
id: ZodString;
|
|
1402
|
+
label: ZodString;
|
|
1403
|
+
},
|
|
1404
|
+
$strict
|
|
1405
|
+
>
|
|
1406
|
+
>
|
|
1407
|
+
>;
|
|
1408
|
+
```
|
|
1409
|
+
|
|
1410
|
+
One premade voice a speech model may speak with.
|
|
1411
|
+
|
|
1412
|
+
---
|
|
1413
|
+
|
|
1414
|
+
### mediaAudioSchema
|
|
1415
|
+
|
|
1416
|
+
```ts
|
|
1417
|
+
const mediaAudioSchema: ZodLazy<
|
|
1418
|
+
ZodReadonly<
|
|
1419
|
+
ZodObject<
|
|
1420
|
+
{
|
|
1421
|
+
provider: ZodLiteral<"elevenlabs">;
|
|
1422
|
+
mode: ZodEnum<{
|
|
1423
|
+
speech: "speech";
|
|
1424
|
+
music: "music";
|
|
1425
|
+
}>;
|
|
1426
|
+
voices: ZodReadonly<
|
|
1427
|
+
ZodArray<
|
|
1428
|
+
ZodLazy<
|
|
1429
|
+
ZodReadonly<
|
|
1430
|
+
ZodObject<
|
|
1431
|
+
{
|
|
1432
|
+
id: ZodString;
|
|
1433
|
+
label: ZodString;
|
|
1434
|
+
},
|
|
1435
|
+
$strict
|
|
1436
|
+
>
|
|
1437
|
+
>
|
|
1438
|
+
>
|
|
1439
|
+
>
|
|
1440
|
+
>;
|
|
1441
|
+
defaultVoiceId: ZodNullable<ZodString>;
|
|
1442
|
+
seconds: ZodNullable<
|
|
1443
|
+
ZodReadonly<
|
|
1444
|
+
ZodObject<
|
|
1445
|
+
{
|
|
1446
|
+
min: ZodNumber;
|
|
1447
|
+
max: ZodNumber;
|
|
1448
|
+
default: ZodNumber;
|
|
1449
|
+
},
|
|
1450
|
+
$strict
|
|
1451
|
+
>
|
|
1452
|
+
>
|
|
1453
|
+
>;
|
|
1454
|
+
milliunitsPerUnit: ZodNumber;
|
|
1455
|
+
},
|
|
1456
|
+
$strict
|
|
1457
|
+
>
|
|
1458
|
+
>
|
|
1459
|
+
>;
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
Verified audio parameters and provider cost, checked 2026-11-13.
|
|
1463
|
+
|
|
1464
|
+
---
|
|
1465
|
+
|
|
1466
|
+
### AUDIO\_CHARACTER\_BLOCK
|
|
1467
|
+
|
|
1468
|
+
```ts
|
|
1469
|
+
const AUDIO_CHARACTER_BLOCK: 100 = 100;
|
|
1470
|
+
```
|
|
1471
|
+
|
|
1472
|
+
Characters one speech billing block covers.
|
|
1473
|
+
|
|
1474
|
+
---
|
|
1475
|
+
|
|
1171
1476
|
### MAX\_MEDIA\_PROMPT\_LENGTH
|
|
1172
1477
|
|
|
1173
1478
|
```ts
|
|
@@ -1188,6 +1493,7 @@ const mediaModelSchema: ZodReadonly<ZodObject<{
|
|
|
1188
1493
|
kind: ZodEnum<{
|
|
1189
1494
|
image: "image";
|
|
1190
1495
|
video: "video";
|
|
1496
|
+
audio: "audio";
|
|
1191
1497
|
}>;
|
|
1192
1498
|
tier: ZodEnum<{
|
|
1193
1499
|
draft: "draft";
|
|
@@ -1262,8 +1568,20 @@ const mediaModelSchema: ZodReadonly<ZodObject<{
|
|
|
1262
1568
|
referenceRoles: ZodReadonly<ZodArray<ZodEnum<...>>>;
|
|
1263
1569
|
maxReferenceImages: ZodNumber;
|
|
1264
1570
|
referenceResolutions: ZodReadonly<ZodArray<ZodEnum<...>>>;
|
|
1571
|
+
audioReferences: ZodNullable<ZodReadonly<ZodObject<..., ...>>>;
|
|
1265
1572
|
prices: ZodReadonly<ZodArray<ZodReadonly<...>>>;
|
|
1266
1573
|
}, $strict>>>>;
|
|
1574
|
+
audio: ZodNullable<ZodLazy<ZodReadonly<ZodObject<{
|
|
1575
|
+
provider: ZodLiteral<"elevenlabs">;
|
|
1576
|
+
mode: ZodEnum<{
|
|
1577
|
+
speech: "speech";
|
|
1578
|
+
music: "music";
|
|
1579
|
+
}>;
|
|
1580
|
+
voices: ZodReadonly<ZodArray<ZodLazy<...>>>;
|
|
1581
|
+
defaultVoiceId: ZodNullable<ZodString>;
|
|
1582
|
+
seconds: ZodNullable<ZodReadonly<ZodObject<..., ...>>>;
|
|
1583
|
+
milliunitsPerUnit: ZodNumber;
|
|
1584
|
+
}, $strict>>>>;
|
|
1267
1585
|
}, $strict>>;
|
|
1268
1586
|
```
|
|
1269
1587
|
|
|
@@ -1277,7 +1595,7 @@ Public wire grammar for a catalog entry returned by the Media owner.
|
|
|
1277
1595
|
const mediaModels: readonly MediaModel[] = models;
|
|
1278
1596
|
```
|
|
1279
1597
|
|
|
1280
|
-
The Fungi gateway provider's own immutable image and
|
|
1598
|
+
The Fungi gateway provider's own immutable image, video and audio model catalog.
|
|
1281
1599
|
|
|
1282
1600
|
---
|
|
1283
1601
|
|
|
@@ -1290,6 +1608,7 @@ const mediaCatalogueModelSchema: ZodReadonly<ZodObject<{
|
|
|
1290
1608
|
kind: ZodEnum<{
|
|
1291
1609
|
image: "image";
|
|
1292
1610
|
video: "video";
|
|
1611
|
+
audio: "audio";
|
|
1293
1612
|
}>;
|
|
1294
1613
|
tier: ZodEnum<{
|
|
1295
1614
|
draft: "draft";
|
|
@@ -1332,6 +1651,17 @@ const mediaCatalogueModelSchema: ZodReadonly<ZodObject<{
|
|
|
1332
1651
|
}>;
|
|
1333
1652
|
}, $strict>>>;
|
|
1334
1653
|
sizes: ZodNullable<ZodReadonly<ZodArray<ZodString>>>;
|
|
1654
|
+
audio: ZodDefault<ZodNullable<ZodReadonly<ZodObject<{
|
|
1655
|
+
provider: ZodLiteral<"elevenlabs">;
|
|
1656
|
+
mode: ZodEnum<{
|
|
1657
|
+
speech: "speech";
|
|
1658
|
+
music: "music";
|
|
1659
|
+
}>;
|
|
1660
|
+
voices: ZodReadonly<ZodArray<ZodLazy<...>>>;
|
|
1661
|
+
defaultVoiceId: ZodNullable<ZodString>;
|
|
1662
|
+
seconds: ZodNullable<ZodReadonly<ZodObject<..., ...>>>;
|
|
1663
|
+
milliunitsPerUnit: ZodNumber;
|
|
1664
|
+
}, $strict>>>>;
|
|
1335
1665
|
video: ZodNullable<ZodReadonly<ZodObject<{
|
|
1336
1666
|
minSeconds: ZodNumber;
|
|
1337
1667
|
maxSeconds: ZodNumber;
|
|
@@ -1370,6 +1700,7 @@ const mediaCatalogueModelSchema: ZodReadonly<ZodObject<{
|
|
|
1370
1700
|
p4k: ...;
|
|
1371
1701
|
}>>>;
|
|
1372
1702
|
prices: ZodReadonly<ZodArray<ZodReadonly<ZodObject<..., ...>>>>;
|
|
1703
|
+
audioReferences: ZodDefault<ZodNullable<ZodReadonly<ZodObject<..., ...>>>>;
|
|
1373
1704
|
provider: ZodEnum<{
|
|
1374
1705
|
seedance: "seedance";
|
|
1375
1706
|
veo: "veo";
|
|
@@ -1395,6 +1726,7 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1395
1726
|
kind: ZodEnum<{
|
|
1396
1727
|
image: "image";
|
|
1397
1728
|
video: "video";
|
|
1729
|
+
audio: "audio";
|
|
1398
1730
|
}>;
|
|
1399
1731
|
tier: ZodEnum<{
|
|
1400
1732
|
draft: "draft";
|
|
@@ -1437,6 +1769,14 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1437
1769
|
}>;
|
|
1438
1770
|
}, $strict>>>;
|
|
1439
1771
|
sizes: ZodNullable<ZodReadonly<ZodArray<ZodString>>>;
|
|
1772
|
+
audio: ZodDefault<ZodNullable<ZodReadonly<ZodObject<{
|
|
1773
|
+
provider: ZodLiteral<...>;
|
|
1774
|
+
mode: ZodEnum<...>;
|
|
1775
|
+
voices: ZodReadonly<...>;
|
|
1776
|
+
defaultVoiceId: ZodNullable<...>;
|
|
1777
|
+
seconds: ZodNullable<...>;
|
|
1778
|
+
milliunitsPerUnit: ZodNumber;
|
|
1779
|
+
}, $strict>>>>;
|
|
1440
1780
|
video: ZodNullable<ZodReadonly<ZodObject<{
|
|
1441
1781
|
minSeconds: ZodNumber;
|
|
1442
1782
|
maxSeconds: ZodNumber;
|
|
@@ -1465,6 +1805,7 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1465
1805
|
maxReferenceImages: ZodNumber;
|
|
1466
1806
|
referenceResolutions: ZodReadonly<ZodArray<...>>;
|
|
1467
1807
|
prices: ZodReadonly<ZodArray<...>>;
|
|
1808
|
+
audioReferences: ZodDefault<ZodNullable<...>>;
|
|
1468
1809
|
provider: ZodEnum<{
|
|
1469
1810
|
seedance: ...;
|
|
1470
1811
|
veo: ...;
|
|
@@ -1475,7 +1816,7 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1475
1816
|
}, $strict>>>, ZodTransform<MediaCatalogue, Readonly<{
|
|
1476
1817
|
id: string;
|
|
1477
1818
|
label: string;
|
|
1478
|
-
kind: "image" | "video";
|
|
1819
|
+
kind: "image" | "video" | "audio";
|
|
1479
1820
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
1480
1821
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
1481
1822
|
maxPromptLength: number;
|
|
@@ -1495,6 +1836,23 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1495
1836
|
referenceFormat: "png" | "webp";
|
|
1496
1837
|
}>;
|
|
1497
1838
|
sizes: readonly string[] | null;
|
|
1839
|
+
audio: | Readonly<{
|
|
1840
|
+
provider: "elevenlabs";
|
|
1841
|
+
mode: "music" | "speech";
|
|
1842
|
+
voices: readonly Readonly<{
|
|
1843
|
+
id: ...;
|
|
1844
|
+
label: ...;
|
|
1845
|
+
}>[];
|
|
1846
|
+
defaultVoiceId: string | null;
|
|
1847
|
+
seconds: | Readonly<{
|
|
1848
|
+
min: ...;
|
|
1849
|
+
max: ...;
|
|
1850
|
+
default: ...;
|
|
1851
|
+
}>
|
|
1852
|
+
| null;
|
|
1853
|
+
milliunitsPerUnit: number;
|
|
1854
|
+
}>
|
|
1855
|
+
| null;
|
|
1498
1856
|
video: | Readonly<{
|
|
1499
1857
|
minSeconds: number;
|
|
1500
1858
|
maxSeconds: number;
|
|
@@ -1518,6 +1876,11 @@ const mediaCatalogueSchema: ZodPipe<ZodArray<ZodReadonly<ZodObject<{
|
|
|
1518
1876
|
silentMilliunitsPerSecond: ...;
|
|
1519
1877
|
audioMilliunitsPerSecond: ...;
|
|
1520
1878
|
}>[];
|
|
1879
|
+
audioReferences: | Readonly<{
|
|
1880
|
+
max: ...;
|
|
1881
|
+
totalSeconds: ...;
|
|
1882
|
+
}>
|
|
1883
|
+
| null;
|
|
1521
1884
|
provider: "seedance" | "veo" | "minimax" | "host";
|
|
1522
1885
|
}>
|
|
1523
1886
|
| null;
|
|
@@ -1583,6 +1946,40 @@ Quote the same estimate in milliunits (1 cent = 1,000 milliunits).
|
|
|
1583
1946
|
|
|
1584
1947
|
---
|
|
1585
1948
|
|
|
1949
|
+
### mediaSettingsInput()
|
|
1950
|
+
|
|
1951
|
+
```ts
|
|
1952
|
+
function mediaSettingsInput(settings): object;
|
|
1953
|
+
```
|
|
1954
|
+
|
|
1955
|
+
Mutable caller input for already-normalized settings, so they can be validated
|
|
1956
|
+
again.
|
|
1957
|
+
|
|
1958
|
+
#### Parameters
|
|
1959
|
+
|
|
1960
|
+
| Parameter | Type |
|
|
1961
|
+
| ---------- | ----------------------------------------------------- |
|
|
1962
|
+
| `settings` | [`MediaGenerationSettings`](#mediagenerationsettings) |
|
|
1963
|
+
|
|
1964
|
+
#### Returns
|
|
1965
|
+
|
|
1966
|
+
| Name | Type | Description |
|
|
1967
|
+
| ------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
1968
|
+
| `model` | `string` | Provider catalog model identifier. |
|
|
1969
|
+
| `prompt` | `string` | Generation prompt; each model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
1970
|
+
| `width?` | `number` | Requested image width or nominal video selector; absent for audio. |
|
|
1971
|
+
| `height?` | `number` | Requested image height or nominal video selector; absent for audio. |
|
|
1972
|
+
| `steps?` | `number` | Model-specific inference step count. |
|
|
1973
|
+
| `durationSeconds?` | `number` | Requested video or music length in whole seconds. |
|
|
1974
|
+
| `voiceId?` | `string` | Speech models only: a premade voice from the catalog; the default when omitted. |
|
|
1975
|
+
| `resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | Video resolution; must match the nominal width/height selector. |
|
|
1976
|
+
| `aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | Video aspect; must match the nominal width/height selector. |
|
|
1977
|
+
| `generateAudio?` | `boolean` | Video audio selection. |
|
|
1978
|
+
| `references?` | `object`[] | Host-authorized reference images. |
|
|
1979
|
+
| `audioReferences?` | `object`[] | Host-authorized reference audio clips; only a model declaring `audioReferences` takes them. |
|
|
1980
|
+
|
|
1981
|
+
---
|
|
1982
|
+
|
|
1586
1983
|
### validateMediaGenerationSettings()
|
|
1587
1984
|
|
|
1588
1985
|
```ts
|
|
@@ -1597,20 +1994,22 @@ Validate caller settings against `catalogue`, the active provider's model list
|
|
|
1597
1994
|
|
|
1598
1995
|
#### Parameters
|
|
1599
1996
|
|
|
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
|
-
| `
|
|
1997
|
+
| Parameter | Type | Default value | Description |
|
|
1998
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------- |
|
|
1999
|
+
| `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` | - |
|
|
2000
|
+
| `raw.model` | `string` | `...` | Provider catalog model identifier. |
|
|
2001
|
+
| `raw.prompt` | `string` | `...` | Generation prompt; each model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
2002
|
+
| `raw.width?` | `number` | `...` | Requested image width or nominal video selector; absent for audio. |
|
|
2003
|
+
| `raw.height?` | `number` | `...` | Requested image height or nominal video selector; absent for audio. |
|
|
2004
|
+
| `raw.steps?` | `number` | `...` | Model-specific inference step count. |
|
|
2005
|
+
| `raw.durationSeconds?` | `number` | `...` | Requested video or music length in whole seconds. |
|
|
2006
|
+
| `raw.voiceId?` | `string` | `...` | Speech models only: a premade voice from the catalog; the default when omitted. |
|
|
2007
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | `...` | Video resolution; must match the nominal width/height selector. |
|
|
2008
|
+
| `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. |
|
|
2009
|
+
| `raw.generateAudio?` | `boolean` | `...` | Video audio selection. |
|
|
2010
|
+
| `raw.references?` | `object`[] | `...` | Host-authorized reference images. |
|
|
2011
|
+
| `raw.audioReferences?` | `object`[] | `...` | Host-authorized reference audio clips; only a model declaring `audioReferences` takes them. |
|
|
2012
|
+
| `catalogue` | [`MediaCatalogue`](#mediacatalogue) | `mediaModels` | - |
|
|
1614
2013
|
|
|
1615
2014
|
#### Returns
|
|
1616
2015
|
|
|
@@ -1624,32 +2023,36 @@ Validate caller settings against `catalogue`, the active provider's model list
|
|
|
1624
2023
|
function validateMediaGenerationSelection(
|
|
1625
2024
|
raw,
|
|
1626
2025
|
catalogue?,
|
|
1627
|
-
): Readonly<
|
|
2026
|
+
): Readonly<
|
|
2027
|
+
Omit<MediaGenerationSettings, "references" | "audioReferences"> & object
|
|
2028
|
+
>;
|
|
1628
2029
|
```
|
|
1629
2030
|
|
|
1630
2031
|
Validate selections without granting Computer authority.
|
|
1631
2032
|
|
|
1632
2033
|
#### Parameters
|
|
1633
2034
|
|
|
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
|
-
| `
|
|
2035
|
+
| Parameter | Type | Default value | Description |
|
|
2036
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------- |
|
|
2037
|
+
| `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` | - |
|
|
2038
|
+
| `raw.model` | `string` | `...` | Provider catalog model identifier. |
|
|
2039
|
+
| `raw.prompt` | `string` | `...` | Generation prompt; each model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
2040
|
+
| `raw.width?` | `number` | `...` | Requested image width or nominal video selector; absent for audio. |
|
|
2041
|
+
| `raw.height?` | `number` | `...` | Requested image height or nominal video selector; absent for audio. |
|
|
2042
|
+
| `raw.steps?` | `number` | `...` | Model-specific inference step count. |
|
|
2043
|
+
| `raw.durationSeconds?` | `number` | `...` | Requested video or music length in whole seconds. |
|
|
2044
|
+
| `raw.voiceId?` | `string` | `...` | Speech models only: a premade voice from the catalog; the default when omitted. |
|
|
2045
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | `...` | Video resolution; must match the nominal width/height selector. |
|
|
2046
|
+
| `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. |
|
|
2047
|
+
| `raw.generateAudio?` | `boolean` | `...` | Video audio selection. |
|
|
2048
|
+
| `raw.references?` | `object`[] | `...` | Host-authorized reference images. |
|
|
2049
|
+
| `raw.audioReferences?` | `object`[] | `...` | Host-authorized reference audio clips. |
|
|
2050
|
+
| `catalogue` | [`MediaCatalogue`](#mediacatalogue) | `mediaModels` | - |
|
|
1648
2051
|
|
|
1649
2052
|
#### Returns
|
|
1650
2053
|
|
|
1651
2054
|
`Readonly`\<`Omit`\<[`MediaGenerationSettings`](#mediagenerationsettings),
|
|
1652
|
-
`"references"`\> & `object`\>
|
|
2055
|
+
`"references"` \| `"audioReferences"`\> & `object`\>
|
|
1653
2056
|
|
|
1654
2057
|
---
|
|
1655
2058
|
|
|
@@ -1664,17 +2067,18 @@ or billing admission.
|
|
|
1664
2067
|
|
|
1665
2068
|
#### Parameters
|
|
1666
2069
|
|
|
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
|
-
| `
|
|
2070
|
+
| Parameter | Type | Default value | Description |
|
|
2071
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
2072
|
+
| `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` | - |
|
|
2073
|
+
| `raw.prompt` | `string` | `...` | Trimmed prompt; the selected model's `maxPromptLength` is enforced on top of this ceiling. |
|
|
2074
|
+
| `raw.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | `...` | Model-specific resolution, default 720p. |
|
|
2075
|
+
| `raw.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | `...` | Model-specific aspect, default 16:9. |
|
|
2076
|
+
| `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. |
|
|
2077
|
+
| `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. |
|
|
2078
|
+
| `raw.references?` | `object`[] | `...` | Up to four references, with provider-specific roles and mode limits. |
|
|
2079
|
+
| `raw.audioReferences?` | `object`[] | `...` | Reference audio clips, for a model declaring `audioReferences` (Seedance 2.5: 10 clips, 30 seconds). |
|
|
2080
|
+
| `raw.model` | `string` | `...` | - |
|
|
2081
|
+
| `catalogue` | [`MediaCatalogue`](#mediacatalogue) | `mediaModels` | - |
|
|
1678
2082
|
|
|
1679
2083
|
#### Returns
|
|
1680
2084
|
|
|
@@ -1863,7 +2267,7 @@ first problem.
|
|
|
1863
2267
|
function listMediaModels(): readonly Readonly<{
|
|
1864
2268
|
id: string;
|
|
1865
2269
|
label: string;
|
|
1866
|
-
kind: "image" | "video";
|
|
2270
|
+
kind: "image" | "video" | "audio";
|
|
1867
2271
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
1868
2272
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
1869
2273
|
maxPromptLength: number;
|
|
@@ -1905,12 +2309,31 @@ function listMediaModels(): readonly Readonly<{
|
|
|
1905
2309
|
referenceResolutions: readonly (
|
|
1906
2310
|
"480p" | "720p" | "768p" | "1080p" | "4k"
|
|
1907
2311
|
)[];
|
|
2312
|
+
audioReferences: Readonly<{
|
|
2313
|
+
max: number;
|
|
2314
|
+
totalSeconds: number;
|
|
2315
|
+
}> | null;
|
|
1908
2316
|
prices: readonly Readonly<{
|
|
1909
2317
|
resolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
1910
2318
|
silentMilliunitsPerSecond: number;
|
|
1911
2319
|
audioMilliunitsPerSecond: number;
|
|
1912
2320
|
}>[];
|
|
1913
2321
|
}> | null;
|
|
2322
|
+
audio: Readonly<{
|
|
2323
|
+
provider: "elevenlabs";
|
|
2324
|
+
mode: "music" | "speech";
|
|
2325
|
+
voices: readonly Readonly<{
|
|
2326
|
+
id: string;
|
|
2327
|
+
label: string;
|
|
2328
|
+
}>[];
|
|
2329
|
+
defaultVoiceId: string | null;
|
|
2330
|
+
seconds: Readonly<{
|
|
2331
|
+
min: number;
|
|
2332
|
+
max: number;
|
|
2333
|
+
default: number;
|
|
2334
|
+
}> | null;
|
|
2335
|
+
milliunitsPerUnit: number;
|
|
2336
|
+
}> | null;
|
|
1914
2337
|
}>[];
|
|
1915
2338
|
```
|
|
1916
2339
|
|
|
@@ -1919,8 +2342,8 @@ List the gateway provider's models in catalog order.
|
|
|
1919
2342
|
#### Returns
|
|
1920
2343
|
|
|
1921
2344
|
readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
1922
|
-
`"video"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
1923
|
-
`outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2345
|
+
`"video"` \| `"audio"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2346
|
+
`"max"`; `outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
1924
2347
|
`maxPromptLength`: `number`; `input`: `Readonly`\<\{ `transport`: `"json"` \|
|
|
1925
2348
|
`"multipart"`; `dimensions`: `"none"` \| `"own"`; `maxDimension`: `number` \|
|
|
1926
2349
|
`null`; `maxDimensionDocumented`: `boolean`; `defaultWidth`: `number`;
|
|
@@ -1940,10 +2363,16 @@ readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
|
1940
2363
|
`boolean`; `defaultGenerateAudio`: `boolean` \| `null`; `referenceRoles`:
|
|
1941
2364
|
readonly (`"first-frame"` \| `"last-frame"` \| `"reference"`)[];
|
|
1942
2365
|
`maxReferenceImages`: `number`; `referenceResolutions`: readonly (`"480p"` \|
|
|
1943
|
-
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `
|
|
1944
|
-
`Readonly`\<\{ `
|
|
1945
|
-
`
|
|
1946
|
-
`
|
|
2366
|
+
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `audioReferences`: \|
|
|
2367
|
+
`Readonly`\<\{ `max`: `number`; `totalSeconds`: `number`; \}\> \| `null`;
|
|
2368
|
+
`prices`: readonly `Readonly`\<\{ `resolution`: `"480p"` \| `"720p"` \| `"768p"`
|
|
2369
|
+
\| `"1080p"` \| `"4k"`; `silentMilliunitsPerSecond`: `number`;
|
|
2370
|
+
`audioMilliunitsPerSecond`: `number`; \}\>[]; \}\> \| `null`; `audio`: \|
|
|
2371
|
+
`Readonly`\<\{ `provider`: `"elevenlabs"`; `mode`: `"music"` \| `"speech"`;
|
|
2372
|
+
`voices`: readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; \}\>[];
|
|
2373
|
+
`defaultVoiceId`: `string` \| `null`; `seconds`: \| `Readonly`\<\{ `min`:
|
|
2374
|
+
`number`; `max`: `number`; `default`: `number`; \}\> \| `null`;
|
|
2375
|
+
`milliunitsPerUnit`: `number`; \}\> \| `null`; \}\>[]
|
|
1947
2376
|
|
|
1948
2377
|
---
|
|
1949
2378
|
|
|
@@ -1954,7 +2383,7 @@ function getGatewayModel(id):
|
|
|
1954
2383
|
| Readonly<{
|
|
1955
2384
|
id: string;
|
|
1956
2385
|
label: string;
|
|
1957
|
-
kind: "image" | "video";
|
|
2386
|
+
kind: "image" | "video" | "audio";
|
|
1958
2387
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
1959
2388
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
1960
2389
|
maxPromptLength: number;
|
|
@@ -1997,12 +2426,31 @@ function getGatewayModel(id):
|
|
|
1997
2426
|
referenceResolutions: readonly (
|
|
1998
2427
|
"480p" | "720p" | "768p" | "1080p" | "4k"
|
|
1999
2428
|
)[];
|
|
2429
|
+
audioReferences: Readonly<{
|
|
2430
|
+
max: number;
|
|
2431
|
+
totalSeconds: number;
|
|
2432
|
+
}> | null;
|
|
2000
2433
|
prices: readonly Readonly<{
|
|
2001
2434
|
resolution: "480p" | "720p" | "768p" | "1080p" | "4k";
|
|
2002
2435
|
silentMilliunitsPerSecond: number;
|
|
2003
2436
|
audioMilliunitsPerSecond: number;
|
|
2004
2437
|
}>[];
|
|
2005
2438
|
}> | null;
|
|
2439
|
+
audio: Readonly<{
|
|
2440
|
+
provider: "elevenlabs";
|
|
2441
|
+
mode: "music" | "speech";
|
|
2442
|
+
voices: readonly Readonly<{
|
|
2443
|
+
id: string;
|
|
2444
|
+
label: string;
|
|
2445
|
+
}>[];
|
|
2446
|
+
defaultVoiceId: string | null;
|
|
2447
|
+
seconds: Readonly<{
|
|
2448
|
+
min: number;
|
|
2449
|
+
max: number;
|
|
2450
|
+
default: number;
|
|
2451
|
+
}> | null;
|
|
2452
|
+
milliunitsPerUnit: number;
|
|
2453
|
+
}> | null;
|
|
2006
2454
|
}>
|
|
2007
2455
|
| undefined;
|
|
2008
2456
|
```
|
|
@@ -2019,8 +2467,8 @@ sees a custom provider's models.
|
|
|
2019
2467
|
#### Returns
|
|
2020
2468
|
|
|
2021
2469
|
\| `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
2022
|
-
`"video"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2023
|
-
`outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2470
|
+
`"video"` \| `"audio"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2471
|
+
`"max"`; `outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2024
2472
|
`maxPromptLength`: `number`; `input`: `Readonly`\<\{ `transport`: `"json"` \|
|
|
2025
2473
|
`"multipart"`; `dimensions`: `"none"` \| `"own"`; `maxDimension`: `number` \|
|
|
2026
2474
|
`null`; `maxDimensionDocumented`: `boolean`; `defaultWidth`: `number`;
|
|
@@ -2040,10 +2488,16 @@ sees a custom provider's models.
|
|
|
2040
2488
|
`boolean`; `defaultGenerateAudio`: `boolean` \| `null`; `referenceRoles`:
|
|
2041
2489
|
readonly (`"first-frame"` \| `"last-frame"` \| `"reference"`)[];
|
|
2042
2490
|
`maxReferenceImages`: `number`; `referenceResolutions`: readonly (`"480p"` \|
|
|
2043
|
-
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `
|
|
2044
|
-
`Readonly`\<\{ `
|
|
2045
|
-
`
|
|
2046
|
-
`
|
|
2491
|
+
`"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `audioReferences`: \|
|
|
2492
|
+
`Readonly`\<\{ `max`: `number`; `totalSeconds`: `number`; \}\> \| `null`;
|
|
2493
|
+
`prices`: readonly `Readonly`\<\{ `resolution`: `"480p"` \| `"720p"` \| `"768p"`
|
|
2494
|
+
\| `"1080p"` \| `"4k"`; `silentMilliunitsPerSecond`: `number`;
|
|
2495
|
+
`audioMilliunitsPerSecond`: `number`; \}\>[]; \}\> \| `null`; `audio`: \|
|
|
2496
|
+
`Readonly`\<\{ `provider`: `"elevenlabs"`; `mode`: `"music"` \| `"speech"`;
|
|
2497
|
+
`voices`: readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; \}\>[];
|
|
2498
|
+
`defaultVoiceId`: `string` \| `null`; `seconds`: \| `Readonly`\<\{ `min`:
|
|
2499
|
+
`number`; `max`: `number`; `default`: `number`; \}\> \| `null`;
|
|
2500
|
+
`milliunitsPerUnit`: `number`; \}\> \| `null`; \}\> \| `undefined`
|
|
2047
2501
|
|
|
2048
2502
|
---
|
|
2049
2503
|
|
|
@@ -2057,7 +2511,7 @@ function getMediaModel(
|
|
|
2057
2511
|
| Readonly<{
|
|
2058
2512
|
id: string;
|
|
2059
2513
|
label: string;
|
|
2060
|
-
kind: "image" | "video";
|
|
2514
|
+
kind: "image" | "video" | "audio";
|
|
2061
2515
|
tier: "draft" | "balanced" | "premium" | "max";
|
|
2062
2516
|
outputFormats: readonly ("png" | "jpeg" | "webp")[];
|
|
2063
2517
|
maxPromptLength: number;
|
|
@@ -2077,6 +2531,21 @@ function getMediaModel(
|
|
|
2077
2531
|
referenceFormat: "png" | "webp";
|
|
2078
2532
|
}>;
|
|
2079
2533
|
sizes: readonly string[] | null;
|
|
2534
|
+
audio: Readonly<{
|
|
2535
|
+
provider: "elevenlabs";
|
|
2536
|
+
mode: "music" | "speech";
|
|
2537
|
+
voices: readonly Readonly<{
|
|
2538
|
+
id: string;
|
|
2539
|
+
label: string;
|
|
2540
|
+
}>[];
|
|
2541
|
+
defaultVoiceId: string | null;
|
|
2542
|
+
seconds: Readonly<{
|
|
2543
|
+
min: number;
|
|
2544
|
+
max: number;
|
|
2545
|
+
default: number;
|
|
2546
|
+
}> | null;
|
|
2547
|
+
milliunitsPerUnit: number;
|
|
2548
|
+
}> | null;
|
|
2080
2549
|
video: Readonly<{
|
|
2081
2550
|
minSeconds: number;
|
|
2082
2551
|
maxSeconds: number;
|
|
@@ -2104,6 +2573,10 @@ function getMediaModel(
|
|
|
2104
2573
|
silentMilliunitsPerSecond: number;
|
|
2105
2574
|
audioMilliunitsPerSecond: number;
|
|
2106
2575
|
}>[];
|
|
2576
|
+
audioReferences: Readonly<{
|
|
2577
|
+
max: number;
|
|
2578
|
+
totalSeconds: number;
|
|
2579
|
+
}> | null;
|
|
2107
2580
|
provider: "seedance" | "veo" | "minimax" | "host";
|
|
2108
2581
|
}> | null;
|
|
2109
2582
|
}>
|
|
@@ -2123,8 +2596,8 @@ absent.
|
|
|
2123
2596
|
#### Returns
|
|
2124
2597
|
|
|
2125
2598
|
\| `Readonly`\<\{ `id`: `string`; `label`: `string`; `kind`: `"image"` \|
|
|
2126
|
-
`"video"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2127
|
-
`outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2599
|
+
`"video"` \| `"audio"`; `tier`: `"draft"` \| `"balanced"` \| `"premium"` \|
|
|
2600
|
+
`"max"`; `outputFormats`: readonly (`"png"` \| `"jpeg"` \| `"webp"`)[];
|
|
2128
2601
|
`maxPromptLength`: `number`; `input`: `Readonly`\<\{ `transport`: `"json"` \|
|
|
2129
2602
|
`"multipart"`; `dimensions`: `"none"` \| `"own"`; `maxDimension`: `number` \|
|
|
2130
2603
|
`null`; `maxDimensionDocumented`: `boolean`; `defaultWidth`: `number`;
|
|
@@ -2132,9 +2605,14 @@ absent.
|
|
|
2132
2605
|
`maxSteps`: `number` \| `null`; `defaultSteps`: `number` \| `null`;
|
|
2133
2606
|
`referenceField`: `string` \| `null`; `maxReferences`: `number`;
|
|
2134
2607
|
`referenceDimension`: `number` \| `null`; `referenceFormat`: `"png"` \|
|
|
2135
|
-
`"webp"`; \}\>; `sizes`: readonly `string`[] \| `null`; `
|
|
2136
|
-
`Readonly`\<\{ `
|
|
2137
|
-
`
|
|
2608
|
+
`"webp"`; \}\>; `sizes`: readonly `string`[] \| `null`; `audio`: \|
|
|
2609
|
+
`Readonly`\<\{ `provider`: `"elevenlabs"`; `mode`: `"music"` \| `"speech"`;
|
|
2610
|
+
`voices`: readonly `Readonly`\<\{ `id`: `string`; `label`: `string`; \}\>[];
|
|
2611
|
+
`defaultVoiceId`: `string` \| `null`; `seconds`: \| `Readonly`\<\{ `min`:
|
|
2612
|
+
`number`; `max`: `number`; `default`: `number`; \}\> \| `null`;
|
|
2613
|
+
`milliunitsPerUnit`: `number`; \}\> \| `null`; `video`: \| `Readonly`\<\{
|
|
2614
|
+
`minSeconds`: `number`; `maxSeconds`: `number`; `defaultSeconds`: `number`;
|
|
2615
|
+
`durations`: readonly `number`[]; `formats`: readonly `Readonly`\<\{
|
|
2138
2616
|
`resolution`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`;
|
|
2139
2617
|
`aspectRatio`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"`
|
|
2140
2618
|
\| `"9:21"`; `width`: `number`; `height`: `number`; \}\>[]; `defaultResolution`:
|
|
@@ -2146,8 +2624,10 @@ absent.
|
|
|
2146
2624
|
readonly (`"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`)[]; `prices`:
|
|
2147
2625
|
readonly `Readonly`\<\{ `resolution`: `"480p"` \| `"720p"` \| `"768p"` \|
|
|
2148
2626
|
`"1080p"` \| `"4k"`; `silentMilliunitsPerSecond`: `number`;
|
|
2149
|
-
`audioMilliunitsPerSecond`: `number`; \}\>[]; `
|
|
2150
|
-
`
|
|
2627
|
+
`audioMilliunitsPerSecond`: `number`; \}\>[]; `audioReferences`: \|
|
|
2628
|
+
`Readonly`\<\{ `max`: `number`; `totalSeconds`: `number`; \}\> \| `null`;
|
|
2629
|
+
`provider`: `"seedance"` \| `"veo"` \| `"minimax"` \| `"host"`; \}\> \| `null`;
|
|
2630
|
+
\}\> \| `undefined`
|
|
2151
2631
|
|
|
2152
2632
|
---
|
|
2153
2633
|
|