跳到正文
API 参考
API 参考

Suno Extend-Music

以异步 Task 提交Extend Music请求。

01

概览

使用支持的模型提交Extend Music请求。使用返回的 Task ID 查询状态,或提供 callback_url 接收下方列出的投递。

快速开始

  1. 创建 API Key,并将其设置为 RUNAPI_API_KEY。
  2. 选择一个支持的模型,并发送与该模型 Schema 匹配的 POST 请求。
  3. 保存返回的任务 ID,随后轮询到终态,或处理下方列出的回调。

端点

POST /api/v1/suno/extend_music
基础 URL
https://runapi.ai
API 版本
v1
身份验证
Authorization: Bearer YOUR_API_TOKEN
02

支持的模型

打开模型页可查看当前价格、限流和商业使用详情。

03

请求 Schema

JSON 请求体

字段和允许的取值取决于所选模型。提供 callback_url 后,它会收到下方列出的 Task 投递。

suno-v420 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v4.520 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v4.5-all20 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v4.5-plus20 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v520 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v5.520 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v620 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v6-mini20 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
suno-v6-wild20 个字段
audio_idstring
可选

Source audio ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_urlstring
可选

Source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

audio_weightnumber
可选

Audio weight (0-1).

范围: 0 - 1
callback_urlstring
可选

Webhook URL for async notifications.

continue_atnumber
可选

Seconds into the source to continue from. Required in custom parameter mode.

instrumentalboolean
可选

When true, generate without vocals.

lyricsstring
可选

Exact lyrics. Only allowed when extending uploaded audio in custom parameter mode.

边界: 5000
modelstring
必填

Model slug.

negative_tagsstring
可选

Styles to avoid.

parameter_modestring
必填

Inherit the source track's parameters (source) or supply custom ones (custom).

可选值: source, custom
persona_idstring
可选

Persona ID.

persona_typestring
可选

Persona type.

可选值: style, voice
promptstring
可选

Extension brief. Cannot be combined with lyrics.

边界: 5000
stylestring
可选

Style preset. Required in custom parameter mode.

边界: 1000
style_weightnumber
可选

Style adherence weight (0-1).

范围: 0 - 1
task_idstring
可选

Source task ID to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

titlestring
可选

Song title. Required in custom parameter mode.

边界: 80
upload_urlstring
可选

Uploaded source audio URL to extend. Provide one of task_id, audio_id, audio_url, or upload_url.

vocal_genderstring
可选

Vocal gender.

可选值: male, female
weirdness_constraintnumber
可选

Weirdness constraint (0-1).

范围: 0 - 1
04

创建已接受

HTTP 202

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
05

轮询处理中

HTTP 200

GET /api/v1/suno/extend_music/:id

响应 Schema
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "generation_stage": "text_generated",
  "id": "tsk_reference_demo",
  "status": "processing"
}
06

轮询已完成

HTTP 200

GET /api/v1/suno/extend_music/:id

响应 Schema
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready",
        "all_audios_ready",
        "failed"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "audios": [
    {
      "audio_url": "https://file.runapi.ai/reference-audio.mp3",
      "id": "audio_reference"
    }
  ],
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed"
}
07

轮询失败

HTTP 200

GET /api/v1/suno/extend_music/:id

响应 Schema
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
08

客户回调:处理中

HTTP 200

POST callback_url

响应 Schema
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "generation_stage": "text_generated",
  "id": "tsk_reference_demo",
  "status": "processing"
}
09

客户回调:已完成

HTTP 200

POST callback_url

响应 Schema
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready",
        "all_audios_ready",
        "failed"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "audios": [
    {
      "audio_url": "https://file.runapi.ai/reference-audio.mp3",
      "id": "audio_reference"
    }
  ],
  "id": "tsk_reference_demo",
  "status": "completed"
}
10

客户回调:失败

HTTP 200

POST callback_url

响应 Schema
JSON
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
11

错误

HTTP 401

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Authentication required"
}
12

错误

HTTP 401

GET /api/v1/suno/extend_music/:id

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Authentication required"
}
13

错误

HTTP 400

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Human-readable error message.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Human-readable validation summary.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Validation messages keyed by public request field, with an array of human-readable strings for each field.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

响应示例

JSON
{
  "error": "model must be one of: suno-v4, suno-v4.5, suno-v4.5-all, suno-v4.5-plus, suno-v5, suno-v5.5, suno-v6, suno-v6-mini, suno-v6-wild"
}
14

错误

HTTP 402

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Insufficient balance"
}
15

错误

HTTP 429

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "API key credit limit exceeded"
}
16

错误

HTTP 409

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "The request uses features that are not supported for the selected model"
}
17

错误

HTTP 429

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Rate limit reached. Please retry later."
}
18

错误

HTTP 503

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Service under maintenance, please try again later"
}
19

错误

HTTP 504

POST /api/v1/suno/extend_music

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "The request timed out"
}
20

错误

HTTP 404

GET /api/v1/suno/extend_music/:id

响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
21

生成的代码示例

直接使用 cURL,或安装所用语言的 SDK。每个示例都会提交本参考中经过验证的请求。

安装

Shell
pip install runapi-suno
PYTHON
import os
from runapi.suno import SunoClient

client = SunoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.extend_music.create(
  model="suno-v5",
  upload_url="https://cdn.runapi.ai/public/samples/music.mp3",
  parameter_mode="custom",
  instrumental=False,
  prompt="Continue the arrangement with a brighter chorus.",
  style="Acoustic pop with warm piano.",
  title="Brighter Chorus",
  continue_at=60,
  persona_id="persona_reference",
  persona_type="style"
)