Kling 2.6 Pro - Create video from text or image
curl --request POST \
--url https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro \
--header 'Content-Type: application/json' \
--header 'x-magnific-api-key: <api-key>' \
--data '
{
"prompt": "<string>",
"webhook_url": "<string>",
"negative_prompt": "<string>",
"cfg_scale": 0.5,
"aspect_ratio": "widescreen_16_9",
"generate_audio": true
}
'import requests
url = "https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro"
payload = {
"prompt": "<string>",
"webhook_url": "<string>",
"negative_prompt": "<string>",
"cfg_scale": 0.5,
"aspect_ratio": "widescreen_16_9",
"generate_audio": True
}
headers = {
"x-magnific-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-magnific-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
webhook_url: '<string>',
negative_prompt: '<string>',
cfg_scale: 0.5,
aspect_ratio: 'widescreen_16_9',
generate_audio: true
})
};
fetch('https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'webhook_url' => '<string>',
'negative_prompt' => '<string>',
'cfg_scale' => 0.5,
'aspect_ratio' => 'widescreen_16_9',
'generate_audio' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-magnific-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": 0.5,\n \"aspect_ratio\": \"widescreen_16_9\",\n \"generate_audio\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-magnific-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro")
.header("x-magnific-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": 0.5,\n \"aspect_ratio\": \"widescreen_16_9\",\n \"generate_audio\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-magnific-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": 0.5,\n \"aspect_ratio\": \"widescreen_16_9\",\n \"generate_audio\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED",
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
]
}
}
Kling 2.6
Kling 2.6 Pro - Create video from text or image
POST
/
v1
/
ai
/
image-to-video
/
kling-v2-6-pro
Kling 2.6 Pro - Create video from text or image
curl --request POST \
--url https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro \
--header 'Content-Type: application/json' \
--header 'x-magnific-api-key: <api-key>' \
--data '
{
"prompt": "<string>",
"webhook_url": "<string>",
"negative_prompt": "<string>",
"cfg_scale": 0.5,
"aspect_ratio": "widescreen_16_9",
"generate_audio": true
}
'import requests
url = "https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro"
payload = {
"prompt": "<string>",
"webhook_url": "<string>",
"negative_prompt": "<string>",
"cfg_scale": 0.5,
"aspect_ratio": "widescreen_16_9",
"generate_audio": True
}
headers = {
"x-magnific-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-magnific-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
webhook_url: '<string>',
negative_prompt: '<string>',
cfg_scale: 0.5,
aspect_ratio: 'widescreen_16_9',
generate_audio: true
})
};
fetch('https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'webhook_url' => '<string>',
'negative_prompt' => '<string>',
'cfg_scale' => 0.5,
'aspect_ratio' => 'widescreen_16_9',
'generate_audio' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-magnific-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": 0.5,\n \"aspect_ratio\": \"widescreen_16_9\",\n \"generate_audio\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-magnific-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro")
.header("x-magnific-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": 0.5,\n \"aspect_ratio\": \"widescreen_16_9\",\n \"generate_audio\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magnific.com/v1/ai/image-to-video/kling-v2-6-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-magnific-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"webhook_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": 0.5,\n \"aspect_ratio\": \"widescreen_16_9\",\n \"generate_audio\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED",
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
]
}
}
Authorizations
Your Magnific API key. Required for authentication. Learn how to obtain an API key
Body
application/json
- Option 1
- Option 2
Text prompt describing the desired video to generate, cannot exceed 2500 characters
Maximum string length:
2500Duration of the generated video in seconds
Available options:
5, 10 Webhook URL to notify the user when the task is completed
Text prompt describing what to avoid in the generated video, cannot exceed 2500 characters
Maximum string length:
2500Flexibility in generation; The higher the value, the lower the model's degree of flexibility, and the stronger the relevance to the user's prompt.
Required range:
0 <= x <= 1Aspect ratio for the generated video
Available options:
widescreen_16_9, social_story_9_16, square_1_1 Whether to generate audio for the video
Response
OK
Show child attributes
Show child attributes
Example:
{ "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "status": "CREATED", "generated": [ "https://openapi-generator.tech", "https://openapi-generator.tech" ] }
Was this page helpful?
⌘I