메인 콘텐츠로 건너뛰기
POST
/
v1
/
music
/
generations
/
videoClipFlowMusic
curl --request POST \
  --url https://api.apimart.ai/v1/music/generations/videoClipFlowMusic \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "preset": "modern"
  }'
import requests

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

payload = {
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "preset": "modern"
}

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/videoClipFlowMusic";

const payload = {
  model: "flowmusic",
  clip_id: "abc123-def456",
  preset: "modern"
};

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_01KWXVD4HQEEY7B5NJ31177Q1H"
    }
  ]
}
{
  "error": {
    "message": "clip_id is required",
    "type": "invalid_request",
    "param": "",
    "code": "invalid_request"
  }
}
{
  "error": {
    "message": "잔액이 부족합니다",
    "type": "invalid_request",
    "param": "",
    "code": "quota_not_enough"
  }
}
{
  "error": {
    "message": "현재 그룹 용량이 포화 상태입니다. 잠시 후 다시 시도해 주세요",
    "type": "rate_limit_error",
    "param": "",
    "code": "rate_limit_error"
  }
}
curl --request POST \
  --url https://api.apimart.ai/v1/music/generations/videoClipFlowMusic \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "preset": "modern"
  }'
import requests

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

payload = {
    "model": "flowmusic",
    "clip_id": "abc123-def456",
    "preset": "modern"
}

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/videoClipFlowMusic";

const payload = {
  model: "flowmusic",
  clip_id: "abc123-def456",
  preset: "modern"
};

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_01KWXVD4HQEEY7B5NJ31177Q1H"
    }
  ]
}
{
  "error": {
    "message": "clip_id is required",
    "type": "invalid_request",
    "param": "",
    "code": "invalid_request"
  }
}
{
  "error": {
    "message": "잔액이 부족합니다",
    "type": "invalid_request",
    "param": "",
    "code": "quota_not_enough"
  }
}
{
  "error": {
    "message": "현재 그룹 용량이 포화 상태입니다. 잠시 후 다시 시도해 주세요",
    "type": "rate_limit_error",
    "param": "",
    "code": "rate_limit_error"
  }
}

인증

Authorization
string
필수
모든 API는 Bearer Token 인증이 필요합니다API Key 발급:API Key 관리 페이지에서 API Key를 발급받으세요사용 시 요청 헤더에 다음을 추가하세요:
Authorization: Bearer YOUR_API_KEY

요청 파라미터

model
string
필수
모델 이름, "flowmusic" 고정값(대소문자 구분 없음)
clip_id
string
필수
비디오를 생성할 음악의 clip_id, 성공한 작업의 result.music[].clip_id에서 가져옵니다
preset
string
기본값:"simple"
비디오 템플릿 프리셋선택 가능한 값:
  • simple - 심플 템플릿
  • modern - 모던 스타일 템플릿
  • player - 플레이어 스타일 템플릿

응답

code
integer
응답 상태 코드, 성공 시 200
data
array
반환 데이터 배열

사용 시나리오

시나리오 1: modern 템플릿으로 음악 비디오 렌더링

{
  "model": "flowmusic",
  "clip_id": "abc123-def456",
  "preset": "modern"
}
작업 결과 조회음악 비디오 렌더링은 비동기 작업으로, 제출 후 task_id가 반환됩니다. 작업 상태 조회 API로 생성 진행 상황과 결과를 확인하세요. 결과는 result.music[0].video_url에 있습니다.

작업 완료 결과 예시

조회 응답 예시(GET /v1/music/tasks/{task_id}):
{
  "code": 200,
  "data": {
    "id": "task_01KWXVD4HQEEY7B5NJ31177Q1H",
    "status": "completed",
    "progress": 100,
    "created": 1783413248,
    "completed": 1783413327,
    "actual_time": 79,
    "cost": 0.016,
    "credits_cost": 0.16,
    "result": {
      "music": [
        {
          "clip_id": "a41aade4-993e-4d28-b56f-d97e7ef7167c",
          "video_url": "https://cdn.apimart.ai/video/flowmusic_a41aade4_video_clip.mp4",
          "url": "https://cdn.apimart.ai/video/flowmusic_a41aade4_video_clip.mp4"
        }
      ]
    }
  }
}