@runapi.ai/suno 0.2.4 → 0.2.6

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.d.mts CHANGED
@@ -1,13 +1,17 @@
1
1
  import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- type SunoModel = 'suno-v5.5' | 'suno-v5' | 'suno-v4.5-plus' | 'suno-v4.5-all' | 'suno-v4.5' | 'suno-v4' | 'suno-v3.5';
4
+ type SunoModel = 'suno-v5.5' | 'suno-v5' | 'suno-v4.5-plus' | 'suno-v4.5-all' | 'suno-v4.5' | 'suno-v4';
5
5
  type SoundModel = 'suno-v5' | 'suno-v5.5';
6
+ type ValidationPhraseLanguage = 'en' | 'zh' | 'es' | 'fr' | 'pt' | 'de' | 'ja' | 'ko' | 'hi' | 'ru';
6
7
  type SoundKey = 'Cm' | 'C#m' | 'Dm' | 'D#m' | 'Em' | 'Fm' | 'F#m' | 'Gm' | 'G#m' | 'Am' | 'A#m' | 'Bm' | 'C' | 'C#' | 'D' | 'D#' | 'E' | 'F' | 'F#' | 'G' | 'G#' | 'A' | 'A#' | 'B';
7
- type VocalGender = 'm' | 'f';
8
- type PersonaModel = 'style_persona' | 'voice_persona';
8
+ type VocalGender = 'male' | 'female';
9
+ type PersonaType = 'style' | 'voice';
10
+ type ParameterMode = 'source' | 'custom';
11
+ type VocalMode = 'auto_lyrics' | 'exact_lyrics' | 'instrumental';
9
12
  type TaskStatus = AsyncTaskStatus;
10
13
  type GenerationStage = 'text_generated' | 'first_audio_ready' | 'all_audios_ready' | 'failed';
14
+ type SingerSkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'professional';
11
15
  interface SunoBaseParams {
12
16
  callback_url?: string;
13
17
  model?: SunoModel;
@@ -16,38 +20,54 @@ interface SunoBaseParams {
16
20
  weirdness_constraint?: number;
17
21
  audio_weight?: number;
18
22
  }
19
- interface TextToMusicSimpleParams extends SunoBaseParams {
20
- custom_mode: false;
21
- instrumental: boolean;
23
+ interface TextToMusicPromptParams extends SunoBaseParams {
24
+ vocal_mode: 'auto_lyrics';
22
25
  prompt: string;
26
+ lyrics?: never;
27
+ style?: never;
28
+ title?: never;
29
+ }
30
+ interface TextToMusicLyricsParams extends SunoBaseParams {
31
+ vocal_mode: 'exact_lyrics';
32
+ prompt?: never;
33
+ lyrics: string;
34
+ style: string;
35
+ title: string;
36
+ persona_id?: string;
37
+ persona_type?: PersonaType;
38
+ negative_tags?: string;
39
+ duration_seconds?: number;
40
+ continue_at?: number;
41
+ endpoint?: string;
23
42
  }
24
- interface TextToMusicCustomParams extends SunoBaseParams {
25
- custom_mode: true;
26
- instrumental: boolean;
43
+ interface TextToMusicInstrumentalParams extends SunoBaseParams {
44
+ vocal_mode: 'instrumental';
45
+ prompt?: never;
46
+ lyrics?: never;
27
47
  style: string;
28
48
  title: string;
29
- prompt?: string;
30
49
  persona_id?: string;
31
- persona_model?: PersonaModel;
50
+ persona_type?: PersonaType;
32
51
  negative_tags?: string;
33
- duration?: number;
52
+ duration_seconds?: number;
34
53
  continue_at?: number;
35
54
  endpoint?: string;
36
55
  }
37
- type TextToMusicParams = TextToMusicSimpleParams | TextToMusicCustomParams;
56
+ type TextToMusicParams = TextToMusicPromptParams | TextToMusicLyricsParams | TextToMusicInstrumentalParams;
38
57
  interface ExtendMusicParams extends SunoBaseParams {
39
58
  task_id?: string;
40
59
  audio_id?: string;
41
60
  audio_url?: string;
42
61
  upload_url?: string;
43
- default_param_flag?: boolean;
62
+ parameter_mode: ParameterMode;
44
63
  instrumental?: boolean;
45
64
  prompt?: string;
65
+ lyrics?: string;
46
66
  style?: string;
47
67
  title?: string;
48
68
  continue_at?: number;
49
69
  persona_id?: string;
50
- persona_model?: PersonaModel;
70
+ persona_type?: PersonaType;
51
71
  model?: SunoModel;
52
72
  negative_tags?: string;
53
73
  }
@@ -56,25 +76,38 @@ interface GenerateArtworkParams {
56
76
  callback_url?: string;
57
77
  [key: string]: unknown;
58
78
  }
59
- interface CoverAudioSimpleParams extends SunoBaseParams {
79
+ interface CoverAudioPromptParams extends SunoBaseParams {
60
80
  upload_url: string;
61
- custom_mode: false;
62
- instrumental: boolean;
81
+ vocal_mode: 'auto_lyrics';
63
82
  prompt: string;
83
+ lyrics?: never;
84
+ style?: never;
85
+ title?: never;
64
86
  negative_tags?: string;
65
87
  }
66
- interface CoverAudioCustomParams extends SunoBaseParams {
88
+ interface CoverAudioLyricsParams extends SunoBaseParams {
67
89
  upload_url: string;
68
- custom_mode: true;
69
- instrumental: boolean;
90
+ vocal_mode: 'exact_lyrics';
91
+ prompt?: never;
92
+ lyrics: string;
70
93
  style: string;
71
94
  title: string;
72
- prompt?: string;
73
95
  persona_id?: string;
74
- persona_model?: PersonaModel;
96
+ persona_type?: PersonaType;
75
97
  negative_tags?: string;
76
98
  }
77
- type CoverAudioParams = CoverAudioSimpleParams | CoverAudioCustomParams;
99
+ interface CoverAudioInstrumentalParams extends SunoBaseParams {
100
+ upload_url: string;
101
+ vocal_mode: 'instrumental';
102
+ prompt?: never;
103
+ lyrics?: never;
104
+ style: string;
105
+ title: string;
106
+ persona_id?: string;
107
+ persona_type?: PersonaType;
108
+ negative_tags?: string;
109
+ }
110
+ type CoverAudioParams = CoverAudioPromptParams | CoverAudioLyricsParams | CoverAudioInstrumentalParams;
78
111
  interface AddInstrumentalParams extends SunoBaseParams {
79
112
  model?: SunoModel;
80
113
  upload_url: string;
@@ -85,7 +118,7 @@ interface AddInstrumentalParams extends SunoBaseParams {
85
118
  interface AddVocalsParams extends SunoBaseParams {
86
119
  model?: SunoModel;
87
120
  upload_url: string;
88
- prompt: string;
121
+ lyrics: string;
89
122
  title: string;
90
123
  negative_tags: string;
91
124
  style: string;
@@ -125,7 +158,7 @@ interface GetTimestampedLyricsParams {
125
158
  interface ReplaceSectionParams {
126
159
  task_id: string;
127
160
  audio_id: string;
128
- prompt: string;
161
+ lyrics: string;
129
162
  tags: string;
130
163
  title: string;
131
164
  infill_start_time: number;
@@ -153,29 +186,79 @@ interface TextToSoundParams {
153
186
  sound_key?: SoundKey;
154
187
  grab_lyrics?: boolean;
155
188
  }
156
- interface CreateMashupSimpleParams extends SunoBaseParams {
189
+ interface VoiceToValidationPhraseParams {
190
+ voice_url: string;
191
+ vocal_start_seconds: number;
192
+ vocal_end_seconds: number;
193
+ language?: ValidationPhraseLanguage;
194
+ callback_url?: string;
195
+ }
196
+ interface RegenerateValidationPhraseParams {
197
+ task_id: string;
198
+ callback_url?: string;
199
+ }
200
+ interface GenerateVoiceParams {
201
+ task_id: string;
202
+ verify_url: string;
203
+ voice_name?: string;
204
+ description?: string;
205
+ style?: string;
206
+ singer_skill_level?: SingerSkillLevel;
207
+ callback_url?: string;
208
+ }
209
+ interface CheckVoiceParams {
210
+ task_id: string;
211
+ }
212
+ interface CreateMashupPromptParams extends SunoBaseParams {
157
213
  upload_url_list: [string, string];
158
- custom_mode: false;
159
214
  model?: SunoModel;
215
+ vocal_mode: 'auto_lyrics';
160
216
  prompt: string;
161
- instrumental?: boolean;
217
+ lyrics?: never;
218
+ style?: never;
219
+ title?: never;
162
220
  }
163
- interface CreateMashupCustomParams extends SunoBaseParams {
221
+ interface CreateMashupLyricsParams extends SunoBaseParams {
164
222
  upload_url_list: [string, string];
165
- custom_mode: true;
166
223
  model?: SunoModel;
224
+ vocal_mode: 'exact_lyrics';
225
+ prompt?: never;
226
+ lyrics: string;
167
227
  style: string;
168
228
  title: string;
169
- prompt?: string;
170
- instrumental?: boolean;
229
+ persona_id?: string;
230
+ persona_type?: PersonaType;
231
+ }
232
+ interface CreateMashupInstrumentalParams extends SunoBaseParams {
233
+ upload_url_list: [string, string];
234
+ model?: SunoModel;
235
+ vocal_mode: 'instrumental';
236
+ prompt?: never;
237
+ lyrics?: never;
238
+ style: string;
239
+ title: string;
240
+ persona_id?: string;
241
+ persona_type?: PersonaType;
171
242
  }
172
- type CreateMashupParams = CreateMashupSimpleParams | CreateMashupCustomParams;
243
+ type CreateMashupParams = CreateMashupPromptParams | CreateMashupLyricsParams | CreateMashupInstrumentalParams;
173
244
  interface TaskCreateResponse {
174
245
  id: string;
175
246
  status?: string;
176
247
  [key: string]: unknown;
177
248
  }
178
249
  interface Audio {
250
+ id: string;
251
+ audio_url?: string;
252
+ stream_audio_url?: string;
253
+ image_url?: string;
254
+ lyrics?: string;
255
+ model_name?: string;
256
+ title?: string;
257
+ tags?: string[];
258
+ duration?: number;
259
+ [key: string]: unknown;
260
+ }
261
+ interface SoundAudio {
179
262
  id: string;
180
263
  audio_url?: string;
181
264
  stream_audio_url?: string;
@@ -213,7 +296,8 @@ interface AddInstrumentalResponse extends TextToMusicResponse {
213
296
  }
214
297
  interface AddVocalsResponse extends TextToMusicResponse {
215
298
  }
216
- interface TextToSoundResponse extends TextToMusicResponse {
299
+ interface TextToSoundResponse extends AsyncTaskResponse {
300
+ audios?: SoundAudio[];
217
301
  }
218
302
  interface SeparatedAudio {
219
303
  vocal_url?: string;
@@ -297,6 +381,19 @@ interface BoostStyleResponse {
297
381
  interface CreateMashupResponse extends AsyncTaskResponse {
298
382
  audios?: Audio[];
299
383
  }
384
+ interface ValidationPhraseResponse extends AsyncTaskResponse {
385
+ provider_status?: string;
386
+ validation_phrase?: string;
387
+ }
388
+ interface VoiceGenerationResponse extends AsyncTaskResponse {
389
+ provider_status?: string;
390
+ voice_id?: string;
391
+ }
392
+ interface CheckVoiceResponse {
393
+ is_available?: boolean;
394
+ error?: string;
395
+ [key: string]: unknown;
396
+ }
300
397
  type CompletedTextToMusicResponse = TextToMusicResponse & {
301
398
  status: 'completed';
302
399
  audios: Audio[];
@@ -356,7 +453,15 @@ type CompletedCreateMashupResponse = CreateMashupResponse & {
356
453
  };
357
454
  type CompletedTextToSoundResponse = TextToSoundResponse & {
358
455
  status: 'completed';
359
- audios: Audio[];
456
+ audios: SoundAudio[];
457
+ };
458
+ type CompletedValidationPhraseResponse = ValidationPhraseResponse & {
459
+ status: 'completed';
460
+ validation_phrase: string;
461
+ };
462
+ type CompletedVoiceGenerationResponse = VoiceGenerationResponse & {
463
+ status: 'completed';
464
+ voice_id: string;
360
465
  };
361
466
 
362
467
  declare class TextToMusic {
@@ -489,6 +594,36 @@ declare class BoostStyle {
489
594
  run(params: BoostStyleParams, options?: RequestOptions): Promise<BoostStyleResponse>;
490
595
  }
491
596
 
597
+ declare class VoiceToValidationPhrase {
598
+ private readonly http;
599
+ constructor(http: HttpClient);
600
+ run(params: VoiceToValidationPhraseParams, options?: RequestOptions & PollingOptions): Promise<CompletedValidationPhraseResponse>;
601
+ create(params: VoiceToValidationPhraseParams, options?: RequestOptions): Promise<TaskCreateResponse>;
602
+ get(id: string, options?: RequestOptions): Promise<ValidationPhraseResponse>;
603
+ }
604
+
605
+ declare class RegenerateValidationPhrase {
606
+ private readonly http;
607
+ constructor(http: HttpClient);
608
+ run(params: RegenerateValidationPhraseParams, options?: RequestOptions & PollingOptions): Promise<CompletedValidationPhraseResponse>;
609
+ create(params: RegenerateValidationPhraseParams, options?: RequestOptions): Promise<TaskCreateResponse>;
610
+ get(id: string, options?: RequestOptions): Promise<ValidationPhraseResponse>;
611
+ }
612
+
613
+ declare class GenerateVoice {
614
+ private readonly http;
615
+ constructor(http: HttpClient);
616
+ run(params: GenerateVoiceParams, options?: RequestOptions & PollingOptions): Promise<CompletedVoiceGenerationResponse>;
617
+ create(params: GenerateVoiceParams, options?: RequestOptions): Promise<TaskCreateResponse>;
618
+ get(id: string, options?: RequestOptions): Promise<VoiceGenerationResponse>;
619
+ }
620
+
621
+ declare class CheckVoice {
622
+ private readonly http;
623
+ constructor(http: HttpClient);
624
+ run(params: CheckVoiceParams, options?: RequestOptions): Promise<CheckVoiceResponse>;
625
+ }
626
+
492
627
  /**
493
628
  * Suno API client.
494
629
  *
@@ -500,8 +635,6 @@ declare class BoostStyle {
500
635
  * });
501
636
  *
502
637
  * const result = await client.textToMusic.run({
503
- * custom_mode: false,
504
- * instrumental: false,
505
638
  * prompt: 'A chill lo-fi beat with soft vocals',
506
639
  * model: 'suno-v4.5-plus',
507
640
  * });
@@ -525,7 +658,11 @@ declare class SunoClient {
525
658
  readonly textToSound: TextToSound;
526
659
  readonly generatePersona: GeneratePersona;
527
660
  readonly boostStyle: BoostStyle;
661
+ readonly voiceToValidationPhrase: VoiceToValidationPhrase;
662
+ readonly regenerateValidationPhrase: RegenerateValidationPhrase;
663
+ readonly generateVoice: GenerateVoice;
664
+ readonly checkVoice: CheckVoice;
528
665
  constructor(options?: ClientOptions);
529
666
  }
530
667
 
531
- export { type AddInstrumentalParams, type AddInstrumentalResponse, type AddVocalsParams, type AddVocalsResponse, type AlignedWord, type AsyncTaskResponse, type Audio, type BoostStyleParams, type BoostStyleResponse, type CompletedAddInstrumentalResponse, type CompletedAddVocalsResponse, type CompletedConvertAudioResponse, type CompletedCoverAudioResponse, type CompletedCreateMashupResponse, type CompletedExtendMusicResponse, type CompletedGenerateArtworkResponse, type CompletedGenerateLyricsResponse, type CompletedGenerateMidiResponse, type CompletedReplaceSectionResponse, type CompletedSeparateAudioStemsResponse, type CompletedTextToMusicResponse, type CompletedTextToSoundResponse, type CompletedVisualizeMusicResponse, type ConvertAudioParams, type ConvertAudioResponse, type CoverAudioCustomParams, type CoverAudioParams, type CoverAudioResponse, type CoverAudioSimpleParams, type CreateMashupCustomParams, type CreateMashupParams, type CreateMashupResponse, type CreateMashupSimpleParams, type ExtendMusicParams, type ExtendMusicResponse, type GenerateArtworkParams, type GenerateArtworkResponse, type GenerateLyricsParams, type GenerateLyricsResponse, type GenerateMidiParams, type GenerateMidiResponse, type GeneratePersonaParams, type GeneratePersonaResponse, type GenerationStage, type GetTimestampedLyricsParams, type GetTimestampedLyricsResponse, type MidiInstrument, type MidiNote, type Persona, type PersonaModel, type ReplaceSectionParams, type ReplaceSectionResponse, type SeparateAudioStemsParams, type SeparateAudioStemsResponse, type SeparatedAudio, type SoundKey, type SoundModel, type SunoBaseParams, SunoClient, type SunoModel, type TaskCreateResponse, type TaskStatus, type TextToMusicCustomParams, type TextToMusicParams, type TextToMusicResponse, type TextToMusicSimpleParams, type TextToSoundParams, type TextToSoundResponse, type VisualizeMusicParams, type VisualizeMusicResponse, type VocalGender };
668
+ export { type AddInstrumentalParams, type AddInstrumentalResponse, type AddVocalsParams, type AddVocalsResponse, type AlignedWord, type AsyncTaskResponse, type Audio, type BoostStyleParams, type BoostStyleResponse, type CheckVoiceParams, type CheckVoiceResponse, type CompletedAddInstrumentalResponse, type CompletedAddVocalsResponse, type CompletedConvertAudioResponse, type CompletedCoverAudioResponse, type CompletedCreateMashupResponse, type CompletedExtendMusicResponse, type CompletedGenerateArtworkResponse, type CompletedGenerateLyricsResponse, type CompletedGenerateMidiResponse, type CompletedReplaceSectionResponse, type CompletedSeparateAudioStemsResponse, type CompletedTextToMusicResponse, type CompletedTextToSoundResponse, type CompletedValidationPhraseResponse, type CompletedVisualizeMusicResponse, type CompletedVoiceGenerationResponse, type ConvertAudioParams, type ConvertAudioResponse, type CoverAudioInstrumentalParams, type CoverAudioLyricsParams, type CoverAudioParams, type CoverAudioPromptParams, type CoverAudioResponse, type CreateMashupInstrumentalParams, type CreateMashupLyricsParams, type CreateMashupParams, type CreateMashupPromptParams, type CreateMashupResponse, type ExtendMusicParams, type ExtendMusicResponse, type GenerateArtworkParams, type GenerateArtworkResponse, type GenerateLyricsParams, type GenerateLyricsResponse, type GenerateMidiParams, type GenerateMidiResponse, type GeneratePersonaParams, type GeneratePersonaResponse, type GenerateVoiceParams, type GenerationStage, type GetTimestampedLyricsParams, type GetTimestampedLyricsResponse, type MidiInstrument, type MidiNote, type ParameterMode, type Persona, type PersonaType, type RegenerateValidationPhraseParams, type ReplaceSectionParams, type ReplaceSectionResponse, type SeparateAudioStemsParams, type SeparateAudioStemsResponse, type SeparatedAudio, type SingerSkillLevel, type SoundAudio, type SoundKey, type SoundModel, type SunoBaseParams, SunoClient, type SunoModel, type TaskCreateResponse, type TaskStatus, type TextToMusicInstrumentalParams, type TextToMusicLyricsParams, type TextToMusicParams, type TextToMusicPromptParams, type TextToMusicResponse, type TextToSoundParams, type TextToSoundResponse, type ValidationPhraseLanguage, type ValidationPhraseResponse, type VisualizeMusicParams, type VisualizeMusicResponse, type VocalGender, type VocalMode, type VoiceGenerationResponse, type VoiceToValidationPhraseParams };