@runapi.ai/suno 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,12 +41,1186 @@ var import_core22 = require("@runapi.ai/core");
41
41
  // src/resources/text-to-music.ts
42
42
  var import_core = require("@runapi.ai/core");
43
43
  var import_internal = require("@runapi.ai/core/internal");
44
+
45
+ // src/contract_gen.ts
46
+ var contract = {
47
+ "add-instrumental": {
48
+ "models": [
49
+ "suno-v4.5-plus",
50
+ "suno-v5",
51
+ "suno-v5.5"
52
+ ],
53
+ "fields_by_model": {
54
+ "suno-v4.5-plus": {
55
+ "model": {
56
+ "required": true
57
+ },
58
+ "upload_url": {
59
+ "required": true
60
+ },
61
+ "vocal_gender": {
62
+ "enum": [
63
+ "male",
64
+ "female"
65
+ ]
66
+ }
67
+ },
68
+ "suno-v5": {
69
+ "model": {
70
+ "required": true
71
+ },
72
+ "upload_url": {
73
+ "required": true
74
+ },
75
+ "vocal_gender": {
76
+ "enum": [
77
+ "male",
78
+ "female"
79
+ ]
80
+ }
81
+ },
82
+ "suno-v5.5": {
83
+ "model": {
84
+ "required": true
85
+ },
86
+ "upload_url": {
87
+ "required": true
88
+ },
89
+ "vocal_gender": {
90
+ "enum": [
91
+ "male",
92
+ "female"
93
+ ]
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "add-vocals": {
99
+ "models": [
100
+ "suno-v4.5-plus",
101
+ "suno-v5"
102
+ ],
103
+ "fields_by_model": {
104
+ "suno-v4.5-plus": {
105
+ "lyrics": {
106
+ "required": true
107
+ },
108
+ "model": {
109
+ "required": true
110
+ },
111
+ "upload_url": {
112
+ "required": true
113
+ },
114
+ "vocal_gender": {
115
+ "enum": [
116
+ "male",
117
+ "female"
118
+ ]
119
+ }
120
+ },
121
+ "suno-v5": {
122
+ "lyrics": {
123
+ "required": true
124
+ },
125
+ "model": {
126
+ "required": true
127
+ },
128
+ "upload_url": {
129
+ "required": true
130
+ },
131
+ "vocal_gender": {
132
+ "enum": [
133
+ "male",
134
+ "female"
135
+ ]
136
+ }
137
+ }
138
+ }
139
+ },
140
+ "boost-style": {
141
+ "models": [],
142
+ "fields_by_model": {
143
+ "_": {}
144
+ }
145
+ },
146
+ "check-voice": {
147
+ "models": [],
148
+ "fields_by_model": {
149
+ "_": {
150
+ "task_id": {
151
+ "required": true
152
+ }
153
+ }
154
+ }
155
+ },
156
+ "convert-audio": {
157
+ "models": [],
158
+ "fields_by_model": {
159
+ "_": {}
160
+ }
161
+ },
162
+ "cover-audio": {
163
+ "models": [
164
+ "suno-v4",
165
+ "suno-v4.5",
166
+ "suno-v4.5-all",
167
+ "suno-v4.5-plus",
168
+ "suno-v5",
169
+ "suno-v5.5"
170
+ ],
171
+ "fields_by_model": {
172
+ "suno-v4": {
173
+ "model": {
174
+ "required": true
175
+ },
176
+ "persona_type": {
177
+ "enum": [
178
+ "style",
179
+ "voice"
180
+ ]
181
+ },
182
+ "upload_url": {
183
+ "required": true
184
+ },
185
+ "vocal_gender": {
186
+ "enum": [
187
+ "male",
188
+ "female"
189
+ ]
190
+ },
191
+ "vocal_mode": {
192
+ "enum": [
193
+ "auto_lyrics",
194
+ "exact_lyrics",
195
+ "instrumental"
196
+ ],
197
+ "required": true
198
+ }
199
+ },
200
+ "suno-v4.5": {
201
+ "model": {
202
+ "required": true
203
+ },
204
+ "persona_type": {
205
+ "enum": [
206
+ "style",
207
+ "voice"
208
+ ]
209
+ },
210
+ "upload_url": {
211
+ "required": true
212
+ },
213
+ "vocal_gender": {
214
+ "enum": [
215
+ "male",
216
+ "female"
217
+ ]
218
+ },
219
+ "vocal_mode": {
220
+ "enum": [
221
+ "auto_lyrics",
222
+ "exact_lyrics",
223
+ "instrumental"
224
+ ],
225
+ "required": true
226
+ }
227
+ },
228
+ "suno-v4.5-all": {
229
+ "model": {
230
+ "required": true
231
+ },
232
+ "persona_type": {
233
+ "enum": [
234
+ "style",
235
+ "voice"
236
+ ]
237
+ },
238
+ "upload_url": {
239
+ "required": true
240
+ },
241
+ "vocal_gender": {
242
+ "enum": [
243
+ "male",
244
+ "female"
245
+ ]
246
+ },
247
+ "vocal_mode": {
248
+ "enum": [
249
+ "auto_lyrics",
250
+ "exact_lyrics",
251
+ "instrumental"
252
+ ],
253
+ "required": true
254
+ }
255
+ },
256
+ "suno-v4.5-plus": {
257
+ "model": {
258
+ "required": true
259
+ },
260
+ "persona_type": {
261
+ "enum": [
262
+ "style",
263
+ "voice"
264
+ ]
265
+ },
266
+ "upload_url": {
267
+ "required": true
268
+ },
269
+ "vocal_gender": {
270
+ "enum": [
271
+ "male",
272
+ "female"
273
+ ]
274
+ },
275
+ "vocal_mode": {
276
+ "enum": [
277
+ "auto_lyrics",
278
+ "exact_lyrics",
279
+ "instrumental"
280
+ ],
281
+ "required": true
282
+ }
283
+ },
284
+ "suno-v5": {
285
+ "model": {
286
+ "required": true
287
+ },
288
+ "persona_type": {
289
+ "enum": [
290
+ "style",
291
+ "voice"
292
+ ]
293
+ },
294
+ "upload_url": {
295
+ "required": true
296
+ },
297
+ "vocal_gender": {
298
+ "enum": [
299
+ "male",
300
+ "female"
301
+ ]
302
+ },
303
+ "vocal_mode": {
304
+ "enum": [
305
+ "auto_lyrics",
306
+ "exact_lyrics",
307
+ "instrumental"
308
+ ],
309
+ "required": true
310
+ }
311
+ },
312
+ "suno-v5.5": {
313
+ "model": {
314
+ "required": true
315
+ },
316
+ "persona_type": {
317
+ "enum": [
318
+ "style",
319
+ "voice"
320
+ ]
321
+ },
322
+ "upload_url": {
323
+ "required": true
324
+ },
325
+ "vocal_gender": {
326
+ "enum": [
327
+ "male",
328
+ "female"
329
+ ]
330
+ },
331
+ "vocal_mode": {
332
+ "enum": [
333
+ "auto_lyrics",
334
+ "exact_lyrics",
335
+ "instrumental"
336
+ ],
337
+ "required": true
338
+ }
339
+ }
340
+ },
341
+ "rules": [
342
+ {
343
+ "when": {
344
+ "vocal_mode": "auto_lyrics"
345
+ },
346
+ "required": [
347
+ "prompt"
348
+ ],
349
+ "forbidden": [
350
+ "lyrics",
351
+ "style",
352
+ "title"
353
+ ]
354
+ },
355
+ {
356
+ "when": {
357
+ "vocal_mode": "exact_lyrics"
358
+ },
359
+ "required": [
360
+ "lyrics",
361
+ "style",
362
+ "title"
363
+ ],
364
+ "forbidden": [
365
+ "prompt"
366
+ ]
367
+ },
368
+ {
369
+ "when": {
370
+ "vocal_mode": "instrumental"
371
+ },
372
+ "required": [
373
+ "style",
374
+ "title"
375
+ ],
376
+ "forbidden": [
377
+ "prompt",
378
+ "lyrics"
379
+ ]
380
+ }
381
+ ]
382
+ },
383
+ "create-mashup": {
384
+ "models": [
385
+ "suno-v4",
386
+ "suno-v4.5",
387
+ "suno-v4.5-all",
388
+ "suno-v4.5-plus",
389
+ "suno-v5",
390
+ "suno-v5.5"
391
+ ],
392
+ "fields_by_model": {
393
+ "suno-v4": {
394
+ "model": {
395
+ "required": true
396
+ },
397
+ "persona_type": {
398
+ "enum": [
399
+ "style",
400
+ "voice"
401
+ ]
402
+ },
403
+ "upload_url_list": {
404
+ "required": true
405
+ },
406
+ "vocal_gender": {
407
+ "enum": [
408
+ "male",
409
+ "female"
410
+ ]
411
+ },
412
+ "vocal_mode": {
413
+ "enum": [
414
+ "auto_lyrics",
415
+ "exact_lyrics",
416
+ "instrumental"
417
+ ],
418
+ "required": true
419
+ }
420
+ },
421
+ "suno-v4.5": {
422
+ "model": {
423
+ "required": true
424
+ },
425
+ "persona_type": {
426
+ "enum": [
427
+ "style",
428
+ "voice"
429
+ ]
430
+ },
431
+ "upload_url_list": {
432
+ "required": true
433
+ },
434
+ "vocal_gender": {
435
+ "enum": [
436
+ "male",
437
+ "female"
438
+ ]
439
+ },
440
+ "vocal_mode": {
441
+ "enum": [
442
+ "auto_lyrics",
443
+ "exact_lyrics",
444
+ "instrumental"
445
+ ],
446
+ "required": true
447
+ }
448
+ },
449
+ "suno-v4.5-all": {
450
+ "model": {
451
+ "required": true
452
+ },
453
+ "persona_type": {
454
+ "enum": [
455
+ "style",
456
+ "voice"
457
+ ]
458
+ },
459
+ "upload_url_list": {
460
+ "required": true
461
+ },
462
+ "vocal_gender": {
463
+ "enum": [
464
+ "male",
465
+ "female"
466
+ ]
467
+ },
468
+ "vocal_mode": {
469
+ "enum": [
470
+ "auto_lyrics",
471
+ "exact_lyrics",
472
+ "instrumental"
473
+ ],
474
+ "required": true
475
+ }
476
+ },
477
+ "suno-v4.5-plus": {
478
+ "model": {
479
+ "required": true
480
+ },
481
+ "persona_type": {
482
+ "enum": [
483
+ "style",
484
+ "voice"
485
+ ]
486
+ },
487
+ "upload_url_list": {
488
+ "required": true
489
+ },
490
+ "vocal_gender": {
491
+ "enum": [
492
+ "male",
493
+ "female"
494
+ ]
495
+ },
496
+ "vocal_mode": {
497
+ "enum": [
498
+ "auto_lyrics",
499
+ "exact_lyrics",
500
+ "instrumental"
501
+ ],
502
+ "required": true
503
+ }
504
+ },
505
+ "suno-v5": {
506
+ "model": {
507
+ "required": true
508
+ },
509
+ "persona_type": {
510
+ "enum": [
511
+ "style",
512
+ "voice"
513
+ ]
514
+ },
515
+ "upload_url_list": {
516
+ "required": true
517
+ },
518
+ "vocal_gender": {
519
+ "enum": [
520
+ "male",
521
+ "female"
522
+ ]
523
+ },
524
+ "vocal_mode": {
525
+ "enum": [
526
+ "auto_lyrics",
527
+ "exact_lyrics",
528
+ "instrumental"
529
+ ],
530
+ "required": true
531
+ }
532
+ },
533
+ "suno-v5.5": {
534
+ "model": {
535
+ "required": true
536
+ },
537
+ "persona_type": {
538
+ "enum": [
539
+ "style",
540
+ "voice"
541
+ ]
542
+ },
543
+ "upload_url_list": {
544
+ "required": true
545
+ },
546
+ "vocal_gender": {
547
+ "enum": [
548
+ "male",
549
+ "female"
550
+ ]
551
+ },
552
+ "vocal_mode": {
553
+ "enum": [
554
+ "auto_lyrics",
555
+ "exact_lyrics",
556
+ "instrumental"
557
+ ],
558
+ "required": true
559
+ }
560
+ }
561
+ },
562
+ "rules": [
563
+ {
564
+ "when": {
565
+ "vocal_mode": "auto_lyrics"
566
+ },
567
+ "required": [
568
+ "prompt"
569
+ ],
570
+ "forbidden": [
571
+ "lyrics",
572
+ "style",
573
+ "title"
574
+ ]
575
+ },
576
+ {
577
+ "when": {
578
+ "vocal_mode": "exact_lyrics"
579
+ },
580
+ "required": [
581
+ "lyrics",
582
+ "style",
583
+ "title"
584
+ ],
585
+ "forbidden": [
586
+ "prompt"
587
+ ]
588
+ },
589
+ {
590
+ "when": {
591
+ "vocal_mode": "instrumental"
592
+ },
593
+ "required": [
594
+ "style",
595
+ "title"
596
+ ],
597
+ "forbidden": [
598
+ "prompt",
599
+ "lyrics"
600
+ ]
601
+ }
602
+ ]
603
+ },
604
+ "extend-music": {
605
+ "models": [
606
+ "suno-v4",
607
+ "suno-v4.5",
608
+ "suno-v4.5-all",
609
+ "suno-v4.5-plus",
610
+ "suno-v5",
611
+ "suno-v5.5"
612
+ ],
613
+ "fields_by_model": {
614
+ "suno-v4": {
615
+ "model": {
616
+ "required": true
617
+ },
618
+ "parameter_mode": {
619
+ "enum": [
620
+ "source",
621
+ "custom"
622
+ ]
623
+ },
624
+ "persona_type": {
625
+ "enum": [
626
+ "style",
627
+ "voice"
628
+ ]
629
+ },
630
+ "vocal_gender": {
631
+ "enum": [
632
+ "male",
633
+ "female"
634
+ ]
635
+ }
636
+ },
637
+ "suno-v4.5": {
638
+ "model": {
639
+ "required": true
640
+ },
641
+ "parameter_mode": {
642
+ "enum": [
643
+ "source",
644
+ "custom"
645
+ ]
646
+ },
647
+ "persona_type": {
648
+ "enum": [
649
+ "style",
650
+ "voice"
651
+ ]
652
+ },
653
+ "vocal_gender": {
654
+ "enum": [
655
+ "male",
656
+ "female"
657
+ ]
658
+ }
659
+ },
660
+ "suno-v4.5-all": {
661
+ "model": {
662
+ "required": true
663
+ },
664
+ "parameter_mode": {
665
+ "enum": [
666
+ "source",
667
+ "custom"
668
+ ]
669
+ },
670
+ "persona_type": {
671
+ "enum": [
672
+ "style",
673
+ "voice"
674
+ ]
675
+ },
676
+ "vocal_gender": {
677
+ "enum": [
678
+ "male",
679
+ "female"
680
+ ]
681
+ }
682
+ },
683
+ "suno-v4.5-plus": {
684
+ "model": {
685
+ "required": true
686
+ },
687
+ "parameter_mode": {
688
+ "enum": [
689
+ "source",
690
+ "custom"
691
+ ]
692
+ },
693
+ "persona_type": {
694
+ "enum": [
695
+ "style",
696
+ "voice"
697
+ ]
698
+ },
699
+ "vocal_gender": {
700
+ "enum": [
701
+ "male",
702
+ "female"
703
+ ]
704
+ }
705
+ },
706
+ "suno-v5": {
707
+ "model": {
708
+ "required": true
709
+ },
710
+ "parameter_mode": {
711
+ "enum": [
712
+ "source",
713
+ "custom"
714
+ ]
715
+ },
716
+ "persona_type": {
717
+ "enum": [
718
+ "style",
719
+ "voice"
720
+ ]
721
+ },
722
+ "vocal_gender": {
723
+ "enum": [
724
+ "male",
725
+ "female"
726
+ ]
727
+ }
728
+ },
729
+ "suno-v5.5": {
730
+ "model": {
731
+ "required": true
732
+ },
733
+ "parameter_mode": {
734
+ "enum": [
735
+ "source",
736
+ "custom"
737
+ ]
738
+ },
739
+ "persona_type": {
740
+ "enum": [
741
+ "style",
742
+ "voice"
743
+ ]
744
+ },
745
+ "vocal_gender": {
746
+ "enum": [
747
+ "male",
748
+ "female"
749
+ ]
750
+ }
751
+ }
752
+ }
753
+ },
754
+ "generate-artwork": {
755
+ "models": [],
756
+ "fields_by_model": {
757
+ "_": {
758
+ "task_id": {
759
+ "required": true
760
+ }
761
+ }
762
+ }
763
+ },
764
+ "generate-lyrics": {
765
+ "models": [],
766
+ "fields_by_model": {
767
+ "_": {}
768
+ }
769
+ },
770
+ "generate-midi": {
771
+ "models": [],
772
+ "fields_by_model": {
773
+ "_": {}
774
+ }
775
+ },
776
+ "generate-persona": {
777
+ "models": [],
778
+ "fields_by_model": {
779
+ "_": {}
780
+ }
781
+ },
782
+ "generate-voice": {
783
+ "models": [],
784
+ "fields_by_model": {
785
+ "_": {
786
+ "singer_skill_level": {
787
+ "enum": [
788
+ "beginner",
789
+ "intermediate",
790
+ "advanced",
791
+ "professional"
792
+ ]
793
+ },
794
+ "task_id": {
795
+ "required": true
796
+ },
797
+ "verify_url": {
798
+ "required": true
799
+ }
800
+ }
801
+ }
802
+ },
803
+ "get-timestamped-lyrics": {
804
+ "models": [],
805
+ "fields_by_model": {
806
+ "_": {}
807
+ }
808
+ },
809
+ "regenerate-validation-phrase": {
810
+ "models": [],
811
+ "fields_by_model": {
812
+ "_": {
813
+ "task_id": {
814
+ "required": true
815
+ }
816
+ }
817
+ }
818
+ },
819
+ "replace-section": {
820
+ "models": [],
821
+ "fields_by_model": {
822
+ "_": {
823
+ "full_lyrics": {
824
+ "required": true
825
+ },
826
+ "infill_end_time": {
827
+ "required": true
828
+ },
829
+ "infill_start_time": {
830
+ "required": true
831
+ },
832
+ "lyrics": {
833
+ "required": true
834
+ },
835
+ "model": {
836
+ "enum": [
837
+ "suno-v4",
838
+ "suno-v4.5",
839
+ "suno-v4.5-all",
840
+ "suno-v4.5-plus",
841
+ "suno-v5",
842
+ "suno-v5.5"
843
+ ]
844
+ },
845
+ "tags": {
846
+ "required": true
847
+ },
848
+ "title": {
849
+ "required": true
850
+ }
851
+ }
852
+ }
853
+ },
854
+ "separate-audio-stems": {
855
+ "models": [],
856
+ "fields_by_model": {
857
+ "_": {
858
+ "audio_id": {
859
+ "required": true
860
+ },
861
+ "task_id": {
862
+ "required": true
863
+ }
864
+ }
865
+ }
866
+ },
867
+ "text-to-music": {
868
+ "models": [
869
+ "suno-v4",
870
+ "suno-v4.5",
871
+ "suno-v4.5-all",
872
+ "suno-v4.5-plus",
873
+ "suno-v5",
874
+ "suno-v5.5"
875
+ ],
876
+ "fields_by_model": {
877
+ "suno-v4": {
878
+ "duration_seconds": {
879
+ "type": "integer"
880
+ },
881
+ "model": {
882
+ "required": true
883
+ },
884
+ "persona_type": {
885
+ "enum": [
886
+ "style",
887
+ "voice"
888
+ ]
889
+ },
890
+ "vocal_gender": {
891
+ "enum": [
892
+ "male",
893
+ "female"
894
+ ]
895
+ },
896
+ "vocal_mode": {
897
+ "enum": [
898
+ "auto_lyrics",
899
+ "exact_lyrics",
900
+ "instrumental"
901
+ ],
902
+ "required": true
903
+ }
904
+ },
905
+ "suno-v4.5": {
906
+ "duration_seconds": {
907
+ "type": "integer"
908
+ },
909
+ "model": {
910
+ "required": true
911
+ },
912
+ "persona_type": {
913
+ "enum": [
914
+ "style",
915
+ "voice"
916
+ ]
917
+ },
918
+ "vocal_gender": {
919
+ "enum": [
920
+ "male",
921
+ "female"
922
+ ]
923
+ },
924
+ "vocal_mode": {
925
+ "enum": [
926
+ "auto_lyrics",
927
+ "exact_lyrics",
928
+ "instrumental"
929
+ ],
930
+ "required": true
931
+ }
932
+ },
933
+ "suno-v4.5-all": {
934
+ "duration_seconds": {
935
+ "type": "integer"
936
+ },
937
+ "model": {
938
+ "required": true
939
+ },
940
+ "persona_type": {
941
+ "enum": [
942
+ "style",
943
+ "voice"
944
+ ]
945
+ },
946
+ "vocal_gender": {
947
+ "enum": [
948
+ "male",
949
+ "female"
950
+ ]
951
+ },
952
+ "vocal_mode": {
953
+ "enum": [
954
+ "auto_lyrics",
955
+ "exact_lyrics",
956
+ "instrumental"
957
+ ],
958
+ "required": true
959
+ }
960
+ },
961
+ "suno-v4.5-plus": {
962
+ "duration_seconds": {
963
+ "type": "integer"
964
+ },
965
+ "model": {
966
+ "required": true
967
+ },
968
+ "persona_type": {
969
+ "enum": [
970
+ "style",
971
+ "voice"
972
+ ]
973
+ },
974
+ "vocal_gender": {
975
+ "enum": [
976
+ "male",
977
+ "female"
978
+ ]
979
+ },
980
+ "vocal_mode": {
981
+ "enum": [
982
+ "auto_lyrics",
983
+ "exact_lyrics",
984
+ "instrumental"
985
+ ],
986
+ "required": true
987
+ }
988
+ },
989
+ "suno-v5": {
990
+ "duration_seconds": {
991
+ "type": "integer"
992
+ },
993
+ "model": {
994
+ "required": true
995
+ },
996
+ "persona_type": {
997
+ "enum": [
998
+ "style",
999
+ "voice"
1000
+ ]
1001
+ },
1002
+ "vocal_gender": {
1003
+ "enum": [
1004
+ "male",
1005
+ "female"
1006
+ ]
1007
+ },
1008
+ "vocal_mode": {
1009
+ "enum": [
1010
+ "auto_lyrics",
1011
+ "exact_lyrics",
1012
+ "instrumental"
1013
+ ],
1014
+ "required": true
1015
+ }
1016
+ },
1017
+ "suno-v5.5": {
1018
+ "duration_seconds": {
1019
+ "type": "integer"
1020
+ },
1021
+ "model": {
1022
+ "required": true
1023
+ },
1024
+ "persona_type": {
1025
+ "enum": [
1026
+ "style",
1027
+ "voice"
1028
+ ]
1029
+ },
1030
+ "vocal_gender": {
1031
+ "enum": [
1032
+ "male",
1033
+ "female"
1034
+ ]
1035
+ },
1036
+ "vocal_mode": {
1037
+ "enum": [
1038
+ "auto_lyrics",
1039
+ "exact_lyrics",
1040
+ "instrumental"
1041
+ ],
1042
+ "required": true
1043
+ }
1044
+ }
1045
+ },
1046
+ "rules": [
1047
+ {
1048
+ "when": {
1049
+ "vocal_mode": "auto_lyrics"
1050
+ },
1051
+ "required": [
1052
+ "prompt"
1053
+ ],
1054
+ "forbidden": [
1055
+ "lyrics",
1056
+ "style",
1057
+ "title"
1058
+ ]
1059
+ },
1060
+ {
1061
+ "when": {
1062
+ "vocal_mode": "exact_lyrics"
1063
+ },
1064
+ "required": [
1065
+ "lyrics",
1066
+ "style",
1067
+ "title"
1068
+ ],
1069
+ "forbidden": [
1070
+ "prompt"
1071
+ ]
1072
+ },
1073
+ {
1074
+ "when": {
1075
+ "vocal_mode": "instrumental"
1076
+ },
1077
+ "required": [
1078
+ "style",
1079
+ "title"
1080
+ ],
1081
+ "forbidden": [
1082
+ "prompt",
1083
+ "lyrics"
1084
+ ]
1085
+ }
1086
+ ]
1087
+ },
1088
+ "text-to-sound": {
1089
+ "models": [
1090
+ "suno-v5",
1091
+ "suno-v5.5"
1092
+ ],
1093
+ "fields_by_model": {
1094
+ "suno-v5": {
1095
+ "model": {
1096
+ "required": true
1097
+ },
1098
+ "prompt": {
1099
+ "required": true
1100
+ },
1101
+ "sound_key": {
1102
+ "enum": [
1103
+ "Cm",
1104
+ "C#m",
1105
+ "Dm",
1106
+ "D#m",
1107
+ "Em",
1108
+ "Fm",
1109
+ "F#m",
1110
+ "Gm",
1111
+ "G#m",
1112
+ "Am",
1113
+ "A#m",
1114
+ "Bm",
1115
+ "C",
1116
+ "C#",
1117
+ "D",
1118
+ "D#",
1119
+ "E",
1120
+ "F",
1121
+ "F#",
1122
+ "G",
1123
+ "G#",
1124
+ "A",
1125
+ "A#",
1126
+ "B"
1127
+ ]
1128
+ },
1129
+ "sound_tempo": {
1130
+ "type": "integer"
1131
+ }
1132
+ },
1133
+ "suno-v5.5": {
1134
+ "model": {
1135
+ "required": true
1136
+ },
1137
+ "prompt": {
1138
+ "required": true
1139
+ },
1140
+ "sound_key": {
1141
+ "enum": [
1142
+ "Cm",
1143
+ "C#m",
1144
+ "Dm",
1145
+ "D#m",
1146
+ "Em",
1147
+ "Fm",
1148
+ "F#m",
1149
+ "Gm",
1150
+ "G#m",
1151
+ "Am",
1152
+ "A#m",
1153
+ "Bm",
1154
+ "C",
1155
+ "C#",
1156
+ "D",
1157
+ "D#",
1158
+ "E",
1159
+ "F",
1160
+ "F#",
1161
+ "G",
1162
+ "G#",
1163
+ "A",
1164
+ "A#",
1165
+ "B"
1166
+ ]
1167
+ },
1168
+ "sound_tempo": {
1169
+ "type": "integer"
1170
+ }
1171
+ }
1172
+ }
1173
+ },
1174
+ "visualize-music": {
1175
+ "models": [],
1176
+ "fields_by_model": {
1177
+ "_": {}
1178
+ }
1179
+ },
1180
+ "voice-to-validation-phrase": {
1181
+ "models": [],
1182
+ "fields_by_model": {
1183
+ "_": {
1184
+ "language": {
1185
+ "enum": [
1186
+ "en",
1187
+ "zh",
1188
+ "es",
1189
+ "fr",
1190
+ "pt",
1191
+ "de",
1192
+ "ja",
1193
+ "ko",
1194
+ "hi",
1195
+ "ru"
1196
+ ]
1197
+ },
1198
+ "vocal_end_seconds": {
1199
+ "required": true,
1200
+ "type": "integer"
1201
+ },
1202
+ "vocal_start_seconds": {
1203
+ "required": true,
1204
+ "type": "integer"
1205
+ }
1206
+ }
1207
+ }
1208
+ }
1209
+ };
1210
+
1211
+ // src/resources/text-to-music.ts
44
1212
  var ENDPOINT = "/api/v1/suno/text_to_music";
45
1213
  var TextToMusic = class {
46
1214
  constructor(http) {
47
1215
  this.http = http;
48
1216
  }
49
1217
  http;
1218
+ /**
1219
+ * Create a text to music task and wait until complete.
1220
+ * @param params Text to music parameters.
1221
+ * @param options Per-request and polling overrides.
1222
+ * @returns The completed text to music response.
1223
+ */
50
1224
  async run(params, options) {
51
1225
  const { id } = await this.create(params, options);
52
1226
  const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
@@ -55,12 +1229,26 @@ var TextToMusic = class {
55
1229
  });
56
1230
  return response;
57
1231
  }
1232
+ /**
1233
+ * Create a text to music task; returns immediately with a task id.
1234
+ * @param params Text to music parameters.
1235
+ * @param options Per-request overrides.
1236
+ * @returns The task creation result.
1237
+ */
58
1238
  async create(params, options) {
1239
+ const body = (0, import_core.compactParams)(params);
1240
+ (0, import_core.validateParams)(contract["text-to-music"], body);
59
1241
  return this.http.request("POST", ENDPOINT, {
60
- body: (0, import_core.compactParams)(params),
1242
+ body,
61
1243
  ...options
62
1244
  });
63
1245
  }
1246
+ /**
1247
+ * Fetch the current status of a text to music task.
1248
+ * @param id The task id.
1249
+ * @param options Per-request overrides.
1250
+ * @returns The current text to music task status.
1251
+ */
64
1252
  async get(id, options) {
65
1253
  return this.http.request("GET", `${ENDPOINT}/${id}`, {
66
1254
  ...options
@@ -77,6 +1265,12 @@ var ExtendMusic = class {
77
1265
  this.http = http;
78
1266
  }
79
1267
  http;
1268
+ /**
1269
+ * Create an extend music task and wait until complete.
1270
+ * @param params Extend music parameters.
1271
+ * @param options Per-request and polling overrides.
1272
+ * @returns The completed extend music response.
1273
+ */
80
1274
  async run(params, options) {
81
1275
  const { id } = await this.create(params, options);
82
1276
  const response = await (0, import_internal2.pollUntilComplete)(() => this.get(id, options), {
@@ -85,12 +1279,24 @@ var ExtendMusic = class {
85
1279
  });
86
1280
  return response;
87
1281
  }
1282
+ /**
1283
+ * Create an extend music task; returns immediately with a task id.
1284
+ * @param params Extend music parameters.
1285
+ * @param options Per-request overrides.
1286
+ * @returns The task creation result.
1287
+ */
88
1288
  async create(params, options) {
89
1289
  return this.http.request("POST", ENDPOINT2, {
90
1290
  body: (0, import_core2.compactParams)(params),
91
1291
  ...options
92
1292
  });
93
1293
  }
1294
+ /**
1295
+ * Fetch the current status of an extend music task.
1296
+ * @param id The task id.
1297
+ * @param options Per-request overrides.
1298
+ * @returns The current extend music task status.
1299
+ */
94
1300
  async get(id, options) {
95
1301
  return this.http.request("GET", `${ENDPOINT2}/${id}`, {
96
1302
  ...options
@@ -107,6 +1313,12 @@ var GenerateArtwork = class {
107
1313
  this.http = http;
108
1314
  }
109
1315
  http;
1316
+ /**
1317
+ * Create a generate artwork task and wait until complete.
1318
+ * @param params Generate artwork parameters.
1319
+ * @param options Per-request and polling overrides.
1320
+ * @returns The completed generate artwork response.
1321
+ */
110
1322
  async run(params, options) {
111
1323
  const { id } = await this.create(params, options);
112
1324
  const response = await (0, import_internal3.pollUntilComplete)(() => this.get(id, options), {
@@ -115,12 +1327,24 @@ var GenerateArtwork = class {
115
1327
  });
116
1328
  return response;
117
1329
  }
1330
+ /**
1331
+ * Create a generate artwork task; returns immediately with a task id.
1332
+ * @param params Generate artwork parameters.
1333
+ * @param options Per-request overrides.
1334
+ * @returns The task creation result.
1335
+ */
118
1336
  async create(params, options) {
119
1337
  return this.http.request("POST", ENDPOINT3, {
120
1338
  body: (0, import_core3.compactParams)(params),
121
1339
  ...options
122
1340
  });
123
1341
  }
1342
+ /**
1343
+ * Fetch the current status of a generate artwork task.
1344
+ * @param id The task id.
1345
+ * @param options Per-request overrides.
1346
+ * @returns The current generate artwork task status.
1347
+ */
124
1348
  async get(id, options) {
125
1349
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
126
1350
  ...options
@@ -137,6 +1361,12 @@ var CoverAudio = class {
137
1361
  this.http = http;
138
1362
  }
139
1363
  http;
1364
+ /**
1365
+ * Create a cover audio task and wait until complete.
1366
+ * @param params Cover audio parameters.
1367
+ * @param options Per-request and polling overrides.
1368
+ * @returns The completed cover audio response.
1369
+ */
140
1370
  async run(params, options) {
141
1371
  const { id } = await this.create(params, options);
142
1372
  const response = await (0, import_internal4.pollUntilComplete)(() => this.get(id, options), {
@@ -145,12 +1375,26 @@ var CoverAudio = class {
145
1375
  });
146
1376
  return response;
147
1377
  }
1378
+ /**
1379
+ * Create a cover audio task; returns immediately with a task id.
1380
+ * @param params Cover audio parameters.
1381
+ * @param options Per-request overrides.
1382
+ * @returns The task creation result.
1383
+ */
148
1384
  async create(params, options) {
1385
+ const body = (0, import_core4.compactParams)(params);
1386
+ (0, import_core4.validateParams)(contract["cover-audio"], body);
149
1387
  return this.http.request("POST", ENDPOINT4, {
150
- body: (0, import_core4.compactParams)(params),
1388
+ body,
151
1389
  ...options
152
1390
  });
153
1391
  }
1392
+ /**
1393
+ * Fetch the current status of a cover audio task.
1394
+ * @param id The task id.
1395
+ * @param options Per-request overrides.
1396
+ * @returns The current cover audio task status.
1397
+ */
154
1398
  async get(id, options) {
155
1399
  return this.http.request("GET", `${ENDPOINT4}/${id}`, {
156
1400
  ...options
@@ -167,6 +1411,12 @@ var AddInstrumental = class {
167
1411
  this.http = http;
168
1412
  }
169
1413
  http;
1414
+ /**
1415
+ * Create an add instrumental task and wait until complete.
1416
+ * @param params Add instrumental parameters.
1417
+ * @param options Per-request and polling overrides.
1418
+ * @returns The completed add instrumental response.
1419
+ */
170
1420
  async run(params, options) {
171
1421
  const { id } = await this.create(params, options);
172
1422
  const response = await (0, import_internal5.pollUntilComplete)(() => this.get(id, options), {
@@ -175,12 +1425,24 @@ var AddInstrumental = class {
175
1425
  });
176
1426
  return response;
177
1427
  }
1428
+ /**
1429
+ * Create an add instrumental task; returns immediately with a task id.
1430
+ * @param params Add instrumental parameters.
1431
+ * @param options Per-request overrides.
1432
+ * @returns The task creation result.
1433
+ */
178
1434
  async create(params, options) {
179
1435
  return this.http.request("POST", ENDPOINT5, {
180
1436
  body: (0, import_core5.compactParams)(params),
181
1437
  ...options
182
1438
  });
183
1439
  }
1440
+ /**
1441
+ * Fetch the current status of an add instrumental task.
1442
+ * @param id The task id.
1443
+ * @param options Per-request overrides.
1444
+ * @returns The current add instrumental task status.
1445
+ */
184
1446
  async get(id, options) {
185
1447
  return this.http.request("GET", `${ENDPOINT5}/${id}`, {
186
1448
  ...options
@@ -197,6 +1459,12 @@ var AddVocals = class {
197
1459
  this.http = http;
198
1460
  }
199
1461
  http;
1462
+ /**
1463
+ * Create an add vocals task and wait until complete.
1464
+ * @param params Add vocals parameters.
1465
+ * @param options Per-request and polling overrides.
1466
+ * @returns The completed add vocals response.
1467
+ */
200
1468
  async run(params, options) {
201
1469
  const { id } = await this.create(params, options);
202
1470
  const response = await (0, import_internal6.pollUntilComplete)(() => this.get(id, options), {
@@ -205,12 +1473,24 @@ var AddVocals = class {
205
1473
  });
206
1474
  return response;
207
1475
  }
1476
+ /**
1477
+ * Create an add vocals task; returns immediately with a task id.
1478
+ * @param params Add vocals parameters.
1479
+ * @param options Per-request overrides.
1480
+ * @returns The task creation result.
1481
+ */
208
1482
  async create(params, options) {
209
1483
  return this.http.request("POST", ENDPOINT6, {
210
1484
  body: (0, import_core6.compactParams)(params),
211
1485
  ...options
212
1486
  });
213
1487
  }
1488
+ /**
1489
+ * Fetch the current status of an add vocals task.
1490
+ * @param id The task id.
1491
+ * @param options Per-request overrides.
1492
+ * @returns The current add vocals task status.
1493
+ */
214
1494
  async get(id, options) {
215
1495
  return this.http.request("GET", `${ENDPOINT6}/${id}`, {
216
1496
  ...options
@@ -227,6 +1507,12 @@ var SeparateAudioStems = class {
227
1507
  this.http = http;
228
1508
  }
229
1509
  http;
1510
+ /**
1511
+ * Create a separate audio stems task and wait until complete.
1512
+ * @param params Separate audio stems parameters.
1513
+ * @param options Per-request and polling overrides.
1514
+ * @returns The completed separate audio stems response.
1515
+ */
230
1516
  async run(params, options) {
231
1517
  const { id } = await this.create(params, options);
232
1518
  const response = await (0, import_internal7.pollUntilComplete)(() => this.get(id, options), {
@@ -235,12 +1521,24 @@ var SeparateAudioStems = class {
235
1521
  });
236
1522
  return response;
237
1523
  }
1524
+ /**
1525
+ * Create a separate audio stems task; returns immediately with a task id.
1526
+ * @param params Separate audio stems parameters.
1527
+ * @param options Per-request overrides.
1528
+ * @returns The task creation result.
1529
+ */
238
1530
  async create(params, options) {
239
1531
  return this.http.request("POST", ENDPOINT7, {
240
1532
  body: (0, import_core7.compactParams)(params),
241
1533
  ...options
242
1534
  });
243
1535
  }
1536
+ /**
1537
+ * Fetch the current status of a separate audio stems task.
1538
+ * @param id The task id.
1539
+ * @param options Per-request overrides.
1540
+ * @returns The current separate audio stems task status.
1541
+ */
244
1542
  async get(id, options) {
245
1543
  return this.http.request("GET", `${ENDPOINT7}/${id}`, {
246
1544
  ...options
@@ -257,6 +1555,12 @@ var GenerateMidi = class {
257
1555
  this.http = http;
258
1556
  }
259
1557
  http;
1558
+ /**
1559
+ * Create a generate midi task and wait until complete.
1560
+ * @param params Generate midi parameters.
1561
+ * @param options Per-request and polling overrides.
1562
+ * @returns The completed generate midi response.
1563
+ */
260
1564
  async run(params, options) {
261
1565
  const { id } = await this.create(params, options);
262
1566
  const response = await (0, import_internal8.pollUntilComplete)(() => this.get(id, options), {
@@ -265,12 +1569,24 @@ var GenerateMidi = class {
265
1569
  });
266
1570
  return response;
267
1571
  }
1572
+ /**
1573
+ * Create a generate midi task; returns immediately with a task id.
1574
+ * @param params Generate midi parameters.
1575
+ * @param options Per-request overrides.
1576
+ * @returns The task creation result.
1577
+ */
268
1578
  async create(params, options) {
269
1579
  return this.http.request("POST", ENDPOINT8, {
270
1580
  body: (0, import_core8.compactParams)(params),
271
1581
  ...options
272
1582
  });
273
1583
  }
1584
+ /**
1585
+ * Fetch the current status of a generate midi task.
1586
+ * @param id The task id.
1587
+ * @param options Per-request overrides.
1588
+ * @returns The current generate midi task status.
1589
+ */
274
1590
  async get(id, options) {
275
1591
  return this.http.request("GET", `${ENDPOINT8}/${id}`, {
276
1592
  ...options
@@ -287,6 +1603,12 @@ var ConvertAudio = class {
287
1603
  this.http = http;
288
1604
  }
289
1605
  http;
1606
+ /**
1607
+ * Create a convert audio task and wait until complete.
1608
+ * @param params Convert audio parameters.
1609
+ * @param options Per-request and polling overrides.
1610
+ * @returns The completed convert audio response.
1611
+ */
290
1612
  async run(params, options) {
291
1613
  const { id } = await this.create(params, options);
292
1614
  const response = await (0, import_internal9.pollUntilComplete)(() => this.get(id, options), {
@@ -295,12 +1617,24 @@ var ConvertAudio = class {
295
1617
  });
296
1618
  return response;
297
1619
  }
1620
+ /**
1621
+ * Create a convert audio task; returns immediately with a task id.
1622
+ * @param params Convert audio parameters.
1623
+ * @param options Per-request overrides.
1624
+ * @returns The task creation result.
1625
+ */
298
1626
  async create(params, options) {
299
1627
  return this.http.request("POST", ENDPOINT9, {
300
1628
  body: (0, import_core9.compactParams)(params),
301
1629
  ...options
302
1630
  });
303
1631
  }
1632
+ /**
1633
+ * Fetch the current status of a convert audio task.
1634
+ * @param id The task id.
1635
+ * @param options Per-request overrides.
1636
+ * @returns The current convert audio task status.
1637
+ */
304
1638
  async get(id, options) {
305
1639
  return this.http.request("GET", `${ENDPOINT9}/${id}`, {
306
1640
  ...options
@@ -317,6 +1651,12 @@ var VisualizeMusic = class {
317
1651
  this.http = http;
318
1652
  }
319
1653
  http;
1654
+ /**
1655
+ * Create a visualize music task and wait until complete.
1656
+ * @param params Visualize music parameters.
1657
+ * @param options Per-request and polling overrides.
1658
+ * @returns The completed visualize music response.
1659
+ */
320
1660
  async run(params, options) {
321
1661
  const { id } = await this.create(params, options);
322
1662
  const response = await (0, import_internal10.pollUntilComplete)(() => this.get(id, options), {
@@ -325,12 +1665,24 @@ var VisualizeMusic = class {
325
1665
  });
326
1666
  return response;
327
1667
  }
1668
+ /**
1669
+ * Create a visualize music task; returns immediately with a task id.
1670
+ * @param params Visualize music parameters.
1671
+ * @param options Per-request overrides.
1672
+ * @returns The task creation result.
1673
+ */
328
1674
  async create(params, options) {
329
1675
  return this.http.request("POST", ENDPOINT10, {
330
1676
  body: (0, import_core10.compactParams)(params),
331
1677
  ...options
332
1678
  });
333
1679
  }
1680
+ /**
1681
+ * Fetch the current status of a visualize music task.
1682
+ * @param id The task id.
1683
+ * @param options Per-request overrides.
1684
+ * @returns The current visualize music task status.
1685
+ */
334
1686
  async get(id, options) {
335
1687
  return this.http.request("GET", `${ENDPOINT10}/${id}`, {
336
1688
  ...options
@@ -347,6 +1699,12 @@ var GenerateLyrics = class {
347
1699
  this.http = http;
348
1700
  }
349
1701
  http;
1702
+ /**
1703
+ * Create a generate lyrics task and wait until complete.
1704
+ * @param params Generate lyrics parameters.
1705
+ * @param options Per-request and polling overrides.
1706
+ * @returns The completed generate lyrics response.
1707
+ */
350
1708
  async run(params, options) {
351
1709
  const { id } = await this.create(params, options);
352
1710
  const response = await (0, import_internal11.pollUntilComplete)(() => this.get(id, options), {
@@ -355,12 +1713,24 @@ var GenerateLyrics = class {
355
1713
  });
356
1714
  return response;
357
1715
  }
1716
+ /**
1717
+ * Create a generate lyrics task; returns immediately with a task id.
1718
+ * @param params Generate lyrics parameters.
1719
+ * @param options Per-request overrides.
1720
+ * @returns The task creation result.
1721
+ */
358
1722
  async create(params, options) {
359
1723
  return this.http.request("POST", ENDPOINT11, {
360
1724
  body: (0, import_core11.compactParams)(params),
361
1725
  ...options
362
1726
  });
363
1727
  }
1728
+ /**
1729
+ * Fetch the current status of a generate lyrics task.
1730
+ * @param id The task id.
1731
+ * @param options Per-request overrides.
1732
+ * @returns The current generate lyrics task status.
1733
+ */
364
1734
  async get(id, options) {
365
1735
  return this.http.request("GET", `${ENDPOINT11}/${id}`, {
366
1736
  ...options
@@ -376,6 +1746,12 @@ var GetTimestampedLyrics = class {
376
1746
  this.http = http;
377
1747
  }
378
1748
  http;
1749
+ /**
1750
+ * Run get timestamped lyrics (synchronous).
1751
+ * @param params Get timestamped lyrics parameters.
1752
+ * @param options Per-request overrides.
1753
+ * @returns The get timestamped lyrics response.
1754
+ */
379
1755
  async run(params, options) {
380
1756
  return this.http.request("POST", ENDPOINT12, {
381
1757
  body: (0, import_core12.compactParams)(params),
@@ -393,6 +1769,12 @@ var ReplaceSection = class {
393
1769
  this.http = http;
394
1770
  }
395
1771
  http;
1772
+ /**
1773
+ * Create a replace section task and wait until complete.
1774
+ * @param params Replace section parameters.
1775
+ * @param options Per-request and polling overrides.
1776
+ * @returns The completed replace section response.
1777
+ */
396
1778
  async run(params, options) {
397
1779
  const { id } = await this.create(params, options);
398
1780
  const response = await (0, import_internal12.pollUntilComplete)(() => this.get(id, options), {
@@ -401,18 +1783,86 @@ var ReplaceSection = class {
401
1783
  });
402
1784
  return response;
403
1785
  }
1786
+ /**
1787
+ * Create a replace section task; returns immediately with a task id.
1788
+ * @param params Replace section parameters.
1789
+ * @param options Per-request overrides.
1790
+ * @returns The task creation result.
1791
+ */
404
1792
  async create(params, options) {
1793
+ const body = (0, import_core13.compactParams)(params);
1794
+ (0, import_core13.validateParams)(contract["replace-section"], body);
1795
+ validateReplaceSection(body);
405
1796
  return this.http.request("POST", ENDPOINT13, {
406
- body: (0, import_core13.compactParams)(params),
1797
+ body,
407
1798
  ...options
408
1799
  });
409
1800
  }
1801
+ /**
1802
+ * Fetch the current status of a replace section task.
1803
+ * @param id The task id.
1804
+ * @param options Per-request overrides.
1805
+ * @returns The current replace section task status.
1806
+ */
410
1807
  async get(id, options) {
411
1808
  return this.http.request("GET", `${ENDPOINT13}/${id}`, {
412
1809
  ...options
413
1810
  });
414
1811
  }
415
1812
  };
1813
+ function validateReplaceSection(body) {
1814
+ validateReplaceSectionSource(body);
1815
+ const startTime = body.infill_start_time;
1816
+ const endTime = body.infill_end_time;
1817
+ if (typeof startTime !== "number" || Number.isNaN(startTime)) {
1818
+ throw new import_core13.ValidationError("infill_start_time must be a number");
1819
+ }
1820
+ if (typeof endTime !== "number" || Number.isNaN(endTime)) {
1821
+ throw new import_core13.ValidationError("infill_end_time must be a number");
1822
+ }
1823
+ if (endTime <= startTime) {
1824
+ throw new import_core13.ValidationError("infill_end_time must be greater than infill_start_time");
1825
+ }
1826
+ const duration = endTime - startTime;
1827
+ if (duration < 6 || duration > 60) {
1828
+ throw new import_core13.ValidationError("replacement duration must be between 6 and 60 seconds");
1829
+ }
1830
+ }
1831
+ function validateReplaceSectionSource(body) {
1832
+ const hasExistingSource = isPresent(body.task_id) || isPresent(body.audio_id);
1833
+ const hasUploadedSource = isPresent(body.upload_url) || isPresent(body.model);
1834
+ if (hasExistingSource && hasUploadedSource) {
1835
+ throw new import_core13.ValidationError("task_id/audio_id cannot be combined with upload_url/model");
1836
+ }
1837
+ if (hasExistingSource) {
1838
+ requireField(body, "task_id");
1839
+ requireField(body, "audio_id");
1840
+ return;
1841
+ }
1842
+ if (hasUploadedSource) {
1843
+ requireField(body, "upload_url");
1844
+ requireField(body, "model");
1845
+ return;
1846
+ }
1847
+ throw new import_core13.ValidationError("task_id and audio_id, or upload_url and model are required");
1848
+ }
1849
+ function requireField(body, field) {
1850
+ if (!isPresent(body[field])) {
1851
+ throw new import_core13.ValidationError(`${field} is required`);
1852
+ }
1853
+ }
1854
+ function isPresent(value) {
1855
+ if (value === void 0 || value === null) {
1856
+ return false;
1857
+ }
1858
+ if (typeof value === "string") {
1859
+ return value.length > 0;
1860
+ }
1861
+ if (Array.isArray(value)) {
1862
+ return value.length > 0;
1863
+ }
1864
+ return true;
1865
+ }
416
1866
 
417
1867
  // src/resources/create-mashup.ts
418
1868
  var import_core14 = require("@runapi.ai/core");
@@ -423,6 +1873,12 @@ var CreateMashup = class {
423
1873
  this.http = http;
424
1874
  }
425
1875
  http;
1876
+ /**
1877
+ * Create a create mashup task and wait until complete.
1878
+ * @param params Create mashup parameters.
1879
+ * @param options Per-request and polling overrides.
1880
+ * @returns The completed create mashup response.
1881
+ */
426
1882
  async run(params, options) {
427
1883
  const { id } = await this.create(params, options);
428
1884
  const response = await (0, import_internal13.pollUntilComplete)(() => this.get(id, options), {
@@ -431,12 +1887,26 @@ var CreateMashup = class {
431
1887
  });
432
1888
  return response;
433
1889
  }
1890
+ /**
1891
+ * Create a create mashup task; returns immediately with a task id.
1892
+ * @param params Create mashup parameters.
1893
+ * @param options Per-request overrides.
1894
+ * @returns The task creation result.
1895
+ */
434
1896
  async create(params, options) {
1897
+ const body = (0, import_core14.compactParams)(params);
1898
+ (0, import_core14.validateParams)(contract["create-mashup"], body);
435
1899
  return this.http.request("POST", ENDPOINT14, {
436
- body: (0, import_core14.compactParams)(params),
1900
+ body,
437
1901
  ...options
438
1902
  });
439
1903
  }
1904
+ /**
1905
+ * Fetch the current status of a create mashup task.
1906
+ * @param id The task id.
1907
+ * @param options Per-request overrides.
1908
+ * @returns The current create mashup task status.
1909
+ */
440
1910
  async get(id, options) {
441
1911
  return this.http.request("GET", `${ENDPOINT14}/${id}`, {
442
1912
  ...options
@@ -453,6 +1923,12 @@ var TextToSound = class {
453
1923
  this.http = http;
454
1924
  }
455
1925
  http;
1926
+ /**
1927
+ * Create a text to sound task and wait until complete.
1928
+ * @param params Text to sound parameters.
1929
+ * @param options Per-request and polling overrides.
1930
+ * @returns The completed text to sound response.
1931
+ */
456
1932
  async run(params, options) {
457
1933
  const { id } = await this.create(params, options);
458
1934
  const response = await (0, import_internal14.pollUntilComplete)(() => this.get(id, options), {
@@ -461,12 +1937,24 @@ var TextToSound = class {
461
1937
  });
462
1938
  return response;
463
1939
  }
1940
+ /**
1941
+ * Create a text to sound task; returns immediately with a task id.
1942
+ * @param params Text to sound parameters.
1943
+ * @param options Per-request overrides.
1944
+ * @returns The task creation result.
1945
+ */
464
1946
  async create(params, options) {
465
1947
  return this.http.request("POST", ENDPOINT15, {
466
1948
  body: (0, import_core15.compactParams)(params),
467
1949
  ...options
468
1950
  });
469
1951
  }
1952
+ /**
1953
+ * Fetch the current status of a text to sound task.
1954
+ * @param id The task id.
1955
+ * @param options Per-request overrides.
1956
+ * @returns The current text to sound task status.
1957
+ */
470
1958
  async get(id, options) {
471
1959
  return this.http.request("GET", `${ENDPOINT15}/${id}`, {
472
1960
  ...options
@@ -482,6 +1970,12 @@ var GeneratePersona = class {
482
1970
  this.http = http;
483
1971
  }
484
1972
  http;
1973
+ /**
1974
+ * Run generate persona (synchronous).
1975
+ * @param params Generate persona parameters.
1976
+ * @param options Per-request overrides.
1977
+ * @returns The generate persona response.
1978
+ */
485
1979
  async run(params, options) {
486
1980
  return this.http.request("POST", ENDPOINT16, {
487
1981
  body: (0, import_core16.compactParams)(params),
@@ -498,6 +1992,12 @@ var BoostStyle = class {
498
1992
  this.http = http;
499
1993
  }
500
1994
  http;
1995
+ /**
1996
+ * Run boost style (synchronous).
1997
+ * @param params Boost style parameters.
1998
+ * @param options Per-request overrides.
1999
+ * @returns The boost style response.
2000
+ */
501
2001
  async run(params, options) {
502
2002
  return this.http.request("POST", ENDPOINT17, {
503
2003
  body: (0, import_core17.compactParams)(params),
@@ -515,6 +2015,12 @@ var VoiceToValidationPhrase = class {
515
2015
  this.http = http;
516
2016
  }
517
2017
  http;
2018
+ /**
2019
+ * Create a voice to validation phrase task and wait until complete.
2020
+ * @param params Voice to validation phrase parameters.
2021
+ * @param options Per-request and polling overrides.
2022
+ * @returns The completed voice to validation phrase response.
2023
+ */
518
2024
  async run(params, options) {
519
2025
  const { id } = await this.create(params, options);
520
2026
  const response = await (0, import_internal15.pollUntilComplete)(() => this.get(id, options), {
@@ -523,12 +2029,24 @@ var VoiceToValidationPhrase = class {
523
2029
  });
524
2030
  return response;
525
2031
  }
2032
+ /**
2033
+ * Create a voice to validation phrase task; returns immediately with a task id.
2034
+ * @param params Voice to validation phrase parameters.
2035
+ * @param options Per-request overrides.
2036
+ * @returns The task creation result.
2037
+ */
526
2038
  async create(params, options) {
527
2039
  return this.http.request("POST", ENDPOINT18, {
528
2040
  body: (0, import_core18.compactParams)(params),
529
2041
  ...options
530
2042
  });
531
2043
  }
2044
+ /**
2045
+ * Fetch the current status of a voice to validation phrase task.
2046
+ * @param id The task id.
2047
+ * @param options Per-request overrides.
2048
+ * @returns The current voice to validation phrase task status.
2049
+ */
532
2050
  async get(id, options) {
533
2051
  return this.http.request("GET", `${ENDPOINT18}/${id}`, {
534
2052
  ...options
@@ -545,6 +2063,12 @@ var RegenerateValidationPhrase = class {
545
2063
  this.http = http;
546
2064
  }
547
2065
  http;
2066
+ /**
2067
+ * Create a regenerate validation phrase task and wait until complete.
2068
+ * @param params Regenerate validation phrase parameters.
2069
+ * @param options Per-request and polling overrides.
2070
+ * @returns The completed regenerate validation phrase response.
2071
+ */
548
2072
  async run(params, options) {
549
2073
  const { id } = await this.create(params, options);
550
2074
  const response = await (0, import_internal16.pollUntilComplete)(() => this.get(id, options), {
@@ -553,12 +2077,24 @@ var RegenerateValidationPhrase = class {
553
2077
  });
554
2078
  return response;
555
2079
  }
2080
+ /**
2081
+ * Create a regenerate validation phrase task; returns immediately with a task id.
2082
+ * @param params Regenerate validation phrase parameters.
2083
+ * @param options Per-request overrides.
2084
+ * @returns The task creation result.
2085
+ */
556
2086
  async create(params, options) {
557
2087
  return this.http.request("POST", ENDPOINT19, {
558
2088
  body: (0, import_core19.compactParams)(params),
559
2089
  ...options
560
2090
  });
561
2091
  }
2092
+ /**
2093
+ * Fetch the current status of a regenerate validation phrase task.
2094
+ * @param id The task id.
2095
+ * @param options Per-request overrides.
2096
+ * @returns The current regenerate validation phrase task status.
2097
+ */
562
2098
  async get(id, options) {
563
2099
  return this.http.request("GET", `${ENDPOINT19}/${id}`, {
564
2100
  ...options
@@ -575,6 +2111,12 @@ var GenerateVoice = class {
575
2111
  this.http = http;
576
2112
  }
577
2113
  http;
2114
+ /**
2115
+ * Create a generate voice task and wait until complete.
2116
+ * @param params Generate voice parameters.
2117
+ * @param options Per-request and polling overrides.
2118
+ * @returns The completed generate voice response.
2119
+ */
578
2120
  async run(params, options) {
579
2121
  const { id } = await this.create(params, options);
580
2122
  const response = await (0, import_internal17.pollUntilComplete)(() => this.get(id, options), {
@@ -583,12 +2125,24 @@ var GenerateVoice = class {
583
2125
  });
584
2126
  return response;
585
2127
  }
2128
+ /**
2129
+ * Create a generate voice task; returns immediately with a task id.
2130
+ * @param params Generate voice parameters.
2131
+ * @param options Per-request overrides.
2132
+ * @returns The task creation result.
2133
+ */
586
2134
  async create(params, options) {
587
2135
  return this.http.request("POST", ENDPOINT20, {
588
2136
  body: (0, import_core20.compactParams)(params),
589
2137
  ...options
590
2138
  });
591
2139
  }
2140
+ /**
2141
+ * Fetch the current status of a generate voice task.
2142
+ * @param id The task id.
2143
+ * @param options Per-request overrides.
2144
+ * @returns The current generate voice task status.
2145
+ */
592
2146
  async get(id, options) {
593
2147
  return this.http.request("GET", `${ENDPOINT20}/${id}`, {
594
2148
  ...options
@@ -604,6 +2158,12 @@ var CheckVoice = class {
604
2158
  this.http = http;
605
2159
  }
606
2160
  http;
2161
+ /**
2162
+ * Run check voice (synchronous).
2163
+ * @param params Check voice parameters.
2164
+ * @param options Per-request overrides.
2165
+ * @returns The check voice response.
2166
+ */
607
2167
  async run(params, options) {
608
2168
  return this.http.request("POST", ENDPOINT21, {
609
2169
  body: (0, import_core21.compactParams)(params),
@@ -613,51 +2173,72 @@ var CheckVoice = class {
613
2173
  };
614
2174
 
615
2175
  // src/client.ts
616
- var SunoClient = class {
2176
+ var SunoClient = class extends import_core22.BaseClient {
2177
+ /** Generates songs from a text prompt with configurable vocal mode, style, and persona. */
617
2178
  textToMusic;
2179
+ /** Continues an existing track from a specified timestamp, inheriting or overriding its settings. */
618
2180
  extendMusic;
2181
+ /** Creates cover artwork for an existing music task. */
619
2182
  generateArtwork;
2183
+ /** Re-records vocals over an uploaded audio file with a new style or voice. */
620
2184
  coverAudio;
2185
+ /** Generates and adds an instrumental backing track to uploaded audio. */
621
2186
  addInstrumental;
2187
+ /** Generates and adds vocals to an uploaded instrumental track. */
622
2188
  addVocals;
2189
+ /** Splits a track into individual instrument stems (vocals, drums, bass, guitar, etc.). */
623
2190
  separateAudioStems;
2191
+ /** Extracts per-instrument MIDI note data from a generated track. */
624
2192
  generateMidi;
2193
+ /** Converts a generated track to WAV format. */
625
2194
  convertAudio;
2195
+ /** Generates a music visualization video from an existing track. */
626
2196
  visualizeMusic;
2197
+ /** Produces AI-generated lyrics from a text prompt. */
627
2198
  generateLyrics;
2199
+ /** Retrieves word-level timing alignment for a track. Synchronous (run only). */
628
2200
  getTimestampedLyrics;
2201
+ /** Re-generates a time range within an existing track with new lyrics and style. */
629
2202
  replaceSection;
2203
+ /** Blends two audio tracks into a single new composition. */
630
2204
  createMashup;
2205
+ /** Generates sound effects (not music) from a text description with optional looping and BPM control. */
631
2206
  textToSound;
2207
+ /** Creates a reusable style or voice persona from a track's vocals. Synchronous (run only). */
632
2208
  generatePersona;
2209
+ /** Generates style/genre tags from a text description for use in style fields. Synchronous (run only). */
633
2210
  boostStyle;
2211
+ /** Step 1 of voice cloning: extracts a validation phrase from a voice recording. */
634
2212
  voiceToValidationPhrase;
2213
+ /** Step 2 (optional) of voice cloning: requests a new, easier validation phrase. */
635
2214
  regenerateValidationPhrase;
2215
+ /** Step 3 of voice cloning: trains a custom voice from the user's recording of the validation phrase. */
636
2216
  generateVoice;
2217
+ /** Step 4 of voice cloning: checks whether a custom voice is ready for use. Synchronous (run only). */
637
2218
  checkVoice;
638
2219
  constructor(options = {}) {
639
- const http = (0, import_core22.createHttpClient)(options);
640
- this.textToMusic = new TextToMusic(http);
641
- this.extendMusic = new ExtendMusic(http);
642
- this.generateArtwork = new GenerateArtwork(http);
643
- this.coverAudio = new CoverAudio(http);
644
- this.addInstrumental = new AddInstrumental(http);
645
- this.addVocals = new AddVocals(http);
646
- this.separateAudioStems = new SeparateAudioStems(http);
647
- this.generateMidi = new GenerateMidi(http);
648
- this.convertAudio = new ConvertAudio(http);
649
- this.visualizeMusic = new VisualizeMusic(http);
650
- this.generateLyrics = new GenerateLyrics(http);
651
- this.getTimestampedLyrics = new GetTimestampedLyrics(http);
652
- this.replaceSection = new ReplaceSection(http);
653
- this.createMashup = new CreateMashup(http);
654
- this.textToSound = new TextToSound(http);
655
- this.generatePersona = new GeneratePersona(http);
656
- this.boostStyle = new BoostStyle(http);
657
- this.voiceToValidationPhrase = new VoiceToValidationPhrase(http);
658
- this.regenerateValidationPhrase = new RegenerateValidationPhrase(http);
659
- this.generateVoice = new GenerateVoice(http);
660
- this.checkVoice = new CheckVoice(http);
2220
+ super(options);
2221
+ this.textToMusic = new TextToMusic(this.http);
2222
+ this.extendMusic = new ExtendMusic(this.http);
2223
+ this.generateArtwork = new GenerateArtwork(this.http);
2224
+ this.coverAudio = new CoverAudio(this.http);
2225
+ this.addInstrumental = new AddInstrumental(this.http);
2226
+ this.addVocals = new AddVocals(this.http);
2227
+ this.separateAudioStems = new SeparateAudioStems(this.http);
2228
+ this.generateMidi = new GenerateMidi(this.http);
2229
+ this.convertAudio = new ConvertAudio(this.http);
2230
+ this.visualizeMusic = new VisualizeMusic(this.http);
2231
+ this.generateLyrics = new GenerateLyrics(this.http);
2232
+ this.getTimestampedLyrics = new GetTimestampedLyrics(this.http);
2233
+ this.replaceSection = new ReplaceSection(this.http);
2234
+ this.createMashup = new CreateMashup(this.http);
2235
+ this.textToSound = new TextToSound(this.http);
2236
+ this.generatePersona = new GeneratePersona(this.http);
2237
+ this.boostStyle = new BoostStyle(this.http);
2238
+ this.voiceToValidationPhrase = new VoiceToValidationPhrase(this.http);
2239
+ this.regenerateValidationPhrase = new RegenerateValidationPhrase(this.http);
2240
+ this.generateVoice = new GenerateVoice(this.http);
2241
+ this.checkVoice = new CheckVoice(this.http);
661
2242
  }
662
2243
  };
663
2244