@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/README.md +9 -7
- package/dist/index.d.mts +566 -8
- package/dist/index.d.ts +566 -8
- package/dist/index.js +1608 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1615 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -4
- package/skills/suno/README.md +4 -3
- package/skills/suno/SKILL.md +16 -11
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,1189 @@
|
|
|
1
1
|
// src/client.ts
|
|
2
|
-
import {
|
|
2
|
+
import { BaseClient } from "@runapi.ai/core";
|
|
3
3
|
|
|
4
4
|
// src/resources/text-to-music.ts
|
|
5
|
-
import { compactParams } from "@runapi.ai/core";
|
|
5
|
+
import { compactParams, validateParams } from "@runapi.ai/core";
|
|
6
6
|
import { pollUntilComplete } from "@runapi.ai/core/internal";
|
|
7
|
+
|
|
8
|
+
// src/contract_gen.ts
|
|
9
|
+
var contract = {
|
|
10
|
+
"add-instrumental": {
|
|
11
|
+
"models": [
|
|
12
|
+
"suno-v4.5-plus",
|
|
13
|
+
"suno-v5",
|
|
14
|
+
"suno-v5.5"
|
|
15
|
+
],
|
|
16
|
+
"fields_by_model": {
|
|
17
|
+
"suno-v4.5-plus": {
|
|
18
|
+
"model": {
|
|
19
|
+
"required": true
|
|
20
|
+
},
|
|
21
|
+
"upload_url": {
|
|
22
|
+
"required": true
|
|
23
|
+
},
|
|
24
|
+
"vocal_gender": {
|
|
25
|
+
"enum": [
|
|
26
|
+
"male",
|
|
27
|
+
"female"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"suno-v5": {
|
|
32
|
+
"model": {
|
|
33
|
+
"required": true
|
|
34
|
+
},
|
|
35
|
+
"upload_url": {
|
|
36
|
+
"required": true
|
|
37
|
+
},
|
|
38
|
+
"vocal_gender": {
|
|
39
|
+
"enum": [
|
|
40
|
+
"male",
|
|
41
|
+
"female"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"suno-v5.5": {
|
|
46
|
+
"model": {
|
|
47
|
+
"required": true
|
|
48
|
+
},
|
|
49
|
+
"upload_url": {
|
|
50
|
+
"required": true
|
|
51
|
+
},
|
|
52
|
+
"vocal_gender": {
|
|
53
|
+
"enum": [
|
|
54
|
+
"male",
|
|
55
|
+
"female"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"add-vocals": {
|
|
62
|
+
"models": [
|
|
63
|
+
"suno-v4.5-plus",
|
|
64
|
+
"suno-v5"
|
|
65
|
+
],
|
|
66
|
+
"fields_by_model": {
|
|
67
|
+
"suno-v4.5-plus": {
|
|
68
|
+
"lyrics": {
|
|
69
|
+
"required": true
|
|
70
|
+
},
|
|
71
|
+
"model": {
|
|
72
|
+
"required": true
|
|
73
|
+
},
|
|
74
|
+
"upload_url": {
|
|
75
|
+
"required": true
|
|
76
|
+
},
|
|
77
|
+
"vocal_gender": {
|
|
78
|
+
"enum": [
|
|
79
|
+
"male",
|
|
80
|
+
"female"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"suno-v5": {
|
|
85
|
+
"lyrics": {
|
|
86
|
+
"required": true
|
|
87
|
+
},
|
|
88
|
+
"model": {
|
|
89
|
+
"required": true
|
|
90
|
+
},
|
|
91
|
+
"upload_url": {
|
|
92
|
+
"required": true
|
|
93
|
+
},
|
|
94
|
+
"vocal_gender": {
|
|
95
|
+
"enum": [
|
|
96
|
+
"male",
|
|
97
|
+
"female"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"boost-style": {
|
|
104
|
+
"models": [],
|
|
105
|
+
"fields_by_model": {
|
|
106
|
+
"_": {}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"check-voice": {
|
|
110
|
+
"models": [],
|
|
111
|
+
"fields_by_model": {
|
|
112
|
+
"_": {
|
|
113
|
+
"task_id": {
|
|
114
|
+
"required": true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"convert-audio": {
|
|
120
|
+
"models": [],
|
|
121
|
+
"fields_by_model": {
|
|
122
|
+
"_": {}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"cover-audio": {
|
|
126
|
+
"models": [
|
|
127
|
+
"suno-v4",
|
|
128
|
+
"suno-v4.5",
|
|
129
|
+
"suno-v4.5-all",
|
|
130
|
+
"suno-v4.5-plus",
|
|
131
|
+
"suno-v5",
|
|
132
|
+
"suno-v5.5"
|
|
133
|
+
],
|
|
134
|
+
"fields_by_model": {
|
|
135
|
+
"suno-v4": {
|
|
136
|
+
"model": {
|
|
137
|
+
"required": true
|
|
138
|
+
},
|
|
139
|
+
"persona_type": {
|
|
140
|
+
"enum": [
|
|
141
|
+
"style",
|
|
142
|
+
"voice"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"upload_url": {
|
|
146
|
+
"required": true
|
|
147
|
+
},
|
|
148
|
+
"vocal_gender": {
|
|
149
|
+
"enum": [
|
|
150
|
+
"male",
|
|
151
|
+
"female"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"vocal_mode": {
|
|
155
|
+
"enum": [
|
|
156
|
+
"auto_lyrics",
|
|
157
|
+
"exact_lyrics",
|
|
158
|
+
"instrumental"
|
|
159
|
+
],
|
|
160
|
+
"required": true
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"suno-v4.5": {
|
|
164
|
+
"model": {
|
|
165
|
+
"required": true
|
|
166
|
+
},
|
|
167
|
+
"persona_type": {
|
|
168
|
+
"enum": [
|
|
169
|
+
"style",
|
|
170
|
+
"voice"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
"upload_url": {
|
|
174
|
+
"required": true
|
|
175
|
+
},
|
|
176
|
+
"vocal_gender": {
|
|
177
|
+
"enum": [
|
|
178
|
+
"male",
|
|
179
|
+
"female"
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"vocal_mode": {
|
|
183
|
+
"enum": [
|
|
184
|
+
"auto_lyrics",
|
|
185
|
+
"exact_lyrics",
|
|
186
|
+
"instrumental"
|
|
187
|
+
],
|
|
188
|
+
"required": true
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"suno-v4.5-all": {
|
|
192
|
+
"model": {
|
|
193
|
+
"required": true
|
|
194
|
+
},
|
|
195
|
+
"persona_type": {
|
|
196
|
+
"enum": [
|
|
197
|
+
"style",
|
|
198
|
+
"voice"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"upload_url": {
|
|
202
|
+
"required": true
|
|
203
|
+
},
|
|
204
|
+
"vocal_gender": {
|
|
205
|
+
"enum": [
|
|
206
|
+
"male",
|
|
207
|
+
"female"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"vocal_mode": {
|
|
211
|
+
"enum": [
|
|
212
|
+
"auto_lyrics",
|
|
213
|
+
"exact_lyrics",
|
|
214
|
+
"instrumental"
|
|
215
|
+
],
|
|
216
|
+
"required": true
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"suno-v4.5-plus": {
|
|
220
|
+
"model": {
|
|
221
|
+
"required": true
|
|
222
|
+
},
|
|
223
|
+
"persona_type": {
|
|
224
|
+
"enum": [
|
|
225
|
+
"style",
|
|
226
|
+
"voice"
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"upload_url": {
|
|
230
|
+
"required": true
|
|
231
|
+
},
|
|
232
|
+
"vocal_gender": {
|
|
233
|
+
"enum": [
|
|
234
|
+
"male",
|
|
235
|
+
"female"
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"vocal_mode": {
|
|
239
|
+
"enum": [
|
|
240
|
+
"auto_lyrics",
|
|
241
|
+
"exact_lyrics",
|
|
242
|
+
"instrumental"
|
|
243
|
+
],
|
|
244
|
+
"required": true
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"suno-v5": {
|
|
248
|
+
"model": {
|
|
249
|
+
"required": true
|
|
250
|
+
},
|
|
251
|
+
"persona_type": {
|
|
252
|
+
"enum": [
|
|
253
|
+
"style",
|
|
254
|
+
"voice"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
"upload_url": {
|
|
258
|
+
"required": true
|
|
259
|
+
},
|
|
260
|
+
"vocal_gender": {
|
|
261
|
+
"enum": [
|
|
262
|
+
"male",
|
|
263
|
+
"female"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
"vocal_mode": {
|
|
267
|
+
"enum": [
|
|
268
|
+
"auto_lyrics",
|
|
269
|
+
"exact_lyrics",
|
|
270
|
+
"instrumental"
|
|
271
|
+
],
|
|
272
|
+
"required": true
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"suno-v5.5": {
|
|
276
|
+
"model": {
|
|
277
|
+
"required": true
|
|
278
|
+
},
|
|
279
|
+
"persona_type": {
|
|
280
|
+
"enum": [
|
|
281
|
+
"style",
|
|
282
|
+
"voice"
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
"upload_url": {
|
|
286
|
+
"required": true
|
|
287
|
+
},
|
|
288
|
+
"vocal_gender": {
|
|
289
|
+
"enum": [
|
|
290
|
+
"male",
|
|
291
|
+
"female"
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
"vocal_mode": {
|
|
295
|
+
"enum": [
|
|
296
|
+
"auto_lyrics",
|
|
297
|
+
"exact_lyrics",
|
|
298
|
+
"instrumental"
|
|
299
|
+
],
|
|
300
|
+
"required": true
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"rules": [
|
|
305
|
+
{
|
|
306
|
+
"when": {
|
|
307
|
+
"vocal_mode": "auto_lyrics"
|
|
308
|
+
},
|
|
309
|
+
"required": [
|
|
310
|
+
"prompt"
|
|
311
|
+
],
|
|
312
|
+
"forbidden": [
|
|
313
|
+
"lyrics",
|
|
314
|
+
"style",
|
|
315
|
+
"title"
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"when": {
|
|
320
|
+
"vocal_mode": "exact_lyrics"
|
|
321
|
+
},
|
|
322
|
+
"required": [
|
|
323
|
+
"lyrics",
|
|
324
|
+
"style",
|
|
325
|
+
"title"
|
|
326
|
+
],
|
|
327
|
+
"forbidden": [
|
|
328
|
+
"prompt"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"when": {
|
|
333
|
+
"vocal_mode": "instrumental"
|
|
334
|
+
},
|
|
335
|
+
"required": [
|
|
336
|
+
"style",
|
|
337
|
+
"title"
|
|
338
|
+
],
|
|
339
|
+
"forbidden": [
|
|
340
|
+
"prompt",
|
|
341
|
+
"lyrics"
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
"create-mashup": {
|
|
347
|
+
"models": [
|
|
348
|
+
"suno-v4",
|
|
349
|
+
"suno-v4.5",
|
|
350
|
+
"suno-v4.5-all",
|
|
351
|
+
"suno-v4.5-plus",
|
|
352
|
+
"suno-v5",
|
|
353
|
+
"suno-v5.5"
|
|
354
|
+
],
|
|
355
|
+
"fields_by_model": {
|
|
356
|
+
"suno-v4": {
|
|
357
|
+
"model": {
|
|
358
|
+
"required": true
|
|
359
|
+
},
|
|
360
|
+
"persona_type": {
|
|
361
|
+
"enum": [
|
|
362
|
+
"style",
|
|
363
|
+
"voice"
|
|
364
|
+
]
|
|
365
|
+
},
|
|
366
|
+
"upload_url_list": {
|
|
367
|
+
"required": true
|
|
368
|
+
},
|
|
369
|
+
"vocal_gender": {
|
|
370
|
+
"enum": [
|
|
371
|
+
"male",
|
|
372
|
+
"female"
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
"vocal_mode": {
|
|
376
|
+
"enum": [
|
|
377
|
+
"auto_lyrics",
|
|
378
|
+
"exact_lyrics",
|
|
379
|
+
"instrumental"
|
|
380
|
+
],
|
|
381
|
+
"required": true
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"suno-v4.5": {
|
|
385
|
+
"model": {
|
|
386
|
+
"required": true
|
|
387
|
+
},
|
|
388
|
+
"persona_type": {
|
|
389
|
+
"enum": [
|
|
390
|
+
"style",
|
|
391
|
+
"voice"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
"upload_url_list": {
|
|
395
|
+
"required": true
|
|
396
|
+
},
|
|
397
|
+
"vocal_gender": {
|
|
398
|
+
"enum": [
|
|
399
|
+
"male",
|
|
400
|
+
"female"
|
|
401
|
+
]
|
|
402
|
+
},
|
|
403
|
+
"vocal_mode": {
|
|
404
|
+
"enum": [
|
|
405
|
+
"auto_lyrics",
|
|
406
|
+
"exact_lyrics",
|
|
407
|
+
"instrumental"
|
|
408
|
+
],
|
|
409
|
+
"required": true
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"suno-v4.5-all": {
|
|
413
|
+
"model": {
|
|
414
|
+
"required": true
|
|
415
|
+
},
|
|
416
|
+
"persona_type": {
|
|
417
|
+
"enum": [
|
|
418
|
+
"style",
|
|
419
|
+
"voice"
|
|
420
|
+
]
|
|
421
|
+
},
|
|
422
|
+
"upload_url_list": {
|
|
423
|
+
"required": true
|
|
424
|
+
},
|
|
425
|
+
"vocal_gender": {
|
|
426
|
+
"enum": [
|
|
427
|
+
"male",
|
|
428
|
+
"female"
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
"vocal_mode": {
|
|
432
|
+
"enum": [
|
|
433
|
+
"auto_lyrics",
|
|
434
|
+
"exact_lyrics",
|
|
435
|
+
"instrumental"
|
|
436
|
+
],
|
|
437
|
+
"required": true
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"suno-v4.5-plus": {
|
|
441
|
+
"model": {
|
|
442
|
+
"required": true
|
|
443
|
+
},
|
|
444
|
+
"persona_type": {
|
|
445
|
+
"enum": [
|
|
446
|
+
"style",
|
|
447
|
+
"voice"
|
|
448
|
+
]
|
|
449
|
+
},
|
|
450
|
+
"upload_url_list": {
|
|
451
|
+
"required": true
|
|
452
|
+
},
|
|
453
|
+
"vocal_gender": {
|
|
454
|
+
"enum": [
|
|
455
|
+
"male",
|
|
456
|
+
"female"
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
"vocal_mode": {
|
|
460
|
+
"enum": [
|
|
461
|
+
"auto_lyrics",
|
|
462
|
+
"exact_lyrics",
|
|
463
|
+
"instrumental"
|
|
464
|
+
],
|
|
465
|
+
"required": true
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"suno-v5": {
|
|
469
|
+
"model": {
|
|
470
|
+
"required": true
|
|
471
|
+
},
|
|
472
|
+
"persona_type": {
|
|
473
|
+
"enum": [
|
|
474
|
+
"style",
|
|
475
|
+
"voice"
|
|
476
|
+
]
|
|
477
|
+
},
|
|
478
|
+
"upload_url_list": {
|
|
479
|
+
"required": true
|
|
480
|
+
},
|
|
481
|
+
"vocal_gender": {
|
|
482
|
+
"enum": [
|
|
483
|
+
"male",
|
|
484
|
+
"female"
|
|
485
|
+
]
|
|
486
|
+
},
|
|
487
|
+
"vocal_mode": {
|
|
488
|
+
"enum": [
|
|
489
|
+
"auto_lyrics",
|
|
490
|
+
"exact_lyrics",
|
|
491
|
+
"instrumental"
|
|
492
|
+
],
|
|
493
|
+
"required": true
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"suno-v5.5": {
|
|
497
|
+
"model": {
|
|
498
|
+
"required": true
|
|
499
|
+
},
|
|
500
|
+
"persona_type": {
|
|
501
|
+
"enum": [
|
|
502
|
+
"style",
|
|
503
|
+
"voice"
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
"upload_url_list": {
|
|
507
|
+
"required": true
|
|
508
|
+
},
|
|
509
|
+
"vocal_gender": {
|
|
510
|
+
"enum": [
|
|
511
|
+
"male",
|
|
512
|
+
"female"
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
"vocal_mode": {
|
|
516
|
+
"enum": [
|
|
517
|
+
"auto_lyrics",
|
|
518
|
+
"exact_lyrics",
|
|
519
|
+
"instrumental"
|
|
520
|
+
],
|
|
521
|
+
"required": true
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"rules": [
|
|
526
|
+
{
|
|
527
|
+
"when": {
|
|
528
|
+
"vocal_mode": "auto_lyrics"
|
|
529
|
+
},
|
|
530
|
+
"required": [
|
|
531
|
+
"prompt"
|
|
532
|
+
],
|
|
533
|
+
"forbidden": [
|
|
534
|
+
"lyrics",
|
|
535
|
+
"style",
|
|
536
|
+
"title"
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"when": {
|
|
541
|
+
"vocal_mode": "exact_lyrics"
|
|
542
|
+
},
|
|
543
|
+
"required": [
|
|
544
|
+
"lyrics",
|
|
545
|
+
"style",
|
|
546
|
+
"title"
|
|
547
|
+
],
|
|
548
|
+
"forbidden": [
|
|
549
|
+
"prompt"
|
|
550
|
+
]
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"when": {
|
|
554
|
+
"vocal_mode": "instrumental"
|
|
555
|
+
},
|
|
556
|
+
"required": [
|
|
557
|
+
"style",
|
|
558
|
+
"title"
|
|
559
|
+
],
|
|
560
|
+
"forbidden": [
|
|
561
|
+
"prompt",
|
|
562
|
+
"lyrics"
|
|
563
|
+
]
|
|
564
|
+
}
|
|
565
|
+
]
|
|
566
|
+
},
|
|
567
|
+
"extend-music": {
|
|
568
|
+
"models": [
|
|
569
|
+
"suno-v4",
|
|
570
|
+
"suno-v4.5",
|
|
571
|
+
"suno-v4.5-all",
|
|
572
|
+
"suno-v4.5-plus",
|
|
573
|
+
"suno-v5",
|
|
574
|
+
"suno-v5.5"
|
|
575
|
+
],
|
|
576
|
+
"fields_by_model": {
|
|
577
|
+
"suno-v4": {
|
|
578
|
+
"model": {
|
|
579
|
+
"required": true
|
|
580
|
+
},
|
|
581
|
+
"parameter_mode": {
|
|
582
|
+
"enum": [
|
|
583
|
+
"source",
|
|
584
|
+
"custom"
|
|
585
|
+
]
|
|
586
|
+
},
|
|
587
|
+
"persona_type": {
|
|
588
|
+
"enum": [
|
|
589
|
+
"style",
|
|
590
|
+
"voice"
|
|
591
|
+
]
|
|
592
|
+
},
|
|
593
|
+
"vocal_gender": {
|
|
594
|
+
"enum": [
|
|
595
|
+
"male",
|
|
596
|
+
"female"
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
"suno-v4.5": {
|
|
601
|
+
"model": {
|
|
602
|
+
"required": true
|
|
603
|
+
},
|
|
604
|
+
"parameter_mode": {
|
|
605
|
+
"enum": [
|
|
606
|
+
"source",
|
|
607
|
+
"custom"
|
|
608
|
+
]
|
|
609
|
+
},
|
|
610
|
+
"persona_type": {
|
|
611
|
+
"enum": [
|
|
612
|
+
"style",
|
|
613
|
+
"voice"
|
|
614
|
+
]
|
|
615
|
+
},
|
|
616
|
+
"vocal_gender": {
|
|
617
|
+
"enum": [
|
|
618
|
+
"male",
|
|
619
|
+
"female"
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
"suno-v4.5-all": {
|
|
624
|
+
"model": {
|
|
625
|
+
"required": true
|
|
626
|
+
},
|
|
627
|
+
"parameter_mode": {
|
|
628
|
+
"enum": [
|
|
629
|
+
"source",
|
|
630
|
+
"custom"
|
|
631
|
+
]
|
|
632
|
+
},
|
|
633
|
+
"persona_type": {
|
|
634
|
+
"enum": [
|
|
635
|
+
"style",
|
|
636
|
+
"voice"
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
"vocal_gender": {
|
|
640
|
+
"enum": [
|
|
641
|
+
"male",
|
|
642
|
+
"female"
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
"suno-v4.5-plus": {
|
|
647
|
+
"model": {
|
|
648
|
+
"required": true
|
|
649
|
+
},
|
|
650
|
+
"parameter_mode": {
|
|
651
|
+
"enum": [
|
|
652
|
+
"source",
|
|
653
|
+
"custom"
|
|
654
|
+
]
|
|
655
|
+
},
|
|
656
|
+
"persona_type": {
|
|
657
|
+
"enum": [
|
|
658
|
+
"style",
|
|
659
|
+
"voice"
|
|
660
|
+
]
|
|
661
|
+
},
|
|
662
|
+
"vocal_gender": {
|
|
663
|
+
"enum": [
|
|
664
|
+
"male",
|
|
665
|
+
"female"
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
"suno-v5": {
|
|
670
|
+
"model": {
|
|
671
|
+
"required": true
|
|
672
|
+
},
|
|
673
|
+
"parameter_mode": {
|
|
674
|
+
"enum": [
|
|
675
|
+
"source",
|
|
676
|
+
"custom"
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
"persona_type": {
|
|
680
|
+
"enum": [
|
|
681
|
+
"style",
|
|
682
|
+
"voice"
|
|
683
|
+
]
|
|
684
|
+
},
|
|
685
|
+
"vocal_gender": {
|
|
686
|
+
"enum": [
|
|
687
|
+
"male",
|
|
688
|
+
"female"
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
"suno-v5.5": {
|
|
693
|
+
"model": {
|
|
694
|
+
"required": true
|
|
695
|
+
},
|
|
696
|
+
"parameter_mode": {
|
|
697
|
+
"enum": [
|
|
698
|
+
"source",
|
|
699
|
+
"custom"
|
|
700
|
+
]
|
|
701
|
+
},
|
|
702
|
+
"persona_type": {
|
|
703
|
+
"enum": [
|
|
704
|
+
"style",
|
|
705
|
+
"voice"
|
|
706
|
+
]
|
|
707
|
+
},
|
|
708
|
+
"vocal_gender": {
|
|
709
|
+
"enum": [
|
|
710
|
+
"male",
|
|
711
|
+
"female"
|
|
712
|
+
]
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
"generate-artwork": {
|
|
718
|
+
"models": [],
|
|
719
|
+
"fields_by_model": {
|
|
720
|
+
"_": {
|
|
721
|
+
"task_id": {
|
|
722
|
+
"required": true
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
"generate-lyrics": {
|
|
728
|
+
"models": [],
|
|
729
|
+
"fields_by_model": {
|
|
730
|
+
"_": {}
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
"generate-midi": {
|
|
734
|
+
"models": [],
|
|
735
|
+
"fields_by_model": {
|
|
736
|
+
"_": {}
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
"generate-persona": {
|
|
740
|
+
"models": [],
|
|
741
|
+
"fields_by_model": {
|
|
742
|
+
"_": {}
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"generate-voice": {
|
|
746
|
+
"models": [],
|
|
747
|
+
"fields_by_model": {
|
|
748
|
+
"_": {
|
|
749
|
+
"singer_skill_level": {
|
|
750
|
+
"enum": [
|
|
751
|
+
"beginner",
|
|
752
|
+
"intermediate",
|
|
753
|
+
"advanced",
|
|
754
|
+
"professional"
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
"task_id": {
|
|
758
|
+
"required": true
|
|
759
|
+
},
|
|
760
|
+
"verify_url": {
|
|
761
|
+
"required": true
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
"get-timestamped-lyrics": {
|
|
767
|
+
"models": [],
|
|
768
|
+
"fields_by_model": {
|
|
769
|
+
"_": {}
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
"regenerate-validation-phrase": {
|
|
773
|
+
"models": [],
|
|
774
|
+
"fields_by_model": {
|
|
775
|
+
"_": {
|
|
776
|
+
"task_id": {
|
|
777
|
+
"required": true
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
"replace-section": {
|
|
783
|
+
"models": [],
|
|
784
|
+
"fields_by_model": {
|
|
785
|
+
"_": {
|
|
786
|
+
"full_lyrics": {
|
|
787
|
+
"required": true
|
|
788
|
+
},
|
|
789
|
+
"infill_end_time": {
|
|
790
|
+
"required": true
|
|
791
|
+
},
|
|
792
|
+
"infill_start_time": {
|
|
793
|
+
"required": true
|
|
794
|
+
},
|
|
795
|
+
"lyrics": {
|
|
796
|
+
"required": true
|
|
797
|
+
},
|
|
798
|
+
"model": {
|
|
799
|
+
"enum": [
|
|
800
|
+
"suno-v4",
|
|
801
|
+
"suno-v4.5",
|
|
802
|
+
"suno-v4.5-all",
|
|
803
|
+
"suno-v4.5-plus",
|
|
804
|
+
"suno-v5",
|
|
805
|
+
"suno-v5.5"
|
|
806
|
+
]
|
|
807
|
+
},
|
|
808
|
+
"tags": {
|
|
809
|
+
"required": true
|
|
810
|
+
},
|
|
811
|
+
"title": {
|
|
812
|
+
"required": true
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
"separate-audio-stems": {
|
|
818
|
+
"models": [],
|
|
819
|
+
"fields_by_model": {
|
|
820
|
+
"_": {
|
|
821
|
+
"audio_id": {
|
|
822
|
+
"required": true
|
|
823
|
+
},
|
|
824
|
+
"task_id": {
|
|
825
|
+
"required": true
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
"text-to-music": {
|
|
831
|
+
"models": [
|
|
832
|
+
"suno-v4",
|
|
833
|
+
"suno-v4.5",
|
|
834
|
+
"suno-v4.5-all",
|
|
835
|
+
"suno-v4.5-plus",
|
|
836
|
+
"suno-v5",
|
|
837
|
+
"suno-v5.5"
|
|
838
|
+
],
|
|
839
|
+
"fields_by_model": {
|
|
840
|
+
"suno-v4": {
|
|
841
|
+
"duration_seconds": {
|
|
842
|
+
"type": "integer"
|
|
843
|
+
},
|
|
844
|
+
"model": {
|
|
845
|
+
"required": true
|
|
846
|
+
},
|
|
847
|
+
"persona_type": {
|
|
848
|
+
"enum": [
|
|
849
|
+
"style",
|
|
850
|
+
"voice"
|
|
851
|
+
]
|
|
852
|
+
},
|
|
853
|
+
"vocal_gender": {
|
|
854
|
+
"enum": [
|
|
855
|
+
"male",
|
|
856
|
+
"female"
|
|
857
|
+
]
|
|
858
|
+
},
|
|
859
|
+
"vocal_mode": {
|
|
860
|
+
"enum": [
|
|
861
|
+
"auto_lyrics",
|
|
862
|
+
"exact_lyrics",
|
|
863
|
+
"instrumental"
|
|
864
|
+
],
|
|
865
|
+
"required": true
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
"suno-v4.5": {
|
|
869
|
+
"duration_seconds": {
|
|
870
|
+
"type": "integer"
|
|
871
|
+
},
|
|
872
|
+
"model": {
|
|
873
|
+
"required": true
|
|
874
|
+
},
|
|
875
|
+
"persona_type": {
|
|
876
|
+
"enum": [
|
|
877
|
+
"style",
|
|
878
|
+
"voice"
|
|
879
|
+
]
|
|
880
|
+
},
|
|
881
|
+
"vocal_gender": {
|
|
882
|
+
"enum": [
|
|
883
|
+
"male",
|
|
884
|
+
"female"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
"vocal_mode": {
|
|
888
|
+
"enum": [
|
|
889
|
+
"auto_lyrics",
|
|
890
|
+
"exact_lyrics",
|
|
891
|
+
"instrumental"
|
|
892
|
+
],
|
|
893
|
+
"required": true
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
"suno-v4.5-all": {
|
|
897
|
+
"duration_seconds": {
|
|
898
|
+
"type": "integer"
|
|
899
|
+
},
|
|
900
|
+
"model": {
|
|
901
|
+
"required": true
|
|
902
|
+
},
|
|
903
|
+
"persona_type": {
|
|
904
|
+
"enum": [
|
|
905
|
+
"style",
|
|
906
|
+
"voice"
|
|
907
|
+
]
|
|
908
|
+
},
|
|
909
|
+
"vocal_gender": {
|
|
910
|
+
"enum": [
|
|
911
|
+
"male",
|
|
912
|
+
"female"
|
|
913
|
+
]
|
|
914
|
+
},
|
|
915
|
+
"vocal_mode": {
|
|
916
|
+
"enum": [
|
|
917
|
+
"auto_lyrics",
|
|
918
|
+
"exact_lyrics",
|
|
919
|
+
"instrumental"
|
|
920
|
+
],
|
|
921
|
+
"required": true
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
"suno-v4.5-plus": {
|
|
925
|
+
"duration_seconds": {
|
|
926
|
+
"type": "integer"
|
|
927
|
+
},
|
|
928
|
+
"model": {
|
|
929
|
+
"required": true
|
|
930
|
+
},
|
|
931
|
+
"persona_type": {
|
|
932
|
+
"enum": [
|
|
933
|
+
"style",
|
|
934
|
+
"voice"
|
|
935
|
+
]
|
|
936
|
+
},
|
|
937
|
+
"vocal_gender": {
|
|
938
|
+
"enum": [
|
|
939
|
+
"male",
|
|
940
|
+
"female"
|
|
941
|
+
]
|
|
942
|
+
},
|
|
943
|
+
"vocal_mode": {
|
|
944
|
+
"enum": [
|
|
945
|
+
"auto_lyrics",
|
|
946
|
+
"exact_lyrics",
|
|
947
|
+
"instrumental"
|
|
948
|
+
],
|
|
949
|
+
"required": true
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
"suno-v5": {
|
|
953
|
+
"duration_seconds": {
|
|
954
|
+
"type": "integer"
|
|
955
|
+
},
|
|
956
|
+
"model": {
|
|
957
|
+
"required": true
|
|
958
|
+
},
|
|
959
|
+
"persona_type": {
|
|
960
|
+
"enum": [
|
|
961
|
+
"style",
|
|
962
|
+
"voice"
|
|
963
|
+
]
|
|
964
|
+
},
|
|
965
|
+
"vocal_gender": {
|
|
966
|
+
"enum": [
|
|
967
|
+
"male",
|
|
968
|
+
"female"
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
"vocal_mode": {
|
|
972
|
+
"enum": [
|
|
973
|
+
"auto_lyrics",
|
|
974
|
+
"exact_lyrics",
|
|
975
|
+
"instrumental"
|
|
976
|
+
],
|
|
977
|
+
"required": true
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
"suno-v5.5": {
|
|
981
|
+
"duration_seconds": {
|
|
982
|
+
"type": "integer"
|
|
983
|
+
},
|
|
984
|
+
"model": {
|
|
985
|
+
"required": true
|
|
986
|
+
},
|
|
987
|
+
"persona_type": {
|
|
988
|
+
"enum": [
|
|
989
|
+
"style",
|
|
990
|
+
"voice"
|
|
991
|
+
]
|
|
992
|
+
},
|
|
993
|
+
"vocal_gender": {
|
|
994
|
+
"enum": [
|
|
995
|
+
"male",
|
|
996
|
+
"female"
|
|
997
|
+
]
|
|
998
|
+
},
|
|
999
|
+
"vocal_mode": {
|
|
1000
|
+
"enum": [
|
|
1001
|
+
"auto_lyrics",
|
|
1002
|
+
"exact_lyrics",
|
|
1003
|
+
"instrumental"
|
|
1004
|
+
],
|
|
1005
|
+
"required": true
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
"rules": [
|
|
1010
|
+
{
|
|
1011
|
+
"when": {
|
|
1012
|
+
"vocal_mode": "auto_lyrics"
|
|
1013
|
+
},
|
|
1014
|
+
"required": [
|
|
1015
|
+
"prompt"
|
|
1016
|
+
],
|
|
1017
|
+
"forbidden": [
|
|
1018
|
+
"lyrics",
|
|
1019
|
+
"style",
|
|
1020
|
+
"title"
|
|
1021
|
+
]
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
"when": {
|
|
1025
|
+
"vocal_mode": "exact_lyrics"
|
|
1026
|
+
},
|
|
1027
|
+
"required": [
|
|
1028
|
+
"lyrics",
|
|
1029
|
+
"style",
|
|
1030
|
+
"title"
|
|
1031
|
+
],
|
|
1032
|
+
"forbidden": [
|
|
1033
|
+
"prompt"
|
|
1034
|
+
]
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
"when": {
|
|
1038
|
+
"vocal_mode": "instrumental"
|
|
1039
|
+
},
|
|
1040
|
+
"required": [
|
|
1041
|
+
"style",
|
|
1042
|
+
"title"
|
|
1043
|
+
],
|
|
1044
|
+
"forbidden": [
|
|
1045
|
+
"prompt",
|
|
1046
|
+
"lyrics"
|
|
1047
|
+
]
|
|
1048
|
+
}
|
|
1049
|
+
]
|
|
1050
|
+
},
|
|
1051
|
+
"text-to-sound": {
|
|
1052
|
+
"models": [
|
|
1053
|
+
"suno-v5",
|
|
1054
|
+
"suno-v5.5"
|
|
1055
|
+
],
|
|
1056
|
+
"fields_by_model": {
|
|
1057
|
+
"suno-v5": {
|
|
1058
|
+
"model": {
|
|
1059
|
+
"required": true
|
|
1060
|
+
},
|
|
1061
|
+
"prompt": {
|
|
1062
|
+
"required": true
|
|
1063
|
+
},
|
|
1064
|
+
"sound_key": {
|
|
1065
|
+
"enum": [
|
|
1066
|
+
"Cm",
|
|
1067
|
+
"C#m",
|
|
1068
|
+
"Dm",
|
|
1069
|
+
"D#m",
|
|
1070
|
+
"Em",
|
|
1071
|
+
"Fm",
|
|
1072
|
+
"F#m",
|
|
1073
|
+
"Gm",
|
|
1074
|
+
"G#m",
|
|
1075
|
+
"Am",
|
|
1076
|
+
"A#m",
|
|
1077
|
+
"Bm",
|
|
1078
|
+
"C",
|
|
1079
|
+
"C#",
|
|
1080
|
+
"D",
|
|
1081
|
+
"D#",
|
|
1082
|
+
"E",
|
|
1083
|
+
"F",
|
|
1084
|
+
"F#",
|
|
1085
|
+
"G",
|
|
1086
|
+
"G#",
|
|
1087
|
+
"A",
|
|
1088
|
+
"A#",
|
|
1089
|
+
"B"
|
|
1090
|
+
]
|
|
1091
|
+
},
|
|
1092
|
+
"sound_tempo": {
|
|
1093
|
+
"type": "integer"
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
"suno-v5.5": {
|
|
1097
|
+
"model": {
|
|
1098
|
+
"required": true
|
|
1099
|
+
},
|
|
1100
|
+
"prompt": {
|
|
1101
|
+
"required": true
|
|
1102
|
+
},
|
|
1103
|
+
"sound_key": {
|
|
1104
|
+
"enum": [
|
|
1105
|
+
"Cm",
|
|
1106
|
+
"C#m",
|
|
1107
|
+
"Dm",
|
|
1108
|
+
"D#m",
|
|
1109
|
+
"Em",
|
|
1110
|
+
"Fm",
|
|
1111
|
+
"F#m",
|
|
1112
|
+
"Gm",
|
|
1113
|
+
"G#m",
|
|
1114
|
+
"Am",
|
|
1115
|
+
"A#m",
|
|
1116
|
+
"Bm",
|
|
1117
|
+
"C",
|
|
1118
|
+
"C#",
|
|
1119
|
+
"D",
|
|
1120
|
+
"D#",
|
|
1121
|
+
"E",
|
|
1122
|
+
"F",
|
|
1123
|
+
"F#",
|
|
1124
|
+
"G",
|
|
1125
|
+
"G#",
|
|
1126
|
+
"A",
|
|
1127
|
+
"A#",
|
|
1128
|
+
"B"
|
|
1129
|
+
]
|
|
1130
|
+
},
|
|
1131
|
+
"sound_tempo": {
|
|
1132
|
+
"type": "integer"
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
"visualize-music": {
|
|
1138
|
+
"models": [],
|
|
1139
|
+
"fields_by_model": {
|
|
1140
|
+
"_": {}
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
"voice-to-validation-phrase": {
|
|
1144
|
+
"models": [],
|
|
1145
|
+
"fields_by_model": {
|
|
1146
|
+
"_": {
|
|
1147
|
+
"language": {
|
|
1148
|
+
"enum": [
|
|
1149
|
+
"en",
|
|
1150
|
+
"zh",
|
|
1151
|
+
"es",
|
|
1152
|
+
"fr",
|
|
1153
|
+
"pt",
|
|
1154
|
+
"de",
|
|
1155
|
+
"ja",
|
|
1156
|
+
"ko",
|
|
1157
|
+
"hi",
|
|
1158
|
+
"ru"
|
|
1159
|
+
]
|
|
1160
|
+
},
|
|
1161
|
+
"vocal_end_seconds": {
|
|
1162
|
+
"required": true,
|
|
1163
|
+
"type": "integer"
|
|
1164
|
+
},
|
|
1165
|
+
"vocal_start_seconds": {
|
|
1166
|
+
"required": true,
|
|
1167
|
+
"type": "integer"
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
// src/resources/text-to-music.ts
|
|
7
1175
|
var ENDPOINT = "/api/v1/suno/text_to_music";
|
|
8
1176
|
var TextToMusic = class {
|
|
9
1177
|
constructor(http) {
|
|
10
1178
|
this.http = http;
|
|
11
1179
|
}
|
|
12
1180
|
http;
|
|
1181
|
+
/**
|
|
1182
|
+
* Create a text to music task and wait until complete.
|
|
1183
|
+
* @param params Text to music parameters.
|
|
1184
|
+
* @param options Per-request and polling overrides.
|
|
1185
|
+
* @returns The completed text to music response.
|
|
1186
|
+
*/
|
|
13
1187
|
async run(params, options) {
|
|
14
1188
|
const { id } = await this.create(params, options);
|
|
15
1189
|
const response = await pollUntilComplete(() => this.get(id, options), {
|
|
@@ -18,12 +1192,26 @@ var TextToMusic = class {
|
|
|
18
1192
|
});
|
|
19
1193
|
return response;
|
|
20
1194
|
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Create a text to music task; returns immediately with a task id.
|
|
1197
|
+
* @param params Text to music parameters.
|
|
1198
|
+
* @param options Per-request overrides.
|
|
1199
|
+
* @returns The task creation result.
|
|
1200
|
+
*/
|
|
21
1201
|
async create(params, options) {
|
|
1202
|
+
const body = compactParams(params);
|
|
1203
|
+
validateParams(contract["text-to-music"], body);
|
|
22
1204
|
return this.http.request("POST", ENDPOINT, {
|
|
23
|
-
body
|
|
1205
|
+
body,
|
|
24
1206
|
...options
|
|
25
1207
|
});
|
|
26
1208
|
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Fetch the current status of a text to music task.
|
|
1211
|
+
* @param id The task id.
|
|
1212
|
+
* @param options Per-request overrides.
|
|
1213
|
+
* @returns The current text to music task status.
|
|
1214
|
+
*/
|
|
27
1215
|
async get(id, options) {
|
|
28
1216
|
return this.http.request("GET", `${ENDPOINT}/${id}`, {
|
|
29
1217
|
...options
|
|
@@ -40,6 +1228,12 @@ var ExtendMusic = class {
|
|
|
40
1228
|
this.http = http;
|
|
41
1229
|
}
|
|
42
1230
|
http;
|
|
1231
|
+
/**
|
|
1232
|
+
* Create an extend music task and wait until complete.
|
|
1233
|
+
* @param params Extend music parameters.
|
|
1234
|
+
* @param options Per-request and polling overrides.
|
|
1235
|
+
* @returns The completed extend music response.
|
|
1236
|
+
*/
|
|
43
1237
|
async run(params, options) {
|
|
44
1238
|
const { id } = await this.create(params, options);
|
|
45
1239
|
const response = await pollUntilComplete2(() => this.get(id, options), {
|
|
@@ -48,12 +1242,24 @@ var ExtendMusic = class {
|
|
|
48
1242
|
});
|
|
49
1243
|
return response;
|
|
50
1244
|
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Create an extend music task; returns immediately with a task id.
|
|
1247
|
+
* @param params Extend music parameters.
|
|
1248
|
+
* @param options Per-request overrides.
|
|
1249
|
+
* @returns The task creation result.
|
|
1250
|
+
*/
|
|
51
1251
|
async create(params, options) {
|
|
52
1252
|
return this.http.request("POST", ENDPOINT2, {
|
|
53
1253
|
body: compactParams2(params),
|
|
54
1254
|
...options
|
|
55
1255
|
});
|
|
56
1256
|
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Fetch the current status of an extend music task.
|
|
1259
|
+
* @param id The task id.
|
|
1260
|
+
* @param options Per-request overrides.
|
|
1261
|
+
* @returns The current extend music task status.
|
|
1262
|
+
*/
|
|
57
1263
|
async get(id, options) {
|
|
58
1264
|
return this.http.request("GET", `${ENDPOINT2}/${id}`, {
|
|
59
1265
|
...options
|
|
@@ -70,6 +1276,12 @@ var GenerateArtwork = class {
|
|
|
70
1276
|
this.http = http;
|
|
71
1277
|
}
|
|
72
1278
|
http;
|
|
1279
|
+
/**
|
|
1280
|
+
* Create a generate artwork task and wait until complete.
|
|
1281
|
+
* @param params Generate artwork parameters.
|
|
1282
|
+
* @param options Per-request and polling overrides.
|
|
1283
|
+
* @returns The completed generate artwork response.
|
|
1284
|
+
*/
|
|
73
1285
|
async run(params, options) {
|
|
74
1286
|
const { id } = await this.create(params, options);
|
|
75
1287
|
const response = await pollUntilComplete3(() => this.get(id, options), {
|
|
@@ -78,12 +1290,24 @@ var GenerateArtwork = class {
|
|
|
78
1290
|
});
|
|
79
1291
|
return response;
|
|
80
1292
|
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Create a generate artwork task; returns immediately with a task id.
|
|
1295
|
+
* @param params Generate artwork parameters.
|
|
1296
|
+
* @param options Per-request overrides.
|
|
1297
|
+
* @returns The task creation result.
|
|
1298
|
+
*/
|
|
81
1299
|
async create(params, options) {
|
|
82
1300
|
return this.http.request("POST", ENDPOINT3, {
|
|
83
1301
|
body: compactParams3(params),
|
|
84
1302
|
...options
|
|
85
1303
|
});
|
|
86
1304
|
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Fetch the current status of a generate artwork task.
|
|
1307
|
+
* @param id The task id.
|
|
1308
|
+
* @param options Per-request overrides.
|
|
1309
|
+
* @returns The current generate artwork task status.
|
|
1310
|
+
*/
|
|
87
1311
|
async get(id, options) {
|
|
88
1312
|
return this.http.request("GET", `${ENDPOINT3}/${id}`, {
|
|
89
1313
|
...options
|
|
@@ -92,7 +1316,7 @@ var GenerateArtwork = class {
|
|
|
92
1316
|
};
|
|
93
1317
|
|
|
94
1318
|
// src/resources/cover-audio.ts
|
|
95
|
-
import { compactParams as compactParams4 } from "@runapi.ai/core";
|
|
1319
|
+
import { compactParams as compactParams4, validateParams as validateParams2 } from "@runapi.ai/core";
|
|
96
1320
|
import { pollUntilComplete as pollUntilComplete4 } from "@runapi.ai/core/internal";
|
|
97
1321
|
var ENDPOINT4 = "/api/v1/suno/cover_audio";
|
|
98
1322
|
var CoverAudio = class {
|
|
@@ -100,6 +1324,12 @@ var CoverAudio = class {
|
|
|
100
1324
|
this.http = http;
|
|
101
1325
|
}
|
|
102
1326
|
http;
|
|
1327
|
+
/**
|
|
1328
|
+
* Create a cover audio task and wait until complete.
|
|
1329
|
+
* @param params Cover audio parameters.
|
|
1330
|
+
* @param options Per-request and polling overrides.
|
|
1331
|
+
* @returns The completed cover audio response.
|
|
1332
|
+
*/
|
|
103
1333
|
async run(params, options) {
|
|
104
1334
|
const { id } = await this.create(params, options);
|
|
105
1335
|
const response = await pollUntilComplete4(() => this.get(id, options), {
|
|
@@ -108,12 +1338,26 @@ var CoverAudio = class {
|
|
|
108
1338
|
});
|
|
109
1339
|
return response;
|
|
110
1340
|
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Create a cover audio task; returns immediately with a task id.
|
|
1343
|
+
* @param params Cover audio parameters.
|
|
1344
|
+
* @param options Per-request overrides.
|
|
1345
|
+
* @returns The task creation result.
|
|
1346
|
+
*/
|
|
111
1347
|
async create(params, options) {
|
|
1348
|
+
const body = compactParams4(params);
|
|
1349
|
+
validateParams2(contract["cover-audio"], body);
|
|
112
1350
|
return this.http.request("POST", ENDPOINT4, {
|
|
113
|
-
body
|
|
1351
|
+
body,
|
|
114
1352
|
...options
|
|
115
1353
|
});
|
|
116
1354
|
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Fetch the current status of a cover audio task.
|
|
1357
|
+
* @param id The task id.
|
|
1358
|
+
* @param options Per-request overrides.
|
|
1359
|
+
* @returns The current cover audio task status.
|
|
1360
|
+
*/
|
|
117
1361
|
async get(id, options) {
|
|
118
1362
|
return this.http.request("GET", `${ENDPOINT4}/${id}`, {
|
|
119
1363
|
...options
|
|
@@ -130,6 +1374,12 @@ var AddInstrumental = class {
|
|
|
130
1374
|
this.http = http;
|
|
131
1375
|
}
|
|
132
1376
|
http;
|
|
1377
|
+
/**
|
|
1378
|
+
* Create an add instrumental task and wait until complete.
|
|
1379
|
+
* @param params Add instrumental parameters.
|
|
1380
|
+
* @param options Per-request and polling overrides.
|
|
1381
|
+
* @returns The completed add instrumental response.
|
|
1382
|
+
*/
|
|
133
1383
|
async run(params, options) {
|
|
134
1384
|
const { id } = await this.create(params, options);
|
|
135
1385
|
const response = await pollUntilComplete5(() => this.get(id, options), {
|
|
@@ -138,12 +1388,24 @@ var AddInstrumental = class {
|
|
|
138
1388
|
});
|
|
139
1389
|
return response;
|
|
140
1390
|
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Create an add instrumental task; returns immediately with a task id.
|
|
1393
|
+
* @param params Add instrumental parameters.
|
|
1394
|
+
* @param options Per-request overrides.
|
|
1395
|
+
* @returns The task creation result.
|
|
1396
|
+
*/
|
|
141
1397
|
async create(params, options) {
|
|
142
1398
|
return this.http.request("POST", ENDPOINT5, {
|
|
143
1399
|
body: compactParams5(params),
|
|
144
1400
|
...options
|
|
145
1401
|
});
|
|
146
1402
|
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Fetch the current status of an add instrumental task.
|
|
1405
|
+
* @param id The task id.
|
|
1406
|
+
* @param options Per-request overrides.
|
|
1407
|
+
* @returns The current add instrumental task status.
|
|
1408
|
+
*/
|
|
147
1409
|
async get(id, options) {
|
|
148
1410
|
return this.http.request("GET", `${ENDPOINT5}/${id}`, {
|
|
149
1411
|
...options
|
|
@@ -160,6 +1422,12 @@ var AddVocals = class {
|
|
|
160
1422
|
this.http = http;
|
|
161
1423
|
}
|
|
162
1424
|
http;
|
|
1425
|
+
/**
|
|
1426
|
+
* Create an add vocals task and wait until complete.
|
|
1427
|
+
* @param params Add vocals parameters.
|
|
1428
|
+
* @param options Per-request and polling overrides.
|
|
1429
|
+
* @returns The completed add vocals response.
|
|
1430
|
+
*/
|
|
163
1431
|
async run(params, options) {
|
|
164
1432
|
const { id } = await this.create(params, options);
|
|
165
1433
|
const response = await pollUntilComplete6(() => this.get(id, options), {
|
|
@@ -168,12 +1436,24 @@ var AddVocals = class {
|
|
|
168
1436
|
});
|
|
169
1437
|
return response;
|
|
170
1438
|
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Create an add vocals task; returns immediately with a task id.
|
|
1441
|
+
* @param params Add vocals parameters.
|
|
1442
|
+
* @param options Per-request overrides.
|
|
1443
|
+
* @returns The task creation result.
|
|
1444
|
+
*/
|
|
171
1445
|
async create(params, options) {
|
|
172
1446
|
return this.http.request("POST", ENDPOINT6, {
|
|
173
1447
|
body: compactParams6(params),
|
|
174
1448
|
...options
|
|
175
1449
|
});
|
|
176
1450
|
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Fetch the current status of an add vocals task.
|
|
1453
|
+
* @param id The task id.
|
|
1454
|
+
* @param options Per-request overrides.
|
|
1455
|
+
* @returns The current add vocals task status.
|
|
1456
|
+
*/
|
|
177
1457
|
async get(id, options) {
|
|
178
1458
|
return this.http.request("GET", `${ENDPOINT6}/${id}`, {
|
|
179
1459
|
...options
|
|
@@ -190,6 +1470,12 @@ var SeparateAudioStems = class {
|
|
|
190
1470
|
this.http = http;
|
|
191
1471
|
}
|
|
192
1472
|
http;
|
|
1473
|
+
/**
|
|
1474
|
+
* Create a separate audio stems task and wait until complete.
|
|
1475
|
+
* @param params Separate audio stems parameters.
|
|
1476
|
+
* @param options Per-request and polling overrides.
|
|
1477
|
+
* @returns The completed separate audio stems response.
|
|
1478
|
+
*/
|
|
193
1479
|
async run(params, options) {
|
|
194
1480
|
const { id } = await this.create(params, options);
|
|
195
1481
|
const response = await pollUntilComplete7(() => this.get(id, options), {
|
|
@@ -198,12 +1484,24 @@ var SeparateAudioStems = class {
|
|
|
198
1484
|
});
|
|
199
1485
|
return response;
|
|
200
1486
|
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Create a separate audio stems task; returns immediately with a task id.
|
|
1489
|
+
* @param params Separate audio stems parameters.
|
|
1490
|
+
* @param options Per-request overrides.
|
|
1491
|
+
* @returns The task creation result.
|
|
1492
|
+
*/
|
|
201
1493
|
async create(params, options) {
|
|
202
1494
|
return this.http.request("POST", ENDPOINT7, {
|
|
203
1495
|
body: compactParams7(params),
|
|
204
1496
|
...options
|
|
205
1497
|
});
|
|
206
1498
|
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Fetch the current status of a separate audio stems task.
|
|
1501
|
+
* @param id The task id.
|
|
1502
|
+
* @param options Per-request overrides.
|
|
1503
|
+
* @returns The current separate audio stems task status.
|
|
1504
|
+
*/
|
|
207
1505
|
async get(id, options) {
|
|
208
1506
|
return this.http.request("GET", `${ENDPOINT7}/${id}`, {
|
|
209
1507
|
...options
|
|
@@ -220,6 +1518,12 @@ var GenerateMidi = class {
|
|
|
220
1518
|
this.http = http;
|
|
221
1519
|
}
|
|
222
1520
|
http;
|
|
1521
|
+
/**
|
|
1522
|
+
* Create a generate midi task and wait until complete.
|
|
1523
|
+
* @param params Generate midi parameters.
|
|
1524
|
+
* @param options Per-request and polling overrides.
|
|
1525
|
+
* @returns The completed generate midi response.
|
|
1526
|
+
*/
|
|
223
1527
|
async run(params, options) {
|
|
224
1528
|
const { id } = await this.create(params, options);
|
|
225
1529
|
const response = await pollUntilComplete8(() => this.get(id, options), {
|
|
@@ -228,12 +1532,24 @@ var GenerateMidi = class {
|
|
|
228
1532
|
});
|
|
229
1533
|
return response;
|
|
230
1534
|
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Create a generate midi task; returns immediately with a task id.
|
|
1537
|
+
* @param params Generate midi parameters.
|
|
1538
|
+
* @param options Per-request overrides.
|
|
1539
|
+
* @returns The task creation result.
|
|
1540
|
+
*/
|
|
231
1541
|
async create(params, options) {
|
|
232
1542
|
return this.http.request("POST", ENDPOINT8, {
|
|
233
1543
|
body: compactParams8(params),
|
|
234
1544
|
...options
|
|
235
1545
|
});
|
|
236
1546
|
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Fetch the current status of a generate midi task.
|
|
1549
|
+
* @param id The task id.
|
|
1550
|
+
* @param options Per-request overrides.
|
|
1551
|
+
* @returns The current generate midi task status.
|
|
1552
|
+
*/
|
|
237
1553
|
async get(id, options) {
|
|
238
1554
|
return this.http.request("GET", `${ENDPOINT8}/${id}`, {
|
|
239
1555
|
...options
|
|
@@ -250,6 +1566,12 @@ var ConvertAudio = class {
|
|
|
250
1566
|
this.http = http;
|
|
251
1567
|
}
|
|
252
1568
|
http;
|
|
1569
|
+
/**
|
|
1570
|
+
* Create a convert audio task and wait until complete.
|
|
1571
|
+
* @param params Convert audio parameters.
|
|
1572
|
+
* @param options Per-request and polling overrides.
|
|
1573
|
+
* @returns The completed convert audio response.
|
|
1574
|
+
*/
|
|
253
1575
|
async run(params, options) {
|
|
254
1576
|
const { id } = await this.create(params, options);
|
|
255
1577
|
const response = await pollUntilComplete9(() => this.get(id, options), {
|
|
@@ -258,12 +1580,24 @@ var ConvertAudio = class {
|
|
|
258
1580
|
});
|
|
259
1581
|
return response;
|
|
260
1582
|
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Create a convert audio task; returns immediately with a task id.
|
|
1585
|
+
* @param params Convert audio parameters.
|
|
1586
|
+
* @param options Per-request overrides.
|
|
1587
|
+
* @returns The task creation result.
|
|
1588
|
+
*/
|
|
261
1589
|
async create(params, options) {
|
|
262
1590
|
return this.http.request("POST", ENDPOINT9, {
|
|
263
1591
|
body: compactParams9(params),
|
|
264
1592
|
...options
|
|
265
1593
|
});
|
|
266
1594
|
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Fetch the current status of a convert audio task.
|
|
1597
|
+
* @param id The task id.
|
|
1598
|
+
* @param options Per-request overrides.
|
|
1599
|
+
* @returns The current convert audio task status.
|
|
1600
|
+
*/
|
|
267
1601
|
async get(id, options) {
|
|
268
1602
|
return this.http.request("GET", `${ENDPOINT9}/${id}`, {
|
|
269
1603
|
...options
|
|
@@ -280,6 +1614,12 @@ var VisualizeMusic = class {
|
|
|
280
1614
|
this.http = http;
|
|
281
1615
|
}
|
|
282
1616
|
http;
|
|
1617
|
+
/**
|
|
1618
|
+
* Create a visualize music task and wait until complete.
|
|
1619
|
+
* @param params Visualize music parameters.
|
|
1620
|
+
* @param options Per-request and polling overrides.
|
|
1621
|
+
* @returns The completed visualize music response.
|
|
1622
|
+
*/
|
|
283
1623
|
async run(params, options) {
|
|
284
1624
|
const { id } = await this.create(params, options);
|
|
285
1625
|
const response = await pollUntilComplete10(() => this.get(id, options), {
|
|
@@ -288,12 +1628,24 @@ var VisualizeMusic = class {
|
|
|
288
1628
|
});
|
|
289
1629
|
return response;
|
|
290
1630
|
}
|
|
1631
|
+
/**
|
|
1632
|
+
* Create a visualize music task; returns immediately with a task id.
|
|
1633
|
+
* @param params Visualize music parameters.
|
|
1634
|
+
* @param options Per-request overrides.
|
|
1635
|
+
* @returns The task creation result.
|
|
1636
|
+
*/
|
|
291
1637
|
async create(params, options) {
|
|
292
1638
|
return this.http.request("POST", ENDPOINT10, {
|
|
293
1639
|
body: compactParams10(params),
|
|
294
1640
|
...options
|
|
295
1641
|
});
|
|
296
1642
|
}
|
|
1643
|
+
/**
|
|
1644
|
+
* Fetch the current status of a visualize music task.
|
|
1645
|
+
* @param id The task id.
|
|
1646
|
+
* @param options Per-request overrides.
|
|
1647
|
+
* @returns The current visualize music task status.
|
|
1648
|
+
*/
|
|
297
1649
|
async get(id, options) {
|
|
298
1650
|
return this.http.request("GET", `${ENDPOINT10}/${id}`, {
|
|
299
1651
|
...options
|
|
@@ -310,6 +1662,12 @@ var GenerateLyrics = class {
|
|
|
310
1662
|
this.http = http;
|
|
311
1663
|
}
|
|
312
1664
|
http;
|
|
1665
|
+
/**
|
|
1666
|
+
* Create a generate lyrics task and wait until complete.
|
|
1667
|
+
* @param params Generate lyrics parameters.
|
|
1668
|
+
* @param options Per-request and polling overrides.
|
|
1669
|
+
* @returns The completed generate lyrics response.
|
|
1670
|
+
*/
|
|
313
1671
|
async run(params, options) {
|
|
314
1672
|
const { id } = await this.create(params, options);
|
|
315
1673
|
const response = await pollUntilComplete11(() => this.get(id, options), {
|
|
@@ -318,12 +1676,24 @@ var GenerateLyrics = class {
|
|
|
318
1676
|
});
|
|
319
1677
|
return response;
|
|
320
1678
|
}
|
|
1679
|
+
/**
|
|
1680
|
+
* Create a generate lyrics task; returns immediately with a task id.
|
|
1681
|
+
* @param params Generate lyrics parameters.
|
|
1682
|
+
* @param options Per-request overrides.
|
|
1683
|
+
* @returns The task creation result.
|
|
1684
|
+
*/
|
|
321
1685
|
async create(params, options) {
|
|
322
1686
|
return this.http.request("POST", ENDPOINT11, {
|
|
323
1687
|
body: compactParams11(params),
|
|
324
1688
|
...options
|
|
325
1689
|
});
|
|
326
1690
|
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Fetch the current status of a generate lyrics task.
|
|
1693
|
+
* @param id The task id.
|
|
1694
|
+
* @param options Per-request overrides.
|
|
1695
|
+
* @returns The current generate lyrics task status.
|
|
1696
|
+
*/
|
|
327
1697
|
async get(id, options) {
|
|
328
1698
|
return this.http.request("GET", `${ENDPOINT11}/${id}`, {
|
|
329
1699
|
...options
|
|
@@ -339,6 +1709,12 @@ var GetTimestampedLyrics = class {
|
|
|
339
1709
|
this.http = http;
|
|
340
1710
|
}
|
|
341
1711
|
http;
|
|
1712
|
+
/**
|
|
1713
|
+
* Run get timestamped lyrics (synchronous).
|
|
1714
|
+
* @param params Get timestamped lyrics parameters.
|
|
1715
|
+
* @param options Per-request overrides.
|
|
1716
|
+
* @returns The get timestamped lyrics response.
|
|
1717
|
+
*/
|
|
342
1718
|
async run(params, options) {
|
|
343
1719
|
return this.http.request("POST", ENDPOINT12, {
|
|
344
1720
|
body: compactParams12(params),
|
|
@@ -348,7 +1724,7 @@ var GetTimestampedLyrics = class {
|
|
|
348
1724
|
};
|
|
349
1725
|
|
|
350
1726
|
// src/resources/replace-section.ts
|
|
351
|
-
import { compactParams as compactParams13 } from "@runapi.ai/core";
|
|
1727
|
+
import { compactParams as compactParams13, validateParams as validateParams3, ValidationError } from "@runapi.ai/core";
|
|
352
1728
|
import { pollUntilComplete as pollUntilComplete12 } from "@runapi.ai/core/internal";
|
|
353
1729
|
var ENDPOINT13 = "/api/v1/suno/replace_section";
|
|
354
1730
|
var ReplaceSection = class {
|
|
@@ -356,6 +1732,12 @@ var ReplaceSection = class {
|
|
|
356
1732
|
this.http = http;
|
|
357
1733
|
}
|
|
358
1734
|
http;
|
|
1735
|
+
/**
|
|
1736
|
+
* Create a replace section task and wait until complete.
|
|
1737
|
+
* @param params Replace section parameters.
|
|
1738
|
+
* @param options Per-request and polling overrides.
|
|
1739
|
+
* @returns The completed replace section response.
|
|
1740
|
+
*/
|
|
359
1741
|
async run(params, options) {
|
|
360
1742
|
const { id } = await this.create(params, options);
|
|
361
1743
|
const response = await pollUntilComplete12(() => this.get(id, options), {
|
|
@@ -364,21 +1746,89 @@ var ReplaceSection = class {
|
|
|
364
1746
|
});
|
|
365
1747
|
return response;
|
|
366
1748
|
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Create a replace section task; returns immediately with a task id.
|
|
1751
|
+
* @param params Replace section parameters.
|
|
1752
|
+
* @param options Per-request overrides.
|
|
1753
|
+
* @returns The task creation result.
|
|
1754
|
+
*/
|
|
367
1755
|
async create(params, options) {
|
|
1756
|
+
const body = compactParams13(params);
|
|
1757
|
+
validateParams3(contract["replace-section"], body);
|
|
1758
|
+
validateReplaceSection(body);
|
|
368
1759
|
return this.http.request("POST", ENDPOINT13, {
|
|
369
|
-
body
|
|
1760
|
+
body,
|
|
370
1761
|
...options
|
|
371
1762
|
});
|
|
372
1763
|
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Fetch the current status of a replace section task.
|
|
1766
|
+
* @param id The task id.
|
|
1767
|
+
* @param options Per-request overrides.
|
|
1768
|
+
* @returns The current replace section task status.
|
|
1769
|
+
*/
|
|
373
1770
|
async get(id, options) {
|
|
374
1771
|
return this.http.request("GET", `${ENDPOINT13}/${id}`, {
|
|
375
1772
|
...options
|
|
376
1773
|
});
|
|
377
1774
|
}
|
|
378
1775
|
};
|
|
1776
|
+
function validateReplaceSection(body) {
|
|
1777
|
+
validateReplaceSectionSource(body);
|
|
1778
|
+
const startTime = body.infill_start_time;
|
|
1779
|
+
const endTime = body.infill_end_time;
|
|
1780
|
+
if (typeof startTime !== "number" || Number.isNaN(startTime)) {
|
|
1781
|
+
throw new ValidationError("infill_start_time must be a number");
|
|
1782
|
+
}
|
|
1783
|
+
if (typeof endTime !== "number" || Number.isNaN(endTime)) {
|
|
1784
|
+
throw new ValidationError("infill_end_time must be a number");
|
|
1785
|
+
}
|
|
1786
|
+
if (endTime <= startTime) {
|
|
1787
|
+
throw new ValidationError("infill_end_time must be greater than infill_start_time");
|
|
1788
|
+
}
|
|
1789
|
+
const duration = endTime - startTime;
|
|
1790
|
+
if (duration < 6 || duration > 60) {
|
|
1791
|
+
throw new ValidationError("replacement duration must be between 6 and 60 seconds");
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
function validateReplaceSectionSource(body) {
|
|
1795
|
+
const hasExistingSource = isPresent(body.task_id) || isPresent(body.audio_id);
|
|
1796
|
+
const hasUploadedSource = isPresent(body.upload_url) || isPresent(body.model);
|
|
1797
|
+
if (hasExistingSource && hasUploadedSource) {
|
|
1798
|
+
throw new ValidationError("task_id/audio_id cannot be combined with upload_url/model");
|
|
1799
|
+
}
|
|
1800
|
+
if (hasExistingSource) {
|
|
1801
|
+
requireField(body, "task_id");
|
|
1802
|
+
requireField(body, "audio_id");
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
if (hasUploadedSource) {
|
|
1806
|
+
requireField(body, "upload_url");
|
|
1807
|
+
requireField(body, "model");
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
throw new ValidationError("task_id and audio_id, or upload_url and model are required");
|
|
1811
|
+
}
|
|
1812
|
+
function requireField(body, field) {
|
|
1813
|
+
if (!isPresent(body[field])) {
|
|
1814
|
+
throw new ValidationError(`${field} is required`);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
function isPresent(value) {
|
|
1818
|
+
if (value === void 0 || value === null) {
|
|
1819
|
+
return false;
|
|
1820
|
+
}
|
|
1821
|
+
if (typeof value === "string") {
|
|
1822
|
+
return value.length > 0;
|
|
1823
|
+
}
|
|
1824
|
+
if (Array.isArray(value)) {
|
|
1825
|
+
return value.length > 0;
|
|
1826
|
+
}
|
|
1827
|
+
return true;
|
|
1828
|
+
}
|
|
379
1829
|
|
|
380
1830
|
// src/resources/create-mashup.ts
|
|
381
|
-
import { compactParams as compactParams14 } from "@runapi.ai/core";
|
|
1831
|
+
import { compactParams as compactParams14, validateParams as validateParams4 } from "@runapi.ai/core";
|
|
382
1832
|
import { pollUntilComplete as pollUntilComplete13 } from "@runapi.ai/core/internal";
|
|
383
1833
|
var ENDPOINT14 = "/api/v1/suno/create_mashup";
|
|
384
1834
|
var CreateMashup = class {
|
|
@@ -386,6 +1836,12 @@ var CreateMashup = class {
|
|
|
386
1836
|
this.http = http;
|
|
387
1837
|
}
|
|
388
1838
|
http;
|
|
1839
|
+
/**
|
|
1840
|
+
* Create a create mashup task and wait until complete.
|
|
1841
|
+
* @param params Create mashup parameters.
|
|
1842
|
+
* @param options Per-request and polling overrides.
|
|
1843
|
+
* @returns The completed create mashup response.
|
|
1844
|
+
*/
|
|
389
1845
|
async run(params, options) {
|
|
390
1846
|
const { id } = await this.create(params, options);
|
|
391
1847
|
const response = await pollUntilComplete13(() => this.get(id, options), {
|
|
@@ -394,12 +1850,26 @@ var CreateMashup = class {
|
|
|
394
1850
|
});
|
|
395
1851
|
return response;
|
|
396
1852
|
}
|
|
1853
|
+
/**
|
|
1854
|
+
* Create a create mashup task; returns immediately with a task id.
|
|
1855
|
+
* @param params Create mashup parameters.
|
|
1856
|
+
* @param options Per-request overrides.
|
|
1857
|
+
* @returns The task creation result.
|
|
1858
|
+
*/
|
|
397
1859
|
async create(params, options) {
|
|
1860
|
+
const body = compactParams14(params);
|
|
1861
|
+
validateParams4(contract["create-mashup"], body);
|
|
398
1862
|
return this.http.request("POST", ENDPOINT14, {
|
|
399
|
-
body
|
|
1863
|
+
body,
|
|
400
1864
|
...options
|
|
401
1865
|
});
|
|
402
1866
|
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Fetch the current status of a create mashup task.
|
|
1869
|
+
* @param id The task id.
|
|
1870
|
+
* @param options Per-request overrides.
|
|
1871
|
+
* @returns The current create mashup task status.
|
|
1872
|
+
*/
|
|
403
1873
|
async get(id, options) {
|
|
404
1874
|
return this.http.request("GET", `${ENDPOINT14}/${id}`, {
|
|
405
1875
|
...options
|
|
@@ -416,6 +1886,12 @@ var TextToSound = class {
|
|
|
416
1886
|
this.http = http;
|
|
417
1887
|
}
|
|
418
1888
|
http;
|
|
1889
|
+
/**
|
|
1890
|
+
* Create a text to sound task and wait until complete.
|
|
1891
|
+
* @param params Text to sound parameters.
|
|
1892
|
+
* @param options Per-request and polling overrides.
|
|
1893
|
+
* @returns The completed text to sound response.
|
|
1894
|
+
*/
|
|
419
1895
|
async run(params, options) {
|
|
420
1896
|
const { id } = await this.create(params, options);
|
|
421
1897
|
const response = await pollUntilComplete14(() => this.get(id, options), {
|
|
@@ -424,12 +1900,24 @@ var TextToSound = class {
|
|
|
424
1900
|
});
|
|
425
1901
|
return response;
|
|
426
1902
|
}
|
|
1903
|
+
/**
|
|
1904
|
+
* Create a text to sound task; returns immediately with a task id.
|
|
1905
|
+
* @param params Text to sound parameters.
|
|
1906
|
+
* @param options Per-request overrides.
|
|
1907
|
+
* @returns The task creation result.
|
|
1908
|
+
*/
|
|
427
1909
|
async create(params, options) {
|
|
428
1910
|
return this.http.request("POST", ENDPOINT15, {
|
|
429
1911
|
body: compactParams15(params),
|
|
430
1912
|
...options
|
|
431
1913
|
});
|
|
432
1914
|
}
|
|
1915
|
+
/**
|
|
1916
|
+
* Fetch the current status of a text to sound task.
|
|
1917
|
+
* @param id The task id.
|
|
1918
|
+
* @param options Per-request overrides.
|
|
1919
|
+
* @returns The current text to sound task status.
|
|
1920
|
+
*/
|
|
433
1921
|
async get(id, options) {
|
|
434
1922
|
return this.http.request("GET", `${ENDPOINT15}/${id}`, {
|
|
435
1923
|
...options
|
|
@@ -445,6 +1933,12 @@ var GeneratePersona = class {
|
|
|
445
1933
|
this.http = http;
|
|
446
1934
|
}
|
|
447
1935
|
http;
|
|
1936
|
+
/**
|
|
1937
|
+
* Run generate persona (synchronous).
|
|
1938
|
+
* @param params Generate persona parameters.
|
|
1939
|
+
* @param options Per-request overrides.
|
|
1940
|
+
* @returns The generate persona response.
|
|
1941
|
+
*/
|
|
448
1942
|
async run(params, options) {
|
|
449
1943
|
return this.http.request("POST", ENDPOINT16, {
|
|
450
1944
|
body: compactParams16(params),
|
|
@@ -461,6 +1955,12 @@ var BoostStyle = class {
|
|
|
461
1955
|
this.http = http;
|
|
462
1956
|
}
|
|
463
1957
|
http;
|
|
1958
|
+
/**
|
|
1959
|
+
* Run boost style (synchronous).
|
|
1960
|
+
* @param params Boost style parameters.
|
|
1961
|
+
* @param options Per-request overrides.
|
|
1962
|
+
* @returns The boost style response.
|
|
1963
|
+
*/
|
|
464
1964
|
async run(params, options) {
|
|
465
1965
|
return this.http.request("POST", ENDPOINT17, {
|
|
466
1966
|
body: compactParams17(params),
|
|
@@ -478,6 +1978,12 @@ var VoiceToValidationPhrase = class {
|
|
|
478
1978
|
this.http = http;
|
|
479
1979
|
}
|
|
480
1980
|
http;
|
|
1981
|
+
/**
|
|
1982
|
+
* Create a voice to validation phrase task and wait until complete.
|
|
1983
|
+
* @param params Voice to validation phrase parameters.
|
|
1984
|
+
* @param options Per-request and polling overrides.
|
|
1985
|
+
* @returns The completed voice to validation phrase response.
|
|
1986
|
+
*/
|
|
481
1987
|
async run(params, options) {
|
|
482
1988
|
const { id } = await this.create(params, options);
|
|
483
1989
|
const response = await pollUntilComplete15(() => this.get(id, options), {
|
|
@@ -486,12 +1992,24 @@ var VoiceToValidationPhrase = class {
|
|
|
486
1992
|
});
|
|
487
1993
|
return response;
|
|
488
1994
|
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Create a voice to validation phrase task; returns immediately with a task id.
|
|
1997
|
+
* @param params Voice to validation phrase parameters.
|
|
1998
|
+
* @param options Per-request overrides.
|
|
1999
|
+
* @returns The task creation result.
|
|
2000
|
+
*/
|
|
489
2001
|
async create(params, options) {
|
|
490
2002
|
return this.http.request("POST", ENDPOINT18, {
|
|
491
2003
|
body: compactParams18(params),
|
|
492
2004
|
...options
|
|
493
2005
|
});
|
|
494
2006
|
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Fetch the current status of a voice to validation phrase task.
|
|
2009
|
+
* @param id The task id.
|
|
2010
|
+
* @param options Per-request overrides.
|
|
2011
|
+
* @returns The current voice to validation phrase task status.
|
|
2012
|
+
*/
|
|
495
2013
|
async get(id, options) {
|
|
496
2014
|
return this.http.request("GET", `${ENDPOINT18}/${id}`, {
|
|
497
2015
|
...options
|
|
@@ -508,6 +2026,12 @@ var RegenerateValidationPhrase = class {
|
|
|
508
2026
|
this.http = http;
|
|
509
2027
|
}
|
|
510
2028
|
http;
|
|
2029
|
+
/**
|
|
2030
|
+
* Create a regenerate validation phrase task and wait until complete.
|
|
2031
|
+
* @param params Regenerate validation phrase parameters.
|
|
2032
|
+
* @param options Per-request and polling overrides.
|
|
2033
|
+
* @returns The completed regenerate validation phrase response.
|
|
2034
|
+
*/
|
|
511
2035
|
async run(params, options) {
|
|
512
2036
|
const { id } = await this.create(params, options);
|
|
513
2037
|
const response = await pollUntilComplete16(() => this.get(id, options), {
|
|
@@ -516,12 +2040,24 @@ var RegenerateValidationPhrase = class {
|
|
|
516
2040
|
});
|
|
517
2041
|
return response;
|
|
518
2042
|
}
|
|
2043
|
+
/**
|
|
2044
|
+
* Create a regenerate validation phrase task; returns immediately with a task id.
|
|
2045
|
+
* @param params Regenerate validation phrase parameters.
|
|
2046
|
+
* @param options Per-request overrides.
|
|
2047
|
+
* @returns The task creation result.
|
|
2048
|
+
*/
|
|
519
2049
|
async create(params, options) {
|
|
520
2050
|
return this.http.request("POST", ENDPOINT19, {
|
|
521
2051
|
body: compactParams19(params),
|
|
522
2052
|
...options
|
|
523
2053
|
});
|
|
524
2054
|
}
|
|
2055
|
+
/**
|
|
2056
|
+
* Fetch the current status of a regenerate validation phrase task.
|
|
2057
|
+
* @param id The task id.
|
|
2058
|
+
* @param options Per-request overrides.
|
|
2059
|
+
* @returns The current regenerate validation phrase task status.
|
|
2060
|
+
*/
|
|
525
2061
|
async get(id, options) {
|
|
526
2062
|
return this.http.request("GET", `${ENDPOINT19}/${id}`, {
|
|
527
2063
|
...options
|
|
@@ -538,6 +2074,12 @@ var GenerateVoice = class {
|
|
|
538
2074
|
this.http = http;
|
|
539
2075
|
}
|
|
540
2076
|
http;
|
|
2077
|
+
/**
|
|
2078
|
+
* Create a generate voice task and wait until complete.
|
|
2079
|
+
* @param params Generate voice parameters.
|
|
2080
|
+
* @param options Per-request and polling overrides.
|
|
2081
|
+
* @returns The completed generate voice response.
|
|
2082
|
+
*/
|
|
541
2083
|
async run(params, options) {
|
|
542
2084
|
const { id } = await this.create(params, options);
|
|
543
2085
|
const response = await pollUntilComplete17(() => this.get(id, options), {
|
|
@@ -546,12 +2088,24 @@ var GenerateVoice = class {
|
|
|
546
2088
|
});
|
|
547
2089
|
return response;
|
|
548
2090
|
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Create a generate voice task; returns immediately with a task id.
|
|
2093
|
+
* @param params Generate voice parameters.
|
|
2094
|
+
* @param options Per-request overrides.
|
|
2095
|
+
* @returns The task creation result.
|
|
2096
|
+
*/
|
|
549
2097
|
async create(params, options) {
|
|
550
2098
|
return this.http.request("POST", ENDPOINT20, {
|
|
551
2099
|
body: compactParams20(params),
|
|
552
2100
|
...options
|
|
553
2101
|
});
|
|
554
2102
|
}
|
|
2103
|
+
/**
|
|
2104
|
+
* Fetch the current status of a generate voice task.
|
|
2105
|
+
* @param id The task id.
|
|
2106
|
+
* @param options Per-request overrides.
|
|
2107
|
+
* @returns The current generate voice task status.
|
|
2108
|
+
*/
|
|
555
2109
|
async get(id, options) {
|
|
556
2110
|
return this.http.request("GET", `${ENDPOINT20}/${id}`, {
|
|
557
2111
|
...options
|
|
@@ -567,6 +2121,12 @@ var CheckVoice = class {
|
|
|
567
2121
|
this.http = http;
|
|
568
2122
|
}
|
|
569
2123
|
http;
|
|
2124
|
+
/**
|
|
2125
|
+
* Run check voice (synchronous).
|
|
2126
|
+
* @param params Check voice parameters.
|
|
2127
|
+
* @param options Per-request overrides.
|
|
2128
|
+
* @returns The check voice response.
|
|
2129
|
+
*/
|
|
570
2130
|
async run(params, options) {
|
|
571
2131
|
return this.http.request("POST", ENDPOINT21, {
|
|
572
2132
|
body: compactParams21(params),
|
|
@@ -576,51 +2136,72 @@ var CheckVoice = class {
|
|
|
576
2136
|
};
|
|
577
2137
|
|
|
578
2138
|
// src/client.ts
|
|
579
|
-
var SunoClient = class {
|
|
2139
|
+
var SunoClient = class extends BaseClient {
|
|
2140
|
+
/** Generates songs from a text prompt with configurable vocal mode, style, and persona. */
|
|
580
2141
|
textToMusic;
|
|
2142
|
+
/** Continues an existing track from a specified timestamp, inheriting or overriding its settings. */
|
|
581
2143
|
extendMusic;
|
|
2144
|
+
/** Creates cover artwork for an existing music task. */
|
|
582
2145
|
generateArtwork;
|
|
2146
|
+
/** Re-records vocals over an uploaded audio file with a new style or voice. */
|
|
583
2147
|
coverAudio;
|
|
2148
|
+
/** Generates and adds an instrumental backing track to uploaded audio. */
|
|
584
2149
|
addInstrumental;
|
|
2150
|
+
/** Generates and adds vocals to an uploaded instrumental track. */
|
|
585
2151
|
addVocals;
|
|
2152
|
+
/** Splits a track into individual instrument stems (vocals, drums, bass, guitar, etc.). */
|
|
586
2153
|
separateAudioStems;
|
|
2154
|
+
/** Extracts per-instrument MIDI note data from a generated track. */
|
|
587
2155
|
generateMidi;
|
|
2156
|
+
/** Converts a generated track to WAV format. */
|
|
588
2157
|
convertAudio;
|
|
2158
|
+
/** Generates a music visualization video from an existing track. */
|
|
589
2159
|
visualizeMusic;
|
|
2160
|
+
/** Produces AI-generated lyrics from a text prompt. */
|
|
590
2161
|
generateLyrics;
|
|
2162
|
+
/** Retrieves word-level timing alignment for a track. Synchronous (run only). */
|
|
591
2163
|
getTimestampedLyrics;
|
|
2164
|
+
/** Re-generates a time range within an existing track with new lyrics and style. */
|
|
592
2165
|
replaceSection;
|
|
2166
|
+
/** Blends two audio tracks into a single new composition. */
|
|
593
2167
|
createMashup;
|
|
2168
|
+
/** Generates sound effects (not music) from a text description with optional looping and BPM control. */
|
|
594
2169
|
textToSound;
|
|
2170
|
+
/** Creates a reusable style or voice persona from a track's vocals. Synchronous (run only). */
|
|
595
2171
|
generatePersona;
|
|
2172
|
+
/** Generates style/genre tags from a text description for use in style fields. Synchronous (run only). */
|
|
596
2173
|
boostStyle;
|
|
2174
|
+
/** Step 1 of voice cloning: extracts a validation phrase from a voice recording. */
|
|
597
2175
|
voiceToValidationPhrase;
|
|
2176
|
+
/** Step 2 (optional) of voice cloning: requests a new, easier validation phrase. */
|
|
598
2177
|
regenerateValidationPhrase;
|
|
2178
|
+
/** Step 3 of voice cloning: trains a custom voice from the user's recording of the validation phrase. */
|
|
599
2179
|
generateVoice;
|
|
2180
|
+
/** Step 4 of voice cloning: checks whether a custom voice is ready for use. Synchronous (run only). */
|
|
600
2181
|
checkVoice;
|
|
601
2182
|
constructor(options = {}) {
|
|
602
|
-
|
|
603
|
-
this.textToMusic = new TextToMusic(http);
|
|
604
|
-
this.extendMusic = new ExtendMusic(http);
|
|
605
|
-
this.generateArtwork = new GenerateArtwork(http);
|
|
606
|
-
this.coverAudio = new CoverAudio(http);
|
|
607
|
-
this.addInstrumental = new AddInstrumental(http);
|
|
608
|
-
this.addVocals = new AddVocals(http);
|
|
609
|
-
this.separateAudioStems = new SeparateAudioStems(http);
|
|
610
|
-
this.generateMidi = new GenerateMidi(http);
|
|
611
|
-
this.convertAudio = new ConvertAudio(http);
|
|
612
|
-
this.visualizeMusic = new VisualizeMusic(http);
|
|
613
|
-
this.generateLyrics = new GenerateLyrics(http);
|
|
614
|
-
this.getTimestampedLyrics = new GetTimestampedLyrics(http);
|
|
615
|
-
this.replaceSection = new ReplaceSection(http);
|
|
616
|
-
this.createMashup = new CreateMashup(http);
|
|
617
|
-
this.textToSound = new TextToSound(http);
|
|
618
|
-
this.generatePersona = new GeneratePersona(http);
|
|
619
|
-
this.boostStyle = new BoostStyle(http);
|
|
620
|
-
this.voiceToValidationPhrase = new VoiceToValidationPhrase(http);
|
|
621
|
-
this.regenerateValidationPhrase = new RegenerateValidationPhrase(http);
|
|
622
|
-
this.generateVoice = new GenerateVoice(http);
|
|
623
|
-
this.checkVoice = new CheckVoice(http);
|
|
2183
|
+
super(options);
|
|
2184
|
+
this.textToMusic = new TextToMusic(this.http);
|
|
2185
|
+
this.extendMusic = new ExtendMusic(this.http);
|
|
2186
|
+
this.generateArtwork = new GenerateArtwork(this.http);
|
|
2187
|
+
this.coverAudio = new CoverAudio(this.http);
|
|
2188
|
+
this.addInstrumental = new AddInstrumental(this.http);
|
|
2189
|
+
this.addVocals = new AddVocals(this.http);
|
|
2190
|
+
this.separateAudioStems = new SeparateAudioStems(this.http);
|
|
2191
|
+
this.generateMidi = new GenerateMidi(this.http);
|
|
2192
|
+
this.convertAudio = new ConvertAudio(this.http);
|
|
2193
|
+
this.visualizeMusic = new VisualizeMusic(this.http);
|
|
2194
|
+
this.generateLyrics = new GenerateLyrics(this.http);
|
|
2195
|
+
this.getTimestampedLyrics = new GetTimestampedLyrics(this.http);
|
|
2196
|
+
this.replaceSection = new ReplaceSection(this.http);
|
|
2197
|
+
this.createMashup = new CreateMashup(this.http);
|
|
2198
|
+
this.textToSound = new TextToSound(this.http);
|
|
2199
|
+
this.generatePersona = new GeneratePersona(this.http);
|
|
2200
|
+
this.boostStyle = new BoostStyle(this.http);
|
|
2201
|
+
this.voiceToValidationPhrase = new VoiceToValidationPhrase(this.http);
|
|
2202
|
+
this.regenerateValidationPhrase = new RegenerateValidationPhrase(this.http);
|
|
2203
|
+
this.generateVoice = new GenerateVoice(this.http);
|
|
2204
|
+
this.checkVoice = new CheckVoice(this.http);
|
|
624
2205
|
}
|
|
625
2206
|
};
|
|
626
2207
|
|
|
@@ -630,7 +2211,7 @@ import {
|
|
|
630
2211
|
AuthenticationError,
|
|
631
2212
|
InsufficientCreditsError,
|
|
632
2213
|
NotFoundError,
|
|
633
|
-
ValidationError,
|
|
2214
|
+
ValidationError as ValidationError2,
|
|
634
2215
|
RateLimitError,
|
|
635
2216
|
ServiceUnavailableError,
|
|
636
2217
|
NetworkError,
|
|
@@ -650,6 +2231,6 @@ export {
|
|
|
650
2231
|
TaskFailedError,
|
|
651
2232
|
TaskTimeoutError,
|
|
652
2233
|
TimeoutError,
|
|
653
|
-
ValidationError
|
|
2234
|
+
ValidationError2 as ValidationError
|
|
654
2235
|
};
|
|
655
2236
|
//# sourceMappingURL=index.mjs.map
|