import Foundationlet url = URL(string: "https://aireiter.com/api/openapi/submit")!let payload: [String: Any] = [ "model": "flow_music_replace", "params": [ "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro", ], "out_task_id": "flow_music_replace_123456"]var request = URLRequest(url: url)request.httpMethod = "POST"request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.setValue("application/json", forHTTPHeaderField: "Content-Type")request.httpBody = try? JSONSerialization.data(withJSONObject: payload)let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("오류: \(error)") return } if let data = data, let responseString = String(data: data, encoding: .utf8) { print(responseString) }}task.resume()
using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;class Program{ static async Task Main(string[] args) { var url = "https://aireiter.com/api/openapi/submit"; var payload = @"{"model": "flow_music_replace","params": { "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro"},"out_task_id": "flow_music_replace_123456"}"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>"); var content = new StringContent(payload, Encoding.UTF8, "application/json"); var response = await client.PostAsync(url, content); var result = await response.Content.ReadAsStringAsync(); Console.WriteLine(result); }}
(* cohttp 및 yojson 라이브러리가 필요합니다 *)open Lwtopen Cohttpopen Cohttp_lwt_unixlet url = "https://aireiter.com/api/openapi/submit"let payload = {|{"model": "flow_music_replace","params": { "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro"},"out_task_id": "flow_music_replace_123456"}|}let () = let headers = Header.init () |> fun h -> Header.add h "Authorization" "Bearer <token>" |> fun h -> Header.add h "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string payload in let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) -> body |> Cohttp_lwt.Body.to_string >|= fun body_str -> print_endline body_str in Lwt_main.run response
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final url = Uri.parse('https://aireiter.com/api/openapi/submit'); final payload = { model: "flow_music_replace", params: { clip_id: "cd984d09-5a77-4a06-9553-e47a55f009b0", prompt: "이 구간을 부드러운 피아노 모티프로 바꿔줘", start_s: 2, end_s: 8, version: "lyria-3-pro", }, out_task_id: "flow_music_replace_123456" }; final response = await http.post( url, headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json' }, body: jsonEncode(payload), ); print(response.body);}
library(httr)library(jsonlite)url <- "https://aireiter.com/api/openapi/submit"payload <- list( model = "flow_music_replace", params = list( clip_id = "cd984d09-5a77-4a06-9553-e47a55f009b0", prompt = "이 구간을 부드러운 피아노 모티프로 바꿔줘", start_s = 2, end_s = 8, version = "lyria-3-pro", ), out_task_id = "flow_music_replace_123456")response <- POST( url, add_headers( Authorization = "Bearer <token>", `Content-Type` = "application/json" ), body = toJSON(payload, auto_unbox = TRUE), encode = "raw")cat(content(response, "text"))
import Foundationlet url = URL(string: "https://aireiter.com/api/openapi/submit")!let payload: [String: Any] = [ "model": "flow_music_replace", "params": [ "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro", ], "out_task_id": "flow_music_replace_123456"]var request = URLRequest(url: url)request.httpMethod = "POST"request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.setValue("application/json", forHTTPHeaderField: "Content-Type")request.httpBody = try? JSONSerialization.data(withJSONObject: payload)let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("오류: \(error)") return } if let data = data, let responseString = String(data: data, encoding: .utf8) { print(responseString) }}task.resume()
using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;class Program{ static async Task Main(string[] args) { var url = "https://aireiter.com/api/openapi/submit"; var payload = @"{"model": "flow_music_replace","params": { "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro"},"out_task_id": "flow_music_replace_123456"}"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>"); var content = new StringContent(payload, Encoding.UTF8, "application/json"); var response = await client.PostAsync(url, content); var result = await response.Content.ReadAsStringAsync(); Console.WriteLine(result); }}
(* cohttp 및 yojson 라이브러리가 필요합니다 *)open Lwtopen Cohttpopen Cohttp_lwt_unixlet url = "https://aireiter.com/api/openapi/submit"let payload = {|{"model": "flow_music_replace","params": { "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro"},"out_task_id": "flow_music_replace_123456"}|}let () = let headers = Header.init () |> fun h -> Header.add h "Authorization" "Bearer <token>" |> fun h -> Header.add h "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string payload in let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) -> body |> Cohttp_lwt.Body.to_string >|= fun body_str -> print_endline body_str in Lwt_main.run response
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final url = Uri.parse('https://aireiter.com/api/openapi/submit'); final payload = { model: "flow_music_replace", params: { clip_id: "cd984d09-5a77-4a06-9553-e47a55f009b0", prompt: "이 구간을 부드러운 피아노 모티프로 바꿔줘", start_s: 2, end_s: 8, version: "lyria-3-pro", }, out_task_id: "flow_music_replace_123456" }; final response = await http.post( url, headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json' }, body: jsonEncode(payload), ); print(response.body);}
library(httr)library(jsonlite)url <- "https://aireiter.com/api/openapi/submit"payload <- list( model = "flow_music_replace", params = list( clip_id = "cd984d09-5a77-4a06-9553-e47a55f009b0", prompt = "이 구간을 부드러운 피아노 모티프로 바꿔줘", start_s = 2, end_s = 8, version = "lyria-3-pro", ), out_task_id = "flow_music_replace_123456")response <- POST( url, add_headers( Authorization = "Bearer <token>", `Content-Type` = "application/json" ), body = toJSON(payload, auto_unbox = TRUE), encode = "raw")cat(content(response, "text"))
{ "error": { "code": 401, "message": "인증에 실패했습니다. API 키를 확인해 주세요" }}
{ "error": { "code": 433, "message": "계정 잔액이 부족합니다. 충전한 후 다시 시도해 주세요" } }
{ "error": { "code": 500, "message": "서버 내부 오류입니다. 나중에 다시 시도해 주세요" }}
Flow Music Replace의 AIReiter 내 모델 이름은 flow_music_replace입니다. clip_id는 성공한 작업의 output[].clip_id에서 가져옵니다.
Authorizations
string
필수
모든 엔드포인트는 Bearer Token으로 인증해야 합니다.API Key 가져오기:API Key 관리 페이지에 접속하여 API Key를 가져오세요.사용할 때 요청 헤더에 추가하세요:
Authorization: Bearer YOUR_API_KEY
Body
string
필수
모델 이름, 고정 값:
flow_music_replace
object
필수
모델 파라미터 객체.
표시 params 객체 속성
string
필수
성공한 작업의 clip_id로, output[].clip_id에서 가져옵니다.generate / extend / replace / cover / upload 성공 후 모두 반환됩니다. stems / download / video는 동일한 clip_id를 재사용하며, 새로 생성하지 않습니다. clip_id가 없고 오디오 파일만 있는 경우에는 먼저 flow_music_upload를 호출하세요.
string
필수
교체 지시문으로, 이 구간을 어떤 형태로 바꾸길 원하는지 설명합니다.
number
기본값:"0"
시작 초입니다. 범위는 0부터 240까지입니다.
number
기본값:"10"
종료 초입니다. 범위는 1부터 240까지이며, start_s보다 커야 합니다.
string
기본값:"lyria-3-pro"
Lyria 버전, 가격은 동일합니다:
lyria-3-pro - 기본값
lyria-3.5 - 더 최신의 보컬 모델
string
필수
요청 측 작업 ID.사용자가 직접 정의한 작업 식별자이며, 필수입니다. 문자, 숫자, 밑줄, 하이픈만 지원하며 길이는 1-64자입니다. 이후 이 ID로 작업 상태와 결과를 조회할 수 있습니다.
Response
string
요청 측 작업 ID로, 결과를 조회하는 데 사용할 수 있습니다.
string
초기 상태로, 일반적으로 "pending"입니다.
string
생성 시간, ISO 형식.
Query Task
Flow Music Replace는 비동기 음악 교체 모델입니다. 작업을 제출한 후 out_task_id를 사용하여 작업 상태를 조회하세요. 완료되면 output에는 audio, url, title 및 새로운 clip_id가 포함됩니다.
import Foundationlet url = URL(string: "https://aireiter.com/api/openapi/submit")!let payload: [String: Any] = [ "model": "flow_music_replace", "params": [ "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro", ], "out_task_id": "flow_music_replace_123456"]var request = URLRequest(url: url)request.httpMethod = "POST"request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.setValue("application/json", forHTTPHeaderField: "Content-Type")request.httpBody = try? JSONSerialization.data(withJSONObject: payload)let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("오류: \(error)") return } if let data = data, let responseString = String(data: data, encoding: .utf8) { print(responseString) }}task.resume()
using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;class Program{ static async Task Main(string[] args) { var url = "https://aireiter.com/api/openapi/submit"; var payload = @"{"model": "flow_music_replace","params": { "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro"},"out_task_id": "flow_music_replace_123456"}"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>"); var content = new StringContent(payload, Encoding.UTF8, "application/json"); var response = await client.PostAsync(url, content); var result = await response.Content.ReadAsStringAsync(); Console.WriteLine(result); }}
(* cohttp 및 yojson 라이브러리가 필요합니다 *)open Lwtopen Cohttpopen Cohttp_lwt_unixlet url = "https://aireiter.com/api/openapi/submit"let payload = {|{"model": "flow_music_replace","params": { "clip_id": "cd984d09-5a77-4a06-9553-e47a55f009b0", "prompt": "이 구간을 부드러운 피아노 모티프로 바꿔줘", "start_s": 2, "end_s": 8, "version": "lyria-3-pro"},"out_task_id": "flow_music_replace_123456"}|}let () = let headers = Header.init () |> fun h -> Header.add h "Authorization" "Bearer <token>" |> fun h -> Header.add h "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string payload in let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) -> body |> Cohttp_lwt.Body.to_string >|= fun body_str -> print_endline body_str in Lwt_main.run response
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final url = Uri.parse('https://aireiter.com/api/openapi/submit'); final payload = { model: "flow_music_replace", params: { clip_id: "cd984d09-5a77-4a06-9553-e47a55f009b0", prompt: "이 구간을 부드러운 피아노 모티프로 바꿔줘", start_s: 2, end_s: 8, version: "lyria-3-pro", }, out_task_id: "flow_music_replace_123456" }; final response = await http.post( url, headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json' }, body: jsonEncode(payload), ); print(response.body);}
library(httr)library(jsonlite)url <- "https://aireiter.com/api/openapi/submit"payload <- list( model = "flow_music_replace", params = list( clip_id = "cd984d09-5a77-4a06-9553-e47a55f009b0", prompt = "이 구간을 부드러운 피아노 모티프로 바꿔줘", start_s = 2, end_s = 8, version = "lyria-3-pro", ), out_task_id = "flow_music_replace_123456")response <- POST( url, add_headers( Authorization = "Bearer <token>", `Content-Type` = "application/json" ), body = toJSON(payload, auto_unbox = TRUE), encode = "raw")cat(content(response, "text"))