Skip to main content
GET
/
v1
/
music
/
tasks
/
{task_id}
curl --request GET \
  --url https://api.apimart.ai/v1/music/tasks/task_01K8AYYM6R03TGZ3Q2P0TZVNPX?language=en \
  --header 'Authorization: Bearer <token>'
import requests

task_id = "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
url = f"https://api.apimart.ai/v1/music/tasks/{task_id}"

headers = {
    "Authorization": "Bearer <token>"
}

params = {
    "language": "en"
}

response = requests.get(url, headers=headers, params=params)

print(response.json())
const taskId = "task_01K8AYYM6R03TGZ3Q2P0TZVNPX";
const url = `https://api.apimart.ai/v1/music/tasks/${taskId}?language=en`;

const headers = {
  "Authorization": "Bearer <token>"
};

fetch(url, {
  method: "GET",
  headers: headers
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));
{
  "code": 200,
  "data": {
    "id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX",
    "status": "completed",
    "progress": 100,
    "created": 1783413241,
    "completed": 1783413352,
    "actual_time": 111,
    "cost": 0.06,
    "credits_cost": 0.6,
    "result": {
      "music": [
        {
          "clip_id": "a41aade4-993e-4d28-b56f-d97e7ef7167c",
          "title": "My Song",
          "duration_seconds": "181.70666667",
          "audio_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.m4a",
          "wav_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.wav"
        }
      ]
    }
  }
}
{
  "error": {
    "message": "task not found",
    "type": "invalid_request",
    "param": "task_id",
    "code": "task_not_found"
  }
}
{
  "error": {
    "message": "Current group capacity is saturated, please retry later",
    "type": "rate_limit_error",
    "param": "",
    "code": "rate_limit_error"
  }
}
curl --request GET \
  --url https://api.apimart.ai/v1/music/tasks/task_01K8AYYM6R03TGZ3Q2P0TZVNPX?language=en \
  --header 'Authorization: Bearer <token>'
import requests

task_id = "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
url = f"https://api.apimart.ai/v1/music/tasks/{task_id}"

headers = {
    "Authorization": "Bearer <token>"
}

params = {
    "language": "en"
}

response = requests.get(url, headers=headers, params=params)

print(response.json())
const taskId = "task_01K8AYYM6R03TGZ3Q2P0TZVNPX";
const url = `https://api.apimart.ai/v1/music/tasks/${taskId}?language=en`;

const headers = {
  "Authorization": "Bearer <token>"
};

fetch(url, {
  method: "GET",
  headers: headers
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));
{
  "code": 200,
  "data": {
    "id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX",
    "status": "completed",
    "progress": 100,
    "created": 1783413241,
    "completed": 1783413352,
    "actual_time": 111,
    "cost": 0.06,
    "credits_cost": 0.6,
    "result": {
      "music": [
        {
          "clip_id": "a41aade4-993e-4d28-b56f-d97e7ef7167c",
          "title": "My Song",
          "duration_seconds": "181.70666667",
          "audio_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.m4a",
          "wav_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.wav"
        }
      ]
    }
  }
}
{
  "error": {
    "message": "task not found",
    "type": "invalid_request",
    "param": "task_id",
    "code": "task_not_found"
  }
}
{
  "error": {
    "message": "Current group capacity is saturated, please retry later",
    "type": "rate_limit_error",
    "param": "",
    "code": "rate_limit_error"
  }
}

Authentication

Authorization
string
required
All Flow Music endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Authorization: Bearer YOUR_API_KEY

Path Parameters

task_id
string
required
The task ID returned after submitting a Flow Music task
The task ID comes from data[0].task_id in the submission response.

Query Parameters

language
string
default:"zh"
Language for error messages and some prompt textsAllowed values: zh, en, ja, ko

Response Fields

code
integer
Response status code, 200 on success
data
object
Task details

Result Structure

Music Tasks

Music generation, extension, section replacement, cover rearrangement, stem separation, audio upload, audio download, and video rendering usually return a result.music array.
{
  "result": {
    "music": [
      {
        "clip_id": "a41aade4-993e-4d28-b56f-d97e7ef7167c",
        "audio_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.m4a",
        "wav_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4.wav",
        "video_url": "https://cdn.apimart.ai/video/flowmusic_a41aade4.mp4",
        "file_url": "https://cdn.apimart.ai/audio/flowmusic_a41aade4_stems.zip"
      }
    ]
  }
}

Lyrics Tasks

Lyrics generation returns a result.lyrics array.
{
  "result": {
    "lyrics": [
      {
        "title": "Bleached",
        "lyrics": "[Intro]\n(Check)\n(One two)\n..."
      }
    ]
  }
}

Usage Notes

All Flow Music submission endpoints are asynchronous tasks. After a successful submission, first obtain the task_id, then call this endpoint to poll the task status; when status is completed, read the generated results from result.