메인 콘텐츠로 건너뛰기
POST
/
v1
/
music
/
generations
/
lyricsFlowMusic
curl --request POST \
  --url https://api.apimart.ai/v1/music/generations/lyricsFlowMusic \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flowmusic",
    "prompt": "끈기에 관한 록 노래"
  }'
import requests

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

payload = {
    "model": "flowmusic",
    "prompt": "끈기에 관한 록 노래"
}

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

const payload = {
  model: "flowmusic",
  prompt: "끈기에 관한 록 노래"
};

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_01KWXVCX91HYHSTHZ0NC1SRFW1"
    }
  ]
}
{
  "error": {
    "message": "model is required",
    "type": "invalid_request",
    "param": "",
    "code": "model_required"
  }
}
{
  "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/lyricsFlowMusic \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flowmusic",
    "prompt": "끈기에 관한 록 노래"
  }'
import requests

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

payload = {
    "model": "flowmusic",
    "prompt": "끈기에 관한 록 노래"
}

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

const payload = {
  model: "flowmusic",
  prompt: "끈기에 관한 록 노래"
};

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_01KWXVCX91HYHSTHZ0NC1SRFW1"
    }
  ]
}
{
  "error": {
    "message": "model is required",
    "type": "invalid_request",
    "param": "",
    "code": "model_required"
  }
}
{
  "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" 고정값(대소문자 구분 없음)
prompt
string
필수
가사 생성 프롬프트, ≤ 3000자노래의 주제, 스타일, 분위기 등을 설명하면 더 잘 어울리는 가사를 얻을 수 있습니다예시: "끈기에 관한 록 노래"

응답

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

사용 시나리오

시나리오 1: 주제로 가사 생성

{
  "model": "flowmusic",
  "prompt": "끈기에 관한 록 노래"
}

시나리오 2: 생성한 가사로 곡 만들기

먼저 가사를 생성하고, 완료 후 result.lyrics[0]titlelyrics를 가져와 음악 생성 API에 넣습니다:
{
  "model": "flowmusic",
  "title": "끈기",
  "lyrics": "[Verse 1]\n밤이 아무리 길어도 아침은 온다\n...",
  "sound_prompt": "energetic rock with electric guitar"
}
작업 결과 조회가사 생성은 비동기 작업으로, 제출 후 task_id가 반환됩니다. 작업 상태 조회 API로 생성 진행 상황과 결과를 확인하세요.

작업 완료 결과 예시

조회 응답 예시(GET /v1/music/tasks/{task_id}):
{
  "code": 200,
  "data": {
    "id": "task_01KWXVCX91HYHSTHZ0NC1SRFW1",
    "status": "completed",
    "progress": 100,
    "created": 1783413241,
    "completed": 1783413284,
    "actual_time": 43,
    "cost": 0.016,
    "credits_cost": 0.16,
    "result": {
      "lyrics": [
        {
          "title": "Bleached",
          "lyrics": "[Intro]\n(Check)\n(One two)\n\n[Verse 1]\nThe birds are..."
        }
      ]
    }
  }
}