File size: 21,013 Bytes
dfe72e0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 |
{
"openapi": "3.0.3",
"info": {
"title": "suno-api",
"description": "Use API to call the music generation service of Suno.ai and easily integrate it into agents like GPTs.",
"version": "1.1.0"
},
"tags": [
{
"name": "default"
}
],
"paths": {
"/api/generate": {
"post": {
"summary": "Generate audio based on Prompt.",
"description": "It will automatically fill in the lyrics.\n\n2 audio files will be generated for each request, consuming a total of 10 credits.\n\n`wait_audio` can be set to API mode:\n\n\u2022 By default, it is set to `false`, which indicates the background mode. It will only return audio task information, and you will need to call the get API to retrieve detailed audio information.\n\n\u2022 If set to `true`, it simulates synchronous mode. The API will wait for a maximum of 100s until the audio is generated, and will directly return the audio link and other information. Recommend using in GPTs and other agents.",
"tags": ["default"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["prompt", "make_instrumental", "wait_audio"],
"properties": {
"prompt": {
"type": "string",
"description": "Prompt",
"example": "A popular heavy metal song about war, sung by a deep-voiced male singer, slowly and melodiously. The lyrics depict the sorrow of people after the war."
},
"make_instrumental": {
"type": "boolean",
"description": "Whether to generate instrumental music",
"example": "false"
},
"model": {
"type": "string",
"description": "Model name ,default is chirp-v3-5",
"example": "chirp-v3-5|chirp-v3-0"
},
"wait_audio": {
"type": "boolean",
"description": "Whether to wait for music generation, default is false, directly return audio task information; set to true, will wait for up to 100s until the audio is generated.",
"example": "false"
}
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": ["0", "1"],
"properties": [
{
"$ref": "#/components/schemas/audio_info"
},
{
"$ref": "#/components/schemas/audio_info"
}
]
}
}
}
}
}
}
}
},
"/v1/chat/completions": {
"post": {
"summary": "Generate audio based on Prompt - OpenAI API format compatibility.",
"description": "Convert the `/api/generate` API to be compatible with the OpenAI `/v1/chat/completions` API format. \n\nGenerally used in OpenAI compatible clients.",
"tags": ["default"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {
"type": "string",
"description": "Prompt",
"example": "A popular heavy metal song about war, sung by a deep-voiced male singer, slowly and melodiously. The lyrics depict the sorrow of people after the war."
}
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "Text description for music, with details like title, album cover, lyrics, and more."
}
}
}
}
}
}
}
}
},
"/api/custom_generate": {
"post": {
"summary": "Generate Audio - Custom Mode",
"description": "The custom mode enables users to provide additional details about the music, such as music genre, lyrics, and more.\n\n 2 audio files will be generated for each request, consuming a total of 10 credits. \n\n `wait_audio` can be set to API mode:\n\n\u2022 By default, it is set to false, which indicates the background mode. It will only return audio task information, and you will need to call the get API to retrieve detailed audio information.\n\n\u2022 If set to true, it simulates synchronous mode. The API will wait for a maximum of 100s until the audio is generated, and will directly return the audio link and other information. Recommend using in GPTs and other agents.",
"tags": ["default"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["prompt", "tags", "title"],
"properties": {
"prompt": {
"type": "string",
"description": "Detailed prompt, including information such as music lyrics.",
"example": "[Verse 1]\nCruel flames of war engulf this land\nBattlefields filled with death and dread\nInnocent souls in darkness, they rest\nMy heart trembles in this silent test\n\n[Verse 2]\nPeople weep for loved ones lost\nBattered bodies bear the cost\nSeeking peace and hope once known\nOur grief transforms to hearts of stone\n\n[Chorus]\nSilent battlegrounds, no birds' song\nShadows of war, where we don't belong\nMay flowers of peace bloom in this place\nLet's guard this precious dream with grace\n\n[Bridge]\nThrough the ashes, we will rise\nHand in hand, towards peaceful skies\nNo more sorrow, no more pain\nTogether, we'll break these chains\n\n[Chorus]\nSilent battlegrounds, no birds' song\nShadows of war, where we don't belong\nMay flowers of peace bloom in this place\nLet's guard this precious dream with grace\n\n[Outro]\nIn unity, our strength will grow\nA brighter future, we'll soon know\nFrom the ruins, hope will spring\nA new dawn, we'll together bring"
},
"tags": {
"type": "string",
"description": "Music genre",
"example": "pop metal male melancholic"
},
"title": {
"type": "string",
"description": "Music title",
"example": "Silent Battlefield"
},
"make_instrumental": {
"type": "boolean",
"description": "Whether to generate instrumental music",
"example": "false"
},
"model": {
"type": "string",
"description": "Model name ,default is chirp-v3-5",
"example": "chirp-v3-5|chirp-v3-0"
},
"wait_audio": {
"type": "boolean",
"description": "Whether to wait for music generation, default is false, directly return audio task information; set to true, will wait for up to 100s until the audio is generated.",
"example": "false"
}
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": ["0", "1"],
"properties": [
{
"$ref": "#/components/schemas/audio_info"
},
{
"$ref": "#/components/schemas/audio_info"
}
]
}
}
}
}
}
}
}
},
"/api/extend_audio": {
"post": {
"summary": "Extend audio length.",
"description": "Extend audio length.",
"tags": ["default"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["audio_id"],
"properties": {
"audio_id": {
"type": "string",
"description": "The ID of the audio clip to extend.",
"example": "e76498dc-6ab4-4a10-a19f-8a095790e28d"
},
"prompt": {
"type": "string",
"description": "Detailed prompt, including information such as music lyrics.",
"example": "[lrc]Silent battlegrounds, no birds' song\nShadows of war, where we don't belong\nMay flowers of peace bloom in this place\nLet's guard this precious dream with grace\n[endlrc]"
},
"continue_at": {
"type": "string",
"description": "Extend a new clip from a song at mm:ss(e.g. 00:30). Default extends from the end of the song.",
"example": "109.96"
},
"title": {
"type": "string",
"description": "Music title",
"example": ""
},
"tags": {
"type": "string",
"description": "Music genre",
"example": ""
},
"model": {
"type": "string",
"description": "Model name ,default is chirp-v3-5",
"example": "chirp-v3-5|chirp-v3-0"
}
}
}
}
}
}
}
},
"/api/generate_lyrics": {
"post": {
"summary": "Generate lyrics based on Prompt.",
"description": "Generate lyrics based on Prompt.",
"tags": ["default"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {
"type": "string",
"description": "Prompt",
"example": "A soothing lullaby"
}
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Lyrics"
},
"title": {
"type": "string",
"description": "music title"
},
"status": {
"type": "string",
"description": "Status"
}
}
}
}
}
}
}
}
},
"/api/get": {
"get": {
"summary": "Get audio information",
"description": "",
"tags": ["default"],
"parameters": [
{
"in": "query",
"name": "ids",
"description": "Audio IDs, separated by commas. Leave blank to return a list of all music.",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": ["0", "1"],
"properties": [
{
"$ref": "#/components/schemas/audio_info"
},
{
"$ref": "#/components/schemas/audio_info"
}
]
}
}
}
}
}
}
}
},
"/api/get_limit": {
"get": {
"summary": "Get quota information.",
"description": "",
"tags": ["default"],
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"credits_left",
"period",
"monthly_limit",
"monthly_usage"
],
"properties": {
"credits_left": {
"type": "number",
"description": "Remaining credits,Each generated audio consumes 5 credits."
},
"period": {
"type": "string",
"description": "Period"
},
"monthly_limit": {
"type": "number",
"description": "Monthly limit"
},
"monthly_usage": {
"type": "number",
"description": "Monthly usage"
}
}
}
}
}
}
}
}
},
"/api/clip": {
"get": {
"summary": "Get clip information based on ID.",
"description": "Retrieve specific clip information using the provided clip ID as a query parameter.",
"tags": ["default"],
"parameters": [
{
"name": "id",
"in": "query",
"required": true,
"description": "Clip ID",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/audio_info"
}
}
}
},
"400": {
"description": "Missing parameter id",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Missing parameter id"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Internal server error"
}
}
}
}
}
}
}
}
},
"/api/concat": {
"post": {
"summary": "Generate the whole song from extensions.",
"description": "Concatenate audio clips to generate a complete song using the provided clip ID.",
"tags": ["default"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["clip_id"],
"properties": {
"clip_id": {
"type": "string",
"description": "Clip ID"
}
}
}
}
}
},
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/audio_info"
}
}
}
},
"400": {
"description": "Clip id is required",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Clip id is required"
}
}
}
}
}
},
"402": {
"description": "Payment required",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Payment required"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Internal server error"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"audio_info": {
"type": "object",
"required": [
"id",
"title",
"image_url",
"lyric",
"audio_url",
"video_url",
"created_at",
"model_name",
"status",
"gpt_description_prompt",
"prompt",
"type",
"tags"
],
"properties": {
"id": {
"type": "string",
"description": "audio id"
},
"title": {
"type": "string",
"description": "music title"
},
"image_url": {
"type": "string",
"description": "music cover image"
},
"lyric": {
"type": "string",
"description": "music lyric"
},
"audio_url": {
"type": "string",
"description": "music download url"
},
"video_url": {
"type": "string",
"description": "Music video download link, can be used to share"
},
"created_at": {
"type": "string",
"description": "Create time"
},
"model_name": {
"type": "string",
"description": "suno model name, chirp-v3"
},
"status": {
"type": "string",
"description": "The generated states include submitted, queue, streaming, complete."
},
"gpt_description_prompt": {
"type": "string",
"description": "Simple mode on user input prompt, Suno will generate formal prompts, lyrics, etc."
},
"prompt": {
"type": "string",
"description": "The final prompt for executing the generation task, customized by the user in custom mode, automatically generated by Suno in simple mode."
},
"type": {
"type": "string",
"description": "Type"
},
"tags": {
"type": "string",
"description": "Music genre. User-provided in custom mode, automatically generated by Suno in simple mode."
}
},
"title": "audio_info",
"description": "Audio Info"
}
}
}
}
|