---
title: Suno Create-Mashup
url: https://runapi.ai/zh-CN/docs/api/suno/create-mashup.md
canonical: https://runapi.ai/zh-CN/docs/api/suno/create-mashup
locale: zh-CN
---

# Suno Create-Mashup

## 概览

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

### 快速开始

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

## 端点

POST /api/v1/suno/create_mashup

基础 URL: https://runapi.ai

API 版本: v1

身份验证: Authorization: Bearer YOUR_API_TOKEN

## 支持的模型

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

- [suno-v4](/models/suno/v4)
- [suno-v4.5](/models/suno/v4.5)
- [suno-v4.5-all](/models/suno/v4.5-all)
- [suno-v4.5-plus](/models/suno/v4.5-plus)
- [suno-v5](/models/suno/v5)
- [suno-v5.5](/models/suno/v5.5)

## 请求 Schema

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

### suno-v4

```json
{
  "audio_weight": {
    "description": "Audio weight (0-1).",
    "type": "number"
  },
  "callback_url": {
    "description": "Webhook URL for async notifications.",
    "type": "string"
  },
  "lyrics": {
    "description": "Exact mashup lyrics to sing.",
    "type": "string"
  },
  "model": {
    "description": "Model slug.",
    "required": true,
    "type": "string"
  },
  "persona_id": {
    "description": "Persona ID.",
    "type": "string"
  },
  "persona_type": {
    "description": "Persona type.",
    "enum": [
      "style",
      "voice"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Mashup brief for automatic lyrics.",
    "type": "string"
  },
  "style": {
    "description": "Music style.",
    "type": "string"
  },
  "style_weight": {
    "description": "Style adherence weight (0-1).",
    "type": "number"
  },
  "title": {
    "description": "Music title.",
    "type": "string"
  },
  "upload_url_list": {
    "description": "Two audio URLs to mashup.",
    "max_items": 2,
    "min_items": 2,
    "required": true,
    "type": "array"
  },
  "vocal_gender": {
    "description": "Vocal gender.",
    "enum": [
      "male",
      "female"
    ],
    "type": "string"
  },
  "vocal_mode": {
    "description": "Vocal generation mode.",
    "enum": [
      "auto_lyrics",
      "exact_lyrics",
      "instrumental"
    ],
    "required": true,
    "type": "string"
  },
  "weirdness_constraint": {
    "description": "Weirdness constraint (0-1).",
    "type": "number"
  }
}
```

### suno-v4.5

```json
{
  "audio_weight": {
    "description": "Audio weight (0-1).",
    "type": "number"
  },
  "callback_url": {
    "description": "Webhook URL for async notifications.",
    "type": "string"
  },
  "lyrics": {
    "description": "Exact mashup lyrics to sing.",
    "type": "string"
  },
  "model": {
    "description": "Model slug.",
    "required": true,
    "type": "string"
  },
  "persona_id": {
    "description": "Persona ID.",
    "type": "string"
  },
  "persona_type": {
    "description": "Persona type.",
    "enum": [
      "style",
      "voice"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Mashup brief for automatic lyrics.",
    "type": "string"
  },
  "style": {
    "description": "Music style.",
    "type": "string"
  },
  "style_weight": {
    "description": "Style adherence weight (0-1).",
    "type": "number"
  },
  "title": {
    "description": "Music title.",
    "type": "string"
  },
  "upload_url_list": {
    "description": "Two audio URLs to mashup.",
    "max_items": 2,
    "min_items": 2,
    "required": true,
    "type": "array"
  },
  "vocal_gender": {
    "description": "Vocal gender.",
    "enum": [
      "male",
      "female"
    ],
    "type": "string"
  },
  "vocal_mode": {
    "description": "Vocal generation mode.",
    "enum": [
      "auto_lyrics",
      "exact_lyrics",
      "instrumental"
    ],
    "required": true,
    "type": "string"
  },
  "weirdness_constraint": {
    "description": "Weirdness constraint (0-1).",
    "type": "number"
  }
}
```

### suno-v4.5-all

```json
{
  "audio_weight": {
    "description": "Audio weight (0-1).",
    "type": "number"
  },
  "callback_url": {
    "description": "Webhook URL for async notifications.",
    "type": "string"
  },
  "lyrics": {
    "description": "Exact mashup lyrics to sing.",
    "type": "string"
  },
  "model": {
    "description": "Model slug.",
    "required": true,
    "type": "string"
  },
  "persona_id": {
    "description": "Persona ID.",
    "type": "string"
  },
  "persona_type": {
    "description": "Persona type.",
    "enum": [
      "style",
      "voice"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Mashup brief for automatic lyrics.",
    "type": "string"
  },
  "style": {
    "description": "Music style.",
    "type": "string"
  },
  "style_weight": {
    "description": "Style adherence weight (0-1).",
    "type": "number"
  },
  "title": {
    "description": "Music title.",
    "type": "string"
  },
  "upload_url_list": {
    "description": "Two audio URLs to mashup.",
    "max_items": 2,
    "min_items": 2,
    "required": true,
    "type": "array"
  },
  "vocal_gender": {
    "description": "Vocal gender.",
    "enum": [
      "male",
      "female"
    ],
    "type": "string"
  },
  "vocal_mode": {
    "description": "Vocal generation mode.",
    "enum": [
      "auto_lyrics",
      "exact_lyrics",
      "instrumental"
    ],
    "required": true,
    "type": "string"
  },
  "weirdness_constraint": {
    "description": "Weirdness constraint (0-1).",
    "type": "number"
  }
}
```

### suno-v4.5-plus

```json
{
  "audio_weight": {
    "description": "Audio weight (0-1).",
    "type": "number"
  },
  "callback_url": {
    "description": "Webhook URL for async notifications.",
    "type": "string"
  },
  "lyrics": {
    "description": "Exact mashup lyrics to sing.",
    "type": "string"
  },
  "model": {
    "description": "Model slug.",
    "required": true,
    "type": "string"
  },
  "persona_id": {
    "description": "Persona ID.",
    "type": "string"
  },
  "persona_type": {
    "description": "Persona type.",
    "enum": [
      "style",
      "voice"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Mashup brief for automatic lyrics.",
    "type": "string"
  },
  "style": {
    "description": "Music style.",
    "type": "string"
  },
  "style_weight": {
    "description": "Style adherence weight (0-1).",
    "type": "number"
  },
  "title": {
    "description": "Music title.",
    "type": "string"
  },
  "upload_url_list": {
    "description": "Two audio URLs to mashup.",
    "max_items": 2,
    "min_items": 2,
    "required": true,
    "type": "array"
  },
  "vocal_gender": {
    "description": "Vocal gender.",
    "enum": [
      "male",
      "female"
    ],
    "type": "string"
  },
  "vocal_mode": {
    "description": "Vocal generation mode.",
    "enum": [
      "auto_lyrics",
      "exact_lyrics",
      "instrumental"
    ],
    "required": true,
    "type": "string"
  },
  "weirdness_constraint": {
    "description": "Weirdness constraint (0-1).",
    "type": "number"
  }
}
```

### suno-v5

```json
{
  "audio_weight": {
    "description": "Audio weight (0-1).",
    "type": "number"
  },
  "callback_url": {
    "description": "Webhook URL for async notifications.",
    "type": "string"
  },
  "lyrics": {
    "description": "Exact mashup lyrics to sing.",
    "type": "string"
  },
  "model": {
    "description": "Model slug.",
    "required": true,
    "type": "string"
  },
  "persona_id": {
    "description": "Persona ID.",
    "type": "string"
  },
  "persona_type": {
    "description": "Persona type.",
    "enum": [
      "style",
      "voice"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Mashup brief for automatic lyrics.",
    "type": "string"
  },
  "style": {
    "description": "Music style.",
    "type": "string"
  },
  "style_weight": {
    "description": "Style adherence weight (0-1).",
    "type": "number"
  },
  "title": {
    "description": "Music title.",
    "type": "string"
  },
  "upload_url_list": {
    "description": "Two audio URLs to mashup.",
    "max_items": 2,
    "min_items": 2,
    "required": true,
    "type": "array"
  },
  "vocal_gender": {
    "description": "Vocal gender.",
    "enum": [
      "male",
      "female"
    ],
    "type": "string"
  },
  "vocal_mode": {
    "description": "Vocal generation mode.",
    "enum": [
      "auto_lyrics",
      "exact_lyrics",
      "instrumental"
    ],
    "required": true,
    "type": "string"
  },
  "weirdness_constraint": {
    "description": "Weirdness constraint (0-1).",
    "type": "number"
  }
}
```

### suno-v5.5

```json
{
  "audio_weight": {
    "description": "Audio weight (0-1).",
    "type": "number"
  },
  "callback_url": {
    "description": "Webhook URL for async notifications.",
    "type": "string"
  },
  "lyrics": {
    "description": "Exact mashup lyrics to sing.",
    "type": "string"
  },
  "model": {
    "description": "Model slug.",
    "required": true,
    "type": "string"
  },
  "persona_id": {
    "description": "Persona ID.",
    "type": "string"
  },
  "persona_type": {
    "description": "Persona type.",
    "enum": [
      "style",
      "voice"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Mashup brief for automatic lyrics.",
    "type": "string"
  },
  "style": {
    "description": "Music style.",
    "type": "string"
  },
  "style_weight": {
    "description": "Style adherence weight (0-1).",
    "type": "number"
  },
  "title": {
    "description": "Music title.",
    "type": "string"
  },
  "upload_url_list": {
    "description": "Two audio URLs to mashup.",
    "max_items": 2,
    "min_items": 2,
    "required": true,
    "type": "array"
  },
  "vocal_gender": {
    "description": "Vocal gender.",
    "enum": [
      "male",
      "female"
    ],
    "type": "string"
  },
  "vocal_mode": {
    "description": "Vocal generation mode.",
    "enum": [
      "auto_lyrics",
      "exact_lyrics",
      "instrumental"
    ],
    "required": true,
    "type": "string"
  },
  "weirdness_constraint": {
    "description": "Weirdness constraint (0-1).",
    "type": "number"
  }
}
```

#### 条件规则

当列出的全部条件同时匹配时，应用这些要求。

- **当**: `vocal_mode` = `auto_lyrics`; **必填**: `prompt`; **不可提供**: `lyrics`, `style`, `title`
- **当**: `vocal_mode` = `exact_lyrics`; **必填**: `lyrics`, `style`, `title`; **不可提供**: `prompt`
- **当**: `vocal_mode` = `instrumental`; **必填**: `style`, `title`; **不可提供**: `prompt`, `lyrics`

## 创建已接受

HTTP 202 - POST /api/v1/suno/create_mashup

### 响应 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"
}
```

## 轮询处理中

HTTP 200 - GET /api/v1/suno/create_mashup/:id

### 响应 Schema

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string"
          },
          "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"
}
```

## 轮询已完成

HTTP 200 - GET /api/v1/suno/create_mashup/:id

### 响应 Schema

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string"
          },
          "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"
}
```

## 轮询失败

HTTP 200 - GET /api/v1/suno/create_mashup/: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"
}
```

## 客户回调：处理中

HTTP 200 - POST callback_url

### 响应 Schema

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string"
          },
          "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"
}
```

## 客户回调：已完成

HTTP 200 - POST callback_url

### 响应 Schema

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string"
          },
          "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"
}
```

## 客户回调：失败

HTTP 200 - POST callback_url

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "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"
}
```

## 错误

HTTP 401 - POST /api/v1/suno/create_mashup

此响应不包含正文。

## 错误

HTTP 401 - GET /api/v1/suno/create_mashup/:id

此响应不包含正文。

## 错误

HTTP 400 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "model_must_be_one_of_suno-v4_suno-v4_5_suno-v4_5-all_suno-v4_5-plus_suno-v5_suno-v5_5",
    "message": "model must be one of: suno-v4, suno-v4.5, suno-v4.5-all, suno-v4.5-plus, suno-v5, suno-v5.5"
  }
}
```

## 错误

HTTP 402 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "insufficient_balance",
    "message": "Insufficient balance"
  }
}
```

## 错误

HTTP 403 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "api_token_credit_limit_exceeded",
    "message": "API key credit limit exceeded"
  }
}
```

## 错误

HTTP 409 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "request_conflict",
    "message": "The request uses features that are not supported for the selected model"
  }
}
```

## 错误

HTTP 429 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit reached. Please retry later."
  }
}
```

## 错误

HTTP 503 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "service_unavailable",
    "message": "Service under maintenance, please try again later"
  }
}
```

## 错误

HTTP 504 - POST /api/v1/suno/create_mashup

### 响应 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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": {
    "code": "timeout_error",
    "message": "The request timed out"
  }
}
```

## 错误

HTTP 404 - GET /api/v1/suno/create_mashup/: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": {
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "not_found",
    "message": "Task with id 'tsk_reference_demo' not found"
  }
}
```

## 生成的代码示例

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

### curl

```curl
curl -X POST https://runapi.ai/api/v1/suno/create_mashup \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"model":"suno-v5","upload_url_list":["https://file.runapi.ai/source-track-a.mp3","https://file.runapi.ai/source-track-b.mp3"],"vocal_mode":"auto_lyrics","prompt":"Blend both tracks into an energetic pop mashup."}'
```

### javascript

#### 安装

```bash
npm install @runapi.ai/suno
```

```javascript
import { SunoClient } from "@runapi.ai/suno";

const client = new SunoClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.createMashup.create({
  "model": "suno-v5",
  "upload_url_list": [
    "https://file.runapi.ai/source-track-a.mp3",
    "https://file.runapi.ai/source-track-b.mp3"
  ],
  "vocal_mode": "auto_lyrics",
  "prompt": "Blend both tracks into an energetic pop mashup."
});
```

### python

#### 安装

```bash
pip install runapi-suno
```

```python
import os
from runapi.suno import SunoClient

client = SunoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.create_mashup.create(
  model="suno-v5",
  upload_url_list=["https://file.runapi.ai/source-track-a.mp3", "https://file.runapi.ai/source-track-b.mp3"],
  vocal_mode="auto_lyrics",
  prompt="Blend both tracks into an energetic pop mashup."
)
```

### go

#### 安装

```bash
go get github.com/runapi-ai/suno-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  suno "github.com/runapi-ai/suno-sdk/go/suno"
)

func main() {
  client, err := suno.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.CreateMashup.Create(context.Background(), suno.CreateMashupParams{
    Model: suno.SunoModel("suno-v5"),
    UploadURLList: [2]string{"https://file.runapi.ai/source-track-a.mp3", "https://file.runapi.ai/source-track-b.mp3"},
    VocalMode: suno.VocalMode("auto_lyrics"),
    Prompt: "Blend both tracks into an energetic pop mashup.",
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### 安装

```bash
gem install runapi-suno
```

```ruby
require "runapi/suno"

client = RunApi::Suno::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.create_mashup.create(
  model: "suno-v5",
  upload_url_list: ["https://file.runapi.ai/source-track-a.mp3", "https://file.runapi.ai/source-track-b.mp3"],
  vocal_mode: "auto_lyrics",
  prompt: "Blend both tracks into an energetic pop mashup."
)
```

### java

#### 安装

```kotlin
implementation("ai.runapi:runapi-suno")
```

```java
import ai.runapi.suno.SunoClient;
import ai.runapi.suno.types.CreateMashupParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    SunoClient client = SunoClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.createMashup().create(
        CreateMashupParams.builder()
        .model("suno-v5")
        .uploadUrlList(java.util.Arrays.asList("https://file.runapi.ai/source-track-a.mp3", "https://file.runapi.ai/source-track-b.mp3"))
        .vocalMode("auto_lyrics")
        .prompt("Blend both tracks into an energetic pop mashup.")
            .build()
    );
  }
}
```

### php

#### 安装

```bash
composer require runapi-ai/suno
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Suno\SunoClient;

$client = new SunoClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->createMashup->create([
  "model" => "suno-v5",
  "upload_url_list" => ["https://file.runapi.ai/source-track-a.mp3", "https://file.runapi.ai/source-track-b.mp3"],
  "vocal_mode" => "auto_lyrics",
  "prompt" => "Blend both tracks into an energetic pop mashup."
]);
```

## 相关指南

- [API 身份验证](/docs/guides/authentication)
- [快速开始](/docs/guides/task-api/quickstart)
