API Uç Noktaları

Müzik Uzat

POST/v2/extend

Müzik API'sini Genişlet

Sonuna yeni içerik ekleyerek mevcut müzik parçalarını genişletin.

POSThttps://udioapi.pro/api/v2/extend

tips

İki mod: orijinal parametreleri devralın veya özel parametreler kullanın.

İlerlemeyi kontrol etmek için döndürülen iş kimliğiyle Feed API'yi kullanın.

requestHeaders

namerequireddescription
AuthorizationyesKimlik doğrulama için taşıyıcı belirteci
Content-Typeyesapplication/json

requestBody

İstek gövdesi Devralma Modunu veya Özel Modu destekler

Devralma Modu

Orijinal parça parametrelerini kullanarak genişletme

noAdditionalParams

Özel Mod

Özel parametrelerle genişletme

paramNameparamTyperequireddescriptionexample
promptstringyesYeni şarkı sözleri veya açıklamaChange the music style to be calm and lyrical.
stylestringnoMüzik tarzılyrical
titlestringnoParça başlığılyrical song
extensionStartTimenumbernoUzatma için saniye cinsinden başlangıç zamanı150
tagsstringnoEk etiketlerwar

commonParams

paramNameparamTyperequireddescriptionexample
origin_task_idstringyesOrijinal müzik neslinden görev kimliğigen20e094aeaadfe494ea33a5c80ee596083bksv
extend_audio_indexnumberyesİlk ses için 0, ikinci ses için 10
custom_modebooleannodevralma modu için false, özel mod için truefalse
callback_urlstringnoGerçek zamanlı sonuçlar için isteğe bağlı webhook URL'sihttps://your-domain.com/webhook

responses

json
{
  "code": 200,
  "message": "success",
  "workId": "ext2e31202d4f629447fa75f603ae2470565bksv"
}
json
{
  "code": 400,
  "message": "Please specify which audio to extend. Add \"extend_audio_index\" to your request, using 0 for the first audio or 1 for the second."
}
json
{
  "code": 400,
  "message": "The provided \"origin_task_id\" is invalid or could not be found. Please ensure it corresponds to a successfully completed task associated with your API key."
}
json
{
  "code": 400,
  "message": "The requested audio is not yet completed. Please wait for the task to complete and try again."
}
json
{
  "code": 401,
  "message": "No API key provided in Authorization header"
}
json
{
  "code": 500,
  "message": "Internal Server Error"
}

codeExamples

curl
curl -X POST "https://udioapi.pro/api/v2/extend" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origin_task_id": "gen20e094aeaadfe494ea33a5c80ee596083bksv",
    "extend_audio_index": 0,
    "custom_mode": false
  }'
curl
curl -X POST "https://udioapi.pro/api/v2/extend" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origin_task_id": "gen20e094aeaadfe494ea33a5c80ee596083bksv",
    "extend_audio_index": 0,
    "custom_mode": true,
    "prompt": "Change the music style to be calm and lyrical.",
    "style": "lyrical",
    "title": "lyrical song",
    "extensionStartTime": 150,
    "tags": "war"
  }'
javascript
const response = await fetch('https://udioapi.pro/api/v2/extend', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    origin_task_id: 'gen20e094aeaadfe494ea33a5c80ee596083bksv',
    extend_audio_index: 0,
    custom_mode: false
  })
});

const data = await response.json();
console.log(data);
javascript
const response = await fetch('https://udioapi.pro/api/v2/extend', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    origin_task_id: 'gen20e094aeaadfe494ea33a5c80ee596083bksv',
    extend_audio_index: 0,
    custom_mode: true,
    prompt: 'Change the music style to be calm and lyrical.',
    style: 'lyrical',
    title: 'lyrical song',
    extensionStartTime: 150,
    tags: 'war'
  })
});

const data = await response.json();
console.log(data);
python
import requests

url = "https://udioapi.pro/api/v2/extend"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "origin_task_id": "gen20e094aeaadfe494ea33a5c80ee596083bksv",
    "extend_audio_index": 0,
    "custom_mode": False
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
python
import requests

url = "https://udioapi.pro/api/v2/extend"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "origin_task_id": "gen20e094aeaadfe494ea33a5c80ee596083bksv",
    "extend_audio_index": 0,
    "custom_mode": True,
    "prompt": "Change the music style to be calm and lyrical.",
    "style": "lyrical",
    "title": "lyrical song",
    "extensionStartTime": 150,
    "tags": "war"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())