Passer au contenu principal
POST
/
v1
/
music
/
generations
/
coverFlowMusic
curl --request POST \
  --url https://api.apimart.ai/v1/music/generations/coverFlowMusic \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "instruction": "Réarranger cette chanson dans un style jazz",
    "strength": 0.5
  }'
import requests

url = "https://api.apimart.ai/v1/music/generations/coverFlowMusic"

payload = {
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "instruction": "Réarranger cette chanson dans un style jazz",
    "strength": 0.5
}

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
const url = "https://api.apimart.ai/v1/music/generations/coverFlowMusic";

const payload = {
  model: "flowmusic",
  clip_id: "abc123-def456",
  instruction: "Réarranger cette chanson dans un style jazz",
  strength: 0.5
};

const headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(payload)
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KWXVD0E653EZ9FWD2SD9NNB6"
    }
  ]
}
{
  "error": {
    "message": "strength must be between 0 and 1",
    "type": "invalid_request",
    "param": "",
    "code": "invalid_request"
  }
}
{
  "error": {
    "message": "Solde insuffisant",
    "type": "invalid_request",
    "param": "",
    "code": "quota_not_enough"
  }
}
{
  "error": {
    "message": "La capacité du groupe actuel est saturée, veuillez réessayer plus tard",
    "type": "rate_limit_error",
    "param": "",
    "code": "rate_limit_error"
  }
}
curl --request POST \
  --url https://api.apimart.ai/v1/music/generations/coverFlowMusic \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "instruction": "Réarranger cette chanson dans un style jazz",
    "strength": 0.5
  }'
import requests

url = "https://api.apimart.ai/v1/music/generations/coverFlowMusic"

payload = {
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "instruction": "Réarranger cette chanson dans un style jazz",
    "strength": 0.5
}

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
const url = "https://api.apimart.ai/v1/music/generations/coverFlowMusic";

const payload = {
  model: "flowmusic",
  clip_id: "abc123-def456",
  instruction: "Réarranger cette chanson dans un style jazz",
  strength: 0.5
};

const headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(payload)
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KWXVD0E653EZ9FWD2SD9NNB6"
    }
  ]
}
{
  "error": {
    "message": "strength must be between 0 and 1",
    "type": "invalid_request",
    "param": "",
    "code": "invalid_request"
  }
}
{
  "error": {
    "message": "Solde insuffisant",
    "type": "invalid_request",
    "param": "",
    "code": "quota_not_enough"
  }
}
{
  "error": {
    "message": "La capacité du groupe actuel est saturée, veuillez réessayer plus tard",
    "type": "rate_limit_error",
    "param": "",
    "code": "rate_limit_error"
  }
}

Authentification

Authorization
string
requis
Toutes les API nécessitent une authentification par Bearer TokenObtenir une clé API :Rendez-vous sur la page de gestion des clés API pour obtenir votre clé APIAjoutez-la dans l’en-tête de la requête lors de l’utilisation :
Authorization: Bearer YOUR_API_KEY

Paramètres de requête

model
string
requis
Nom du modèle, toujours passer "flowmusic" (insensible à la casse)
clip_id
string
requis
Identifiant unique de la musique source, provenant du result.music[].clip_id d’une tâche réussie
instruction
string
requis
Instruction d’édition pour le CoverExemple : "Réarranger cette chanson dans un style jazz"
strength
number
requis
Intensité de l’éditionPlage de valeurs : 0 ~ 1, plus la valeur est élevée, plus les modifications sont importantes
title
string
Titre de la musique après le Cover
seed
string
Graine aléatoire, utilisée pour la reproduction des résultats

Réponse

code
integer
Code de statut de la réponse, 200 en cas de succès
data
array
Tableau de données renvoyées

Cas d’usage

Scénario 1 : réarranger toute la chanson dans un style jazz

{
  "model": "flowmusic",
  "clip_id": "abc123-def456",
  "instruction": "Réarranger cette chanson dans un style jazz",
  "strength": 0.5
}

Scénario 2 : réarranger un audio externe après import

Importez d’abord l’audio externe via Téléverser un audio pour obtenir un clip_id, puis effectuez le Cover :
{
  "model": "flowmusic",
  "clip_id": "1db3a20f-4ddc-44e8-8c9c-6c9093c16ffe",
  "instruction": "Passer à un style jazz",
  "strength": 0.6
}
Interroger le résultat de la tâcheLe réarrangement Cover est une tâche asynchrone ; après soumission, un task_id est renvoyé. Utilisez l’API Obtenir le statut de la tâche pour interroger la progression et le résultat de la génération. Le produit du Cover est un nouveau clip_id ; utilisez ce nouveau clip_id pour les opérations ultérieures.

Exemple de résultat de tâche terminée

Exemple de réponse de requête (GET /v1/music/tasks/{task_id}) :
{
  "code": 200,
  "data": {
    "id": "task_01KWXVD0E653EZ9FWD2SD9NNB6",
    "status": "completed",
    "progress": 100,
    "created": 1783413244,
    "completed": 1783413315,
    "actual_time": 71,
    "cost": 0.048,
    "credits_cost": 0.48,
    "result": {
      "music": [
        {
          "clip_id": "ef3d804e-fa97-402f-ba17-4ff08270159b",
          "title": "Untitled (Cover)",
          "duration_seconds": "178.03733333",
          "create_time": "2026-07-07T08:34:58.112190Z",
          "lyrics": "[Verse 1]\nWaking up to the morning light,\n...",
          "lyrics_id": "c302d603-81b6-552f-8122-e512928d6aa1",
          "lyrics_timing_markers": [[10, 12], [212, 36]],
          "audio_url": "https://cdn.apimart.ai/audio/flowmusic_ef3d804e.m4a",
          "wav_url": "https://cdn.apimart.ai/audio/flowmusic_ef3d804e.wav",
          "image_url": "https://cdn.apimart.ai/image/flowmusic_ef3d804e_cover.jpg"
        }
      ]
    }
  }
}