跳到主要內容
API 參考
API 參考

Suno 建立混搭

使用 create mashup 端點建立非同步 Task。

01

概覽

使用 create mashup 端點搭配支援的模型。使用回傳的 Task ID 取得其狀態,或提供 callback_url 以接收下方說明的傳遞通知。

快速入門

  1. 建立 API 金鑰並將其設定為 RUNAPI_API_KEY。
  2. 選擇支援的模型,並傳送本文符合該模型結構描述的 POST 請求。
  3. 儲存返回的任務 ID,然後輪詢直到終止狀態,或處理下方說明的回呼。

端點

POST /api/v1/suno/create_mashup
基礎 URL
https://runapi.ai
API 版本
v1
身分驗證
Authorization: Bearer YOUR_API_TOKEN
02

支援的模型

開啟模型頁面以查看目前的定價、速率限制及商業用途詳情。

03

請求綱要

JSON 請求內文

欄位及允許值取決於所選模型。若提供 callback_url,其將接收下方記錄的 Task 交付內容。

suno-v414 個欄位
audio_weightnumber
選填

音訊權重(0-1)。

範圍: 0 - 1
callback_urlstring
選填

用於非同步通知的 Webhook URL。

lyricsstring
選填

要演唱的確切混音歌詞。

邊界: 5000
modelstring
必填

模型 slug。

persona_idstring
選填

Persona ID。

persona_typestring
選填

Persona 類型。

允許的值: style, voice
promptstring
選填

自動生成歌詞的混搭摘要。

邊界: 5000
stylestring
選填

音樂風格。

邊界: 1000
style_weightnumber
選填

風格遵循權重(0-1)。

範圍: 0 - 1
titlestring
選填

音樂標題。

邊界: 80
upload_url_listarray
必填

要混音的兩個音訊 URL。

項目數範圍: 2 - 2
vocal_genderstring
選填

人聲性別。

允許的值: male, female
vocal_modestring
必填

人聲生成模式。

允許的值: auto_lyrics, exact_lyrics, instrumental
weirdness_constraintnumber
選填

奇異度限制(0-1)。

範圍: 0 - 1
suno-v4.514 個欄位
audio_weightnumber
選填

音訊權重(0-1)。

範圍: 0 - 1
callback_urlstring
選填

用於非同步通知的 Webhook URL。

lyricsstring
選填

要演唱的確切混音歌詞。

邊界: 5000
modelstring
必填

模型 slug。

persona_idstring
選填

Persona ID。

persona_typestring
選填

Persona 類型。

允許的值: style, voice
promptstring
選填

自動生成歌詞的混搭摘要。

邊界: 5000
stylestring
選填

音樂風格。

邊界: 1000
style_weightnumber
選填

風格遵循權重(0-1)。

範圍: 0 - 1
titlestring
選填

音樂標題。

邊界: 80
upload_url_listarray
必填

要混音的兩個音訊 URL。

項目數範圍: 2 - 2
vocal_genderstring
選填

人聲性別。

允許的值: male, female
vocal_modestring
必填

人聲生成模式。

允許的值: auto_lyrics, exact_lyrics, instrumental
weirdness_constraintnumber
選填

奇異度限制(0-1)。

範圍: 0 - 1
suno-v4.5-all14 個欄位
audio_weightnumber
選填

音訊權重(0-1)。

範圍: 0 - 1
callback_urlstring
選填

用於非同步通知的 Webhook URL。

lyricsstring
選填

要演唱的確切混音歌詞。

邊界: 5000
modelstring
必填

模型 slug。

persona_idstring
選填

Persona ID。

persona_typestring
選填

Persona 類型。

允許的值: style, voice
promptstring
選填

自動生成歌詞的混搭摘要。

邊界: 5000
stylestring
選填

音樂風格。

邊界: 1000
style_weightnumber
選填

風格遵循權重(0-1)。

範圍: 0 - 1
titlestring
選填

音樂標題。

邊界: 80
upload_url_listarray
必填

要混音的兩個音訊 URL。

項目數範圍: 2 - 2
vocal_genderstring
選填

人聲性別。

允許的值: male, female
vocal_modestring
必填

人聲生成模式。

允許的值: auto_lyrics, exact_lyrics, instrumental
weirdness_constraintnumber
選填

奇異度限制(0-1)。

範圍: 0 - 1
suno-v4.5-plus14 個欄位
audio_weightnumber
選填

音訊權重(0-1)。

範圍: 0 - 1
callback_urlstring
選填

用於非同步通知的 Webhook URL。

lyricsstring
選填

要演唱的確切混音歌詞。

邊界: 5000
modelstring
必填

模型 slug。

persona_idstring
選填

Persona ID。

persona_typestring
選填

Persona 類型。

允許的值: style, voice
promptstring
選填

自動生成歌詞的混搭摘要。

邊界: 5000
stylestring
選填

音樂風格。

邊界: 1000
style_weightnumber
選填

風格遵循權重(0-1)。

範圍: 0 - 1
titlestring
選填

音樂標題。

邊界: 80
upload_url_listarray
必填

要混音的兩個音訊 URL。

項目數範圍: 2 - 2
vocal_genderstring
選填

人聲性別。

允許的值: male, female
vocal_modestring
必填

人聲生成模式。

允許的值: auto_lyrics, exact_lyrics, instrumental
weirdness_constraintnumber
選填

奇異度限制(0-1)。

範圍: 0 - 1
suno-v514 個欄位
audio_weightnumber
選填

音訊權重(0-1)。

範圍: 0 - 1
callback_urlstring
選填

用於非同步通知的 Webhook URL。

lyricsstring
選填

要演唱的確切混音歌詞。

邊界: 5000
modelstring
必填

模型 slug。

persona_idstring
選填

Persona ID。

persona_typestring
選填

Persona 類型。

允許的值: style, voice
promptstring
選填

自動生成歌詞的混搭摘要。

邊界: 5000
stylestring
選填

音樂風格。

邊界: 1000
style_weightnumber
選填

風格遵循權重(0-1)。

範圍: 0 - 1
titlestring
選填

音樂標題。

邊界: 80
upload_url_listarray
必填

要混音的兩個音訊 URL。

項目數範圍: 2 - 2
vocal_genderstring
選填

人聲性別。

允許的值: male, female
vocal_modestring
必填

人聲生成模式。

允許的值: auto_lyrics, exact_lyrics, instrumental
weirdness_constraintnumber
選填

奇異度限制(0-1)。

範圍: 0 - 1
suno-v5.514 個欄位
audio_weightnumber
選填

音訊權重(0-1)。

範圍: 0 - 1
callback_urlstring
選填

用於非同步通知的 Webhook URL。

lyricsstring
選填

要演唱的確切混音歌詞。

邊界: 5000
modelstring
必填

模型 slug。

persona_idstring
選填

Persona ID。

persona_typestring
選填

Persona 類型。

允許的值: style, voice
promptstring
選填

自動生成歌詞的混搭摘要。

邊界: 5000
stylestring
選填

音樂風格。

邊界: 1000
style_weightnumber
選填

風格遵循權重(0-1)。

範圍: 0 - 1
titlestring
選填

音樂標題。

邊界: 80
upload_url_listarray
必填

要混音的兩個音訊 URL。

項目數範圍: 2 - 2
vocal_genderstring
選填

人聲性別。

允許的值: male, female
vocal_modestring
必填

人聲生成模式。

允許的值: auto_lyrics, exact_lyrics, instrumental
weirdness_constraintnumber
選填

奇異度限制(0-1)。

範圍: 0 - 1

條件規則

當所有列出的條件均符合時,這些需求即適用。

  1. vocal_mode = auto_lyrics
    必填
    prompt
    不接受
    lyrics, style, title
  2. vocal_mode = exact_lyrics
    必填
    lyrics, style, title
    不接受
    prompt
  3. vocal_mode = instrumental
    必填
    style, title
    不接受
    prompt, lyrics
04

建立接受記錄

HTTP 202

POST /api/v1/suno/create_mashup

回應綱要
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/create_mashup/:id

回應綱要
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/create_mashup/:id

回應綱要
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/create_mashup/:id

回應綱要
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

回應綱要
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

回應綱要
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

回應綱要
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/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 401

GET /api/v1/suno/create_mashup/:id

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 400

POST /api/v1/suno/create_mashup

回應綱要
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "人類可讀的錯誤訊息。",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "人類可讀的驗證摘要。",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "以公開請求欄位為索引鍵的驗證訊息,每個欄位包含一組人類可讀的字串陣列。",
          "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"
}
14

錯誤

HTTP 402

POST /api/v1/suno/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 429

POST /api/v1/suno/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 409

POST /api/v1/suno/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "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/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 503

POST /api/v1/suno/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 504

POST /api/v1/suno/create_mashup

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

回應範例

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

錯誤

HTTP 404

GET /api/v1/suno/create_mashup/:id

回應綱要
JSON
{
  "properties": {
    "error": {
      "description": "人類可讀的錯誤訊息。",
      "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.create_mashup.create(
  model="suno-v5",
  upload_url_list=["https://cdn.runapi.ai/public/samples/music.mp3", "https://cdn.runapi.ai/public/samples/audio-2.mp3"],
  vocal_mode="auto_lyrics",
  prompt="Blend both tracks into an energetic pop mashup.",
  persona_id="persona_reference",
  persona_type="style"
)