MCPcopy
hub / github.com/gcui-art/suno-api / generate

Method generate

src/lib/SunoApi.ts:448–469  ·  view source on GitHub ↗

* Generate a song based on the prompt. * @param prompt The text prompt to generate audio from. * @param make_instrumental Indicates if the generated audio should be instrumental. * @param wait_audio Indicates if the method should wait for the audio file to be fully generated before returnin

(
    prompt: string,
    make_instrumental: boolean = false,
    model?: string,
    wait_audio: boolean = false
  )

Source from the content-addressed store, hash-verified

446 * @returns
447 */
448 public async generate(
449 prompt: string,
450 make_instrumental: boolean = false,
451 model?: string,
452 wait_audio: boolean = false
453 ): Promise<AudioInfo[]> {
454 await this.keepAlive(false);
455 const startTime = Date.now();
456 const audios = await this.generateSongs(
457 prompt,
458 false,
459 undefined,
460 undefined,
461 make_instrumental,
462 model,
463 wait_audio
464 );
465 const costTime = Date.now() - startTime;
466 logger.info('Generate Response:\n' + JSON.stringify(audios, null, 2));
467 logger.info('Cost time: ' + costTime);
468 return audios;
469 }
470
471 /**
472 * Calls the concatenate endpoint for a clip to generate the whole song.

Callers 2

POSTFunction · 0.80
POSTFunction · 0.80

Calls 2

keepAliveMethod · 0.95
generateSongsMethod · 0.95

Tested by

no test coverage detected