> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 上传音频并延伸

> 上传公网音频 URL，并从指定位置使用 Suno V6 延伸歌曲

<Info>
  本接口直接延伸公开音频 URL，无需先调用 `uploadTask`。接口固定使用自定义模式，不要发送 `custom`、`instrumental` 或 `gpt_description`。
</Info>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/music/generations/uploadExtend \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "suno",
      "version": "v6-mini",
      "audio_url": "https://example.com/reference.wav",
      "continue_at": 30,
      "prompt": "[Outro]\n下一段旅途，我们一起走",
      "tags": "acoustic pop",
      "duration_s": 60,
      "max_mode": true,
      "audio_format": "mp3"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.apimart.ai/v1/music/generations/uploadExtend",
      headers={"Authorization": "Bearer <token>"},
      json={
          "model": "suno",
          "version": "v6-mini",
          "audio_url": "https://example.com/reference.wav",
          "continue_at": 30,
          "prompt": "[Outro]\n下一段旅途，我们一起走",
          "tags": "acoustic pop",
          "duration_s": 60,
          "max_mode": True,
          "audio_format": "mp3",
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.apimart.ai/v1/music/generations/uploadExtend", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "suno",
      version: "v6-mini",
      audio_url: "https://example.com/reference.wav",
      continue_at: 30,
      prompt: "[Outro]\n下一段旅途，我们一起走",
      tags: "acoustic pop",
      duration_s: 60,
      max_mode: true,
      audio_format: "mp3"
    })
  });
  console.log(await response.json());
  ```
</RequestExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  Bearer Token。访问 [API Key 管理页面](https://apimart.ai/keys) 获取 API Key。
</ParamField>

## Body

<ParamField body="model" type="string" default="suno">固定使用 `suno`。</ParamField>

<ParamField body="audio_url" type="string" required>
  公网可访问的 HTTP(S) 音频直链，建议不超过 8 分钟。本地路径与 `blob:` URL 不可用。
</ParamField>

<ParamField body="continue_at" type="number" required>
  延伸起点，必须大于等于 1 秒，并严格小于源音频实际时长。
</ParamField>

<ParamField body="version" type="string" default="v6">
  公共版本：`v6` / `v6-wild` / `v6-mini`。使用 `custom_model_id` 时省略。
</ParamField>

<ParamField body="custom_model_id" type="string">
  创建模型任务返回的完整 UUID。与 `version`、`persona_id` 互斥。
</ParamField>

<ParamField body="prompt" type="string">
  延伸段歌词，不超过 5000 个字符；省略时按纯音乐延伸语义使用。
</ParamField>

<ParamField body="tags" type="string">风格描述，不超过 1000 个字符。</ParamField>

<ParamField body="title" type="string">标题，不超过 80 个字符。</ParamField>

<ParamField body="negative_tags" type="string">不希望出现的风格。</ParamField>

<ParamField body="style_weight" type="number">风格权重，范围 0–1。</ParamField>

<ParamField body="weirdness" type="number">创意度权重，范围 0–1。</ParamField>

<ParamField body="audio_weight" type="number">音频权重，范围 0–1。</ParamField>

<ParamField body="auto_lyrics" type="boolean">是否对输入歌词进行二次创作。</ParamField>

<ParamField body="vocal_gender" type="string">人声性别：`Male` / `Female`。</ParamField>

<ParamField body="persona_id" type="string">Persona ID，与 `custom_model_id` 互斥。</ParamField>

<ParamField body="duration_s" type="integer">
  目标生成时长，范围 10–360 秒。实际成品时长以任务结果为准。
</ParamField>

<ParamField body="variety" type="string">
  风格变化程度：`off` / `normal` / `high` / `extra` / `max`。
</ParamField>

<ParamField body="max_mode" type="boolean" default="false">
  是否启用 Max 模式；启用后按普通售价的 2 倍计费。
</ParamField>

<ParamField body="audio_format" type="string">输出格式：`mp3` / `m4a` / `wav`。</ParamField>

## Response

<ResponseField name="code" type="integer">响应状态码。</ResponseField>

<ResponseField name="data" type="array">
  提交结果，读取 `data[0].task_id` 并轮询任务查询接口。
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {"status": "submitted", "task_id": "task_01M24YMN4EV04M84R5QYM77R1E"}
    ]
  }
  ```
</ResponseExample>
