# 1. Generate Music https://api.kie.ai/api/v1/generate POST https://graph.facebook.com/api/v1/generate Content-Type: application/json Reference: https://docs.deao.dev/cloudflare/yt-channel-videos-upload-workflow/1-generate-music-https-api-kie-ai-api-v-1-generate ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /api/v1/generate: post: operationId: 1-generate-music-https-api-kie-ai-api-v-1-generate summary: 1. Generate Music https://api.kie.ai/api/v1/generate tags: - subpackage_ytChannelVideosUploadWorkflow responses: '200': description: Successful response content: application/json: schema: $ref: >- #/components/schemas/YT Channel Videos Upload Workflow_1. Generate Music https://api.kie.ai/api/v1/generate_Response_200 requestBody: content: application/json: schema: type: object properties: model: type: string style: type: string title: type: string prompt: type: string customMode: type: boolean callBackUrl: type: string format: uri instrumental: type: boolean required: - model - style - title - prompt - customMode - callBackUrl - instrumental servers: - url: https://graph.facebook.com - url: https://www.youtube.com - url: https://youtube-video-summarizer-gpt-ai.p.rapidapi.com - url: https://api.cloudflare.com - url: https://dev-musiccast.odoo.com - url: https://api.search.brave.com - url: https://og-image-generator-dev.deao.workers.dev - url: https://musiccast.odoo.com - url: https://m.musicca.st - url: https://api.stripe.com - url: https://api.kie.ai - url: https://api.pexels.com - url: https://api.shotstack.io - url: https://oauth2.googleapis.com - url: https://www.googleapis.com - url: https://api.linkedin.com - url: https://www.linkedin.com - url: https://rupload.facebook.com - url: https://api.x.com - url: https://open.tiktokapis.com - url: https://open-upload-sg.tiktokapis.com - url: https://social-media-posting-dev.deao.workers.dev components: schemas: YT Channel Videos Upload Workflow_1. Generate Music https://api.kie.ai/api/v1/generate_Response_200: type: object properties: {} description: Empty response body title: >- YT Channel Videos Upload Workflow_1. Generate Music https://api.kie.ai/api/v1/generate_Response_200 ``` ## SDK Code Examples ```python import requests url = "https://graph.facebook.com/api/v1/generate" payload = { "model": "V5", "style": "Italo Disco, nostalgic trance", "title": "Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}", "prompt": "Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.", "customMode": True, "callBackUrl": "https://{{env.worker_name}}.deao.workers.dev/step1", "instrumental": True } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://graph.facebook.com/api/v1/generate'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"model":"V5","style":"Italo Disco, nostalgic trance","title":"Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}","prompt":"Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.","customMode":true,"callBackUrl":"https://{{env.worker_name}}.deao.workers.dev/step1","instrumental":true}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://graph.facebook.com/api/v1/generate" payload := strings.NewReader("{\n \"model\": \"V5\",\n \"style\": \"Italo Disco, nostalgic trance\",\n \"title\": \"Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}\",\n \"prompt\": \"Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.\",\n \"customMode\": true,\n \"callBackUrl\": \"https://{{env.worker_name}}.deao.workers.dev/step1\",\n \"instrumental\": true\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://graph.facebook.com/api/v1/generate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"model\": \"V5\",\n \"style\": \"Italo Disco, nostalgic trance\",\n \"title\": \"Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}\",\n \"prompt\": \"Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.\",\n \"customMode\": true,\n \"callBackUrl\": \"https://{{env.worker_name}}.deao.workers.dev/step1\",\n \"instrumental\": true\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://graph.facebook.com/api/v1/generate") .header("Content-Type", "application/json") .body("{\n \"model\": \"V5\",\n \"style\": \"Italo Disco, nostalgic trance\",\n \"title\": \"Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}\",\n \"prompt\": \"Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.\",\n \"customMode\": true,\n \"callBackUrl\": \"https://{{env.worker_name}}.deao.workers.dev/step1\",\n \"instrumental\": true\n}") .asString(); ``` ```php request('POST', 'https://graph.facebook.com/api/v1/generate', [ 'body' => '{ "model": "V5", "style": "Italo Disco, nostalgic trance", "title": "Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}", "prompt": "Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.", "customMode": true, "callBackUrl": "https://{{env.worker_name}}.deao.workers.dev/step1", "instrumental": true }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://graph.facebook.com/api/v1/generate"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"model\": \"V5\",\n \"style\": \"Italo Disco, nostalgic trance\",\n \"title\": \"Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}\",\n \"prompt\": \"Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.\",\n \"customMode\": true,\n \"callBackUrl\": \"https://{{env.worker_name}}.deao.workers.dev/step1\",\n \"instrumental\": true\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "model": "V5", "style": "Italo Disco, nostalgic trance", "title": "Beautiful Music - Session #{{numeral_id}} | Music Cast {{current_year}}", "prompt": "Nostalgic melodic italo disco track featuring a prominent korg synthesizer and driving percussion, The song is set in a major key with a tempo of approximately 128 BPM, It opens with a distorted, rhythmickorg style motif that establishes a catchy, syncopated groove.", "customMode": true, "callBackUrl": "https://{{env.worker_name}}.deao.workers.dev/step1", "instrumental": true ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://graph.facebook.com/api/v1/generate")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```