@runapi.ai/suno 0.2.7 → 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 CHANGED
@@ -1,8 +1,8 @@
1
- # Suno AI API JavaScript SDK for RunAPI
1
+ # Suno API JavaScript SDK for RunAPI
2
2
 
3
- The suno ai api JavaScript SDK is the language-specific package for Suno on RunAPI. Use this suno ai api package for song generation, lyrics, vocal, extension, and audio transformation flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
3
+ The Suno JavaScript SDK is the language-specific package for Suno on RunAPI. Use this package for song generation, lyrics, vocals, extension, and audio transformation workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
4
4
 
5
- This suno ai api README is the JavaScript package guide inside the public `suno-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/suno; for API reference, use https://runapi.ai/docs#suno; for SDK docs, use https://runapi.ai/docs#sdk-suno.
5
+ This README is the JavaScript package guide inside the public `suno-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/suno; for API reference, use https://runapi.ai/docs#suno; for SDK docs, use https://runapi.ai/docs#sdk-suno.
6
6
 
7
7
  ## Install
8
8
 
@@ -16,10 +16,10 @@ npm install @runapi.ai/suno
16
16
  import { SunoClient } from '@runapi.ai/suno';
17
17
 
18
18
  const client = new SunoClient();
19
- const task = await client.generations.create({
19
+ const task = await client.textToMusic.create({
20
20
  // Pass the Suno JSON request body from https://runapi.ai/docs#suno.
21
21
  });
22
- const status = await client.generations.get(task.id);
22
+ const status = await client.textToMusic.get(task.id);
23
23
  ```
24
24
 
25
25
  Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
@@ -28,7 +28,7 @@ RunAPI-generated file URLs are temporary. Download and store generated images, v
28
28
 
29
29
  ## Language notes
30
30
 
31
- Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building music applications. The available resources include generations, extensions, upload and extensions, covers, upload and covers, instrumentals, vocals, vocal removals, midi, wav conversions, music videos, lyrics, timestamped lyrics, section replacements, mashups, sounds, personas, and styles. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
31
+ Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building music applications. The available resources are `textToMusic`, `extendMusic`, `generateArtwork`, `coverAudio`, `addInstrumental`, `addVocals`, `separateAudioStems`, `generateMidi`, `convertAudio`, `visualizeMusic`, `generateLyrics`, `getTimestampedLyrics`, `replaceSection`, `createMashup`, `textToSound`, `generatePersona`, `boostStyle`, `voiceToValidationPhrase`, `regenerateValidationPhrase`, `generateVoice`, and `checkVoice`. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
32
32
 
33
33
  ## Links
34
34
 
package/dist/index.d.mts CHANGED
@@ -226,27 +226,40 @@ interface GetTimestampedLyricsParams {
226
226
  audio_id: string;
227
227
  callback_url?: string;
228
228
  }
229
- /**
230
- * Params for re-generating a time range within an existing track with new lyrics and style.
231
- * `infill_start_time` and `infill_end_time` define the section boundaries in seconds.
232
- */
233
- interface ReplaceSectionParams {
234
- task_id: string;
235
- audio_id: string;
229
+ interface ReplaceSectionBaseParams {
236
230
  /** Replacement lyrics for the specified section. */
237
231
  lyrics: string;
238
232
  /** Style/genre tags for the replacement section. */
239
233
  tags: string;
240
234
  title: string;
241
- /** Section start time in seconds. */
235
+ /** Section start time in seconds. The replacement window must be 6-60 seconds. */
242
236
  infill_start_time: number;
243
- /** Section end time in seconds. */
237
+ /** Section end time in seconds; must be greater than infill_start_time. */
244
238
  infill_end_time: number;
245
239
  callback_url?: string;
246
240
  negative_tags?: string;
247
241
  /** Complete song lyrics for context; helps maintain coherence across sections. */
248
- full_lyrics?: string;
242
+ full_lyrics: string;
249
243
  }
244
+ /** Replace a section using an existing generated audio track. */
245
+ interface ReplaceSectionExistingAudioParams extends ReplaceSectionBaseParams {
246
+ task_id: string;
247
+ audio_id: string;
248
+ upload_url?: never;
249
+ model?: never;
250
+ }
251
+ /** Replace a section using an uploaded source audio file. */
252
+ interface ReplaceSectionUploadedAudioParams extends ReplaceSectionBaseParams {
253
+ upload_url: string;
254
+ model: SunoModel;
255
+ task_id?: never;
256
+ audio_id?: never;
257
+ }
258
+ /**
259
+ * Params for re-generating a time range within a track with new lyrics and style.
260
+ * Provide either `task_id` + `audio_id` for an existing generated track, or `upload_url` + `model` for uploaded audio.
261
+ */
262
+ type ReplaceSectionParams = ReplaceSectionExistingAudioParams | ReplaceSectionUploadedAudioParams;
250
263
  /**
251
264
  * Params for creating a reusable persona from an existing track's vocals.
252
265
  * The persona can be referenced by ID in subsequent generation params. Synchronous -- use `run()` directly.
@@ -1210,4 +1223,4 @@ declare class SunoClient extends BaseClient {
1210
1223
  constructor(options?: ClientOptions);
1211
1224
  }
1212
1225
 
1213
- 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 };
1226
+ 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 ReplaceSectionExistingAudioParams, type ReplaceSectionParams, type ReplaceSectionResponse, type ReplaceSectionUploadedAudioParams, 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 };
package/dist/index.d.ts CHANGED
@@ -226,27 +226,40 @@ interface GetTimestampedLyricsParams {
226
226
  audio_id: string;
227
227
  callback_url?: string;
228
228
  }
229
- /**
230
- * Params for re-generating a time range within an existing track with new lyrics and style.
231
- * `infill_start_time` and `infill_end_time` define the section boundaries in seconds.
232
- */
233
- interface ReplaceSectionParams {
234
- task_id: string;
235
- audio_id: string;
229
+ interface ReplaceSectionBaseParams {
236
230
  /** Replacement lyrics for the specified section. */
237
231
  lyrics: string;
238
232
  /** Style/genre tags for the replacement section. */
239
233
  tags: string;
240
234
  title: string;
241
- /** Section start time in seconds. */
235
+ /** Section start time in seconds. The replacement window must be 6-60 seconds. */
242
236
  infill_start_time: number;
243
- /** Section end time in seconds. */
237
+ /** Section end time in seconds; must be greater than infill_start_time. */
244
238
  infill_end_time: number;
245
239
  callback_url?: string;
246
240
  negative_tags?: string;
247
241
  /** Complete song lyrics for context; helps maintain coherence across sections. */
248
- full_lyrics?: string;
242
+ full_lyrics: string;
249
243
  }
244
+ /** Replace a section using an existing generated audio track. */
245
+ interface ReplaceSectionExistingAudioParams extends ReplaceSectionBaseParams {
246
+ task_id: string;
247
+ audio_id: string;
248
+ upload_url?: never;
249
+ model?: never;
250
+ }
251
+ /** Replace a section using an uploaded source audio file. */
252
+ interface ReplaceSectionUploadedAudioParams extends ReplaceSectionBaseParams {
253
+ upload_url: string;
254
+ model: SunoModel;
255
+ task_id?: never;
256
+ audio_id?: never;
257
+ }
258
+ /**
259
+ * Params for re-generating a time range within a track with new lyrics and style.
260
+ * Provide either `task_id` + `audio_id` for an existing generated track, or `upload_url` + `model` for uploaded audio.
261
+ */
262
+ type ReplaceSectionParams = ReplaceSectionExistingAudioParams | ReplaceSectionUploadedAudioParams;
250
263
  /**
251
264
  * Params for creating a reusable persona from an existing track's vocals.
252
265
  * The persona can be referenced by ID in subsequent generation params. Synchronous -- use `run()` directly.
@@ -1210,4 +1223,4 @@ declare class SunoClient extends BaseClient {
1210
1223
  constructor(options?: ClientOptions);
1211
1224
  }
1212
1225
 
1213
- 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 };
1226
+ 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 ReplaceSectionExistingAudioParams, type ReplaceSectionParams, type ReplaceSectionResponse, type ReplaceSectionUploadedAudioParams, 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 };