# 查询上传并扩展音乐任务状态

> 音频生成

查询上传并扩展音乐任务的状态和结果。

**任务状态说明**:
- `Pending`: 等待中
- `Processing`: 处理中
- `Success`: 已完成
- `Failed`: 失败

## 请求地址

`GET https://api.modelverse.cn/v1/tasks/status`

## 请求参数

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| task_id | query | string | Yes | 任务 ID |

## 响应

- **200** — 查询成功
- **400** — 
- **401** — 
- **404** — 
- **500** — 

## OpenAPI 定义

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Suno 上传并扩展音乐",
    "description": "上传音频文件并扩展音乐时长。\n\n**模型**: `suno-v4`, `suno-v4.5`, `suno-v4.5+`, `suno-v4.5-all`, `suno-v5`, `suno-v5.5`\n\n**接口类型**: 异步任务\n\n**计费方式**: 按请求次数计费，成功任务计 1 次\n\n**音频时长限制**:\n- V4_5ALL 模型：上传音频不能超过 1 分钟\n- 其他模型：上传音频不能超过 8 分钟\n",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "生产环境"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "operationId": "submitSunoUploadExtendMusicTask",
        "summary": "提交上传并扩展音乐任务",
        "description": "提交上传并扩展音乐任务。上传音频文件并扩展音乐时长。\n\n**注意事项**:\n- V4_5ALL 模型：上传音频不能超过 1 分钟\n- 其他模型：上传音频不能超过 8 分钟\n- continue_at 必须大于 0 且小于原音频时长\n- 生成文件保留期：15 天\n",
        "tags": [
          "Suno"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadExtendMusicRequest"
              },
              "examples": {
                "customParams": {
                  "summary": "自定义参数模式",
                  "value": {
                    "model": "suno-v4.5",
                    "input": {
                      "audio_url": "https://example.com/uploaded.mp3",
                      "prompt": "Add more relaxing notes"
                    },
                    "parameters": {
                      "task": "upload-extend",
                      "default_param_flag": true,
                      "continue_at": 60,
                      "tags": "Classical",
                      "title": "Peaceful Piano Extended",
                      "make_instrumental": false,
                      "persona_id": "persona_123",
                      "negative_tags": "Relaxing Piano",
                      "style_weight": 0.65,
                      "weirdness_constraint": 0.65
                    }
                  }
                },
                "defaultParams": {
                  "summary": "默认参数模式",
                  "value": {
                    "model": "suno-v4.5",
                    "input": {
                      "audio_url": "https://example.com/uploaded.mp3"
                    },
                    "parameters": {
                      "task": "upload-extend",
                      "default_param_flag": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskSubmitResponse"
                },
                "example": {
                  "code": 0,
                  "message": "success",
                  "data": {
                    "task_id": "task_abc123xyz",
                    "status": "pending"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "operationId": "getSunoUploadExtendMusicTaskStatus",
        "summary": "查询上传并扩展音乐任务状态",
        "description": "查询上传并扩展音乐任务的状态和结果。\n\n**任务状态说明**:\n- `Pending`: 等待中\n- `Processing`: 处理中\n- `Success`: 已完成\n- `Failed`: 失败\n",
        "tags": [
          "Suno"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "任务 ID",
            "schema": {
              "type": "string",
              "example": "task_abc123xyz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponse"
                },
                "examples": {
                  "pending": {
                    "summary": "等待中",
                    "value": {
                      "code": 0,
                      "message": "success",
                      "data": {
                        "task_id": "19afee7ca36bf81a85bdc11adf41f310",
                        "task_status": "Pending",
                        "submit_time": 1788314983,
                        "finish_time": 0
                      },
                      "usage": {
                        "prompt_tokens": 0,
                        "completion_tokens": 0,
                        "total_tokens": 0
                      },
                      "request_id": ""
                    }
                  },
                  "success": {
                    "summary": "已完成",
                    "value": {
                      "code": 0,
                      "message": "success",
                      "data": {
                        "task_id": "19afee7ca36bf81a85bdc11adf41f310",
                        "task_status": "Success",
                        "urls": [
                          "https://tempfile.aiquickdraw.com/r/2bf2e37e-e6f9-454a-9925-05caffd46032.m4a?clip_id=2bf2e37e-e6f9-454a-9925-05caffd46032",
                          "https://tempfile.aiquickdraw.com/r/d2ddbe3e-9a59-4f5a-b533-03a0f49c19c7.m4a?clip_id=d2ddbe3e-9a59-4f5a-b533-03a0f49c19c7"
                        ],
                        "submit_time": 1788314983,
                        "finish_time": 1788314983
                      },
                      "usage": {
                        "prompt_tokens": 0,
                        "completion_tokens": 0,
                        "total_tokens": 0
                      },
                      "request_id": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/NotFound"
          },
          "500": {
            "$ref": "../common/modelverse-errors.yaml#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "API Key 认证"
      }
    },
    "schemas": {
      "UploadExtendMusicRequest": {
        "type": "object",
        "required": [
          "model",
          "input",
          "parameters"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型名称",
            "enum": [
              "suno-v4",
              "suno-v4.5",
              "suno-v4.5+",
              "suno-v4.5-all",
              "suno-v5",
              "suno-v5.5"
            ],
            "example": "suno-v4.5"
          },
          "input": {
            "type": "object",
            "required": [
              "audio_url"
            ],
            "description": "输入参数",
            "properties": {
              "audio_url": {
                "type": "string",
                "format": "uri",
                "description": "上传音频的 URL",
                "example": "https://example.com/uploaded.mp3"
              },
              "prompt": {
                "type": "string",
                "description": "描述音乐应如何延长。当 default_param_flag 为 true 且 make_instrumental 为 false 时必填。当 make_instrumental 为 true 时禁止传入。\n",
                "example": "Add more relaxing notes"
              }
            }
          },
          "parameters": {
            "type": "object",
            "required": [
              "task",
              "default_param_flag",
              "continue_at"
            ],
            "properties": {
              "task": {
                "type": "string",
                "description": "任务类型",
                "enum": [
                  "upload-extend"
                ],
                "example": "upload-extend"
              },
              "default_param_flag": {
                "type": "boolean",
                "description": "true=使用自定义参数, false=使用原音频参数。\n当为 true 时，tags 和 title 参数必填。\n",
                "example": true
              },
              "continue_at": {
                "type": "number",
                "description": "从第几秒开始延长（必须大于0）",
                "minimum": 0,
                "exclusiveMinimum": true,
                "example": 60
              },
              "tags": {
                "type": "string",
                "description": "音乐风格（default_param_flag=true 时必填）",
                "example": "Classical"
              },
              "title": {
                "type": "string",
                "description": "音乐标题（default_param_flag=true 时必填）",
                "example": "Peaceful Piano Extended"
              },
              "make_instrumental": {
                "type": "boolean",
                "description": "是否为纯音乐（无人声）。若为 true，则禁止传入 prompt 和 vocal_gender 参数。\n可选，默认值为 false。\n\n**实测说明**:\n- 如果源音乐有人声，该选项无法配置延长部分音乐为纯音乐\n- 如果源音乐是纯音乐，该选项可以结合 prompt、vocal_gender 等配置延长音乐部分为有人声音乐\n",
                "default": false,
                "example": false
              },
              "vocal_gender": {
                "type": "string",
                "description": "期望的人声性别。当 make_instrumental 为 false 时可选；当 make_instrumental 为 true 时禁止传入。\n\n**实测说明**: 此参数生成结果不稳定。\n",
                "enum": [
                  "m",
                  "f"
                ],
                "example": "m"
              },
              "persona_id": {
                "type": "string",
                "description": "Persona ID（仅 suno-v5、suno-v5.5 支持）。\n仅当 default_param_flag 为 true 时可用。\n",
                "example": "persona_123"
              },
              "negative_tags": {
                "type": "string",
                "description": "反向风格标签",
                "example": "Relaxing Piano"
              },
              "style_weight": {
                "type": "number",
                "description": "风格权重。范围 0.00–1.00，必须是 0.01 的倍数。\n",
                "minimum": 0,
                "maximum": 1,
                "multipleOf": 0.01,
                "example": 0.65
              },
              "weirdness_constraint": {
                "type": "number",
                "description": "创意发散度。范围 0.00–1.00，必须是 0.01 的倍数。\n",
                "minimum": 0,
                "maximum": 1,
                "multipleOf": 0.01,
                "example": 0.65
              }
            }
          }
        }
      },
      "TaskSubmitResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "状态码，0 表示成功",
            "example": 0
          },
          "message": {
            "type": "string",
            "description": "状态信息",
            "example": "success"
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "任务 ID",
                "example": "task_abc123xyz"
              },
              "status": {
                "type": "string",
                "description": "任务状态",
                "enum": [
                  "pending",
                  "processing",
                  "completed",
                  "failed"
                ],
                "example": "pending"
              }
            }
          }
        }
      },
      "TaskStatusResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "状态码，0 表示成功",
            "example": 0
          },
          "message": {
            "type": "string",
            "description": "状态信息",
            "example": "success"
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "任务 ID",
                "example": "19afee7ca36bf81a85bdc11adf41f310"
              },
              "task_status": {
                "type": "string",
                "description": "任务状态",
                "enum": [
                  "Pending",
                  "Processing",
                  "Success",
                  "Failed"
                ],
                "example": "Success"
              },
              "urls": {
                "type": "array",
                "description": "生成的音频文件 URL 列表",
                "items": {
                  "type": "string",
                  "format": "uri"
                },
                "example": [
                  "https://tempfile.aiquickdraw.com/r/2bf2e37e-e6f9-454a-9925-05caffd46032.m4a?clip_id=2bf2e37e-e6f9-454a-9925-05caffd46032",
                  "https://tempfile.aiquickdraw.com/r/d2ddbe3e-9a59-4f5a-b533-03a0f49c19c7.m4a?clip_id=d2ddbe3e-9a59-4f5a-b533-03a0f49c19c7"
                ]
              },
              "submit_time": {
                "type": "integer",
                "description": "提交时间戳",
                "example": 1788314983
              },
              "finish_time": {
                "type": "integer",
                "description": "完成时间戳",
                "example": 1788314983
              }
            }
          },
          "usage": {
            "type": "object",
            "description": "Token 使用情况",
            "properties": {
              "prompt_tokens": {
                "type": "integer",
                "description": "输入 token 数",
                "example": 0
              },
              "completion_tokens": {
                "type": "integer",
                "description": "输出 token 数",
                "example": 0
              },
              "total_tokens": {
                "type": "integer",
                "description": "总 token 数",
                "example": 0
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "example": ""
          }
        }
      }
    }
  }
}
```
