curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-o1",
"prompt": "@image_1 walks toward the camera as the neon sign flickers behind her",
"image_url": "https://example.com/first-frame.png",
"resolution": "1080p",
"duration": 5
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "kling-o1",
"prompt": "@image_1 walks toward the camera as the neon sign flickers behind her",
"image_url": "https://example.com/first-frame.png",
"resolution": "1080p",
"duration": 5
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'kling-o1',
prompt: '@image_1 walks toward the camera as the neon sign flickers behind her',
image_url: 'https://example.com/first-frame.png',
resolution: '1080p',
duration: 5
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', 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.goenhance.ai/api/v1/videos/generations",
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([
'model' => 'kling-o1',
'prompt' => '@image_1 walks toward the camera as the neon sign flickers behind her',
'image_url' => 'https://example.com/first-frame.png',
'resolution' => '1080p',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-o1\",\n \"prompt\": \"@image_1 walks toward the camera as the neon sign flickers behind her\",\n \"image_url\": \"https://example.com/first-frame.png\",\n \"resolution\": \"1080p\",\n \"duration\": 5\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-o1\",\n \"prompt\": \"@image_1 walks toward the camera as the neon sign flickers behind her\",\n \"image_url\": \"https://example.com/first-frame.png\",\n \"resolution\": \"1080p\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
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\": \"kling-o1\",\n \"prompt\": \"@image_1 walks toward the camera as the neon sign flickers behind her\",\n \"image_url\": \"https://example.com/first-frame.png\",\n \"resolution\": \"1080p\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5",
"cost": 5.82
}
}Kling O1
Kling O1 omni video. Drive generation with any combination of a first frame, a first+last frame pair, reference images, multi-image elements and one reference video.
⚠️ Kling O1 is not a drop-in for kling-v3-omni. They share the same upstream path prefix but O1’s capability set is a strict subset: no multi-shot, no 4K, no generated audio, duration caps at 10s, and prompts cap at 2500 characters.
Referring to materials in the prompt — every material gets an index you can mention with @: elements are numbered @element_1…, images are numbered @image_1… in the order first frame → last frame → ref_imgs, and the reference video is always @video_1. The array order is the numbering, so reordering ref_imgs changes what your prompt refers to.
Material limits — image_url + image_end_url + ref_imgs + element_ids must not exceed 7 in total, or 4 when ref_videos is used. Using a first and last frame together disallows any additional ref_imgs / element_ids.
Pricing — per second of generated video, in tokens (USD at $0.02/token). Same as the official rate:
| resolution | no video input | with video input |
|---|---|---|
| 720p | 4.2 tokens/s ($0.084) | 6.3 tokens/s ($0.126) |
| 1080p | 5.6 tokens/s ($0.112) | 8.4 tokens/s ($0.168) |
There is no audio surcharge: O1 cannot generate audio — generate_audio only keeps the reference video’s original sound, which is already priced into the “with video input” tier.
Returns an img_uuid; poll GET /api/v1/jobs/detail (or use custom_callback_url) to get the generated video.
Reference materials use the shared naming: ref_imgs and ref_videos, the same as seedance / hailuo / wan’s reference endpoints. ref_videos is an array capped at 1. The older image_urls / video_url spellings still work.
⚠️ Do not confuse image_url (first frame) with ref_imgs (reference images) — they are different inputs and count against the same material budget.
curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-o1",
"prompt": "@image_1 walks toward the camera as the neon sign flickers behind her",
"image_url": "https://example.com/first-frame.png",
"resolution": "1080p",
"duration": 5
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "kling-o1",
"prompt": "@image_1 walks toward the camera as the neon sign flickers behind her",
"image_url": "https://example.com/first-frame.png",
"resolution": "1080p",
"duration": 5
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'kling-o1',
prompt: '@image_1 walks toward the camera as the neon sign flickers behind her',
image_url: 'https://example.com/first-frame.png',
resolution: '1080p',
duration: 5
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', 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.goenhance.ai/api/v1/videos/generations",
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([
'model' => 'kling-o1',
'prompt' => '@image_1 walks toward the camera as the neon sign flickers behind her',
'image_url' => 'https://example.com/first-frame.png',
'resolution' => '1080p',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-o1\",\n \"prompt\": \"@image_1 walks toward the camera as the neon sign flickers behind her\",\n \"image_url\": \"https://example.com/first-frame.png\",\n \"resolution\": \"1080p\",\n \"duration\": 5\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-o1\",\n \"prompt\": \"@image_1 walks toward the camera as the neon sign flickers behind her\",\n \"image_url\": \"https://example.com/first-frame.png\",\n \"resolution\": \"1080p\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
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\": \"kling-o1\",\n \"prompt\": \"@image_1 walks toward the camera as the neon sign flickers behind her\",\n \"image_url\": \"https://example.com/first-frame.png\",\n \"resolution\": \"1080p\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5",
"cost": 5.82
}
}Headers
Body
Model name. Must be kling-o1.
kling-o1 Text prompt. Max 2500 characters. Use @image_1 / @element_1 / @video_1 to refer to specific materials.
2500Optional. First-frame image URL.
Optional. Last-frame image URL. Requires image_url — last-frame-only is not supported. Using both frames disallows image_urls and element_ids.
Optional reference images. Order is the @image_N numbering. image_urls is accepted as a compatible alias.
7Optional multi-image element ids created through Kling's element library. Video-character elements are not supported by O1 yet. element_id is accepted for a single value.
Optional reference video (.mp4 / .mov, 3–10s, 700–2160px). At most one. Named as an array to match the other reference-driven endpoints (ref_imgs / ref_videos / ref_audios), even though only one is allowed. video_url is accepted as a compatible alias, and a bare string is accepted too.
1Role of video_url. feature = imitate its motion/style (a first frame may be added, a last frame may not). base = edit that video in place (no first or last frame). Requires ref_videos.
feature, base Video duration in seconds. ⚠️ When a first frame is given with no image_urls and no video_url, only 5 or 10 are accepted.
3 <= x <= 10Output resolution. O1 has no 4K tier. quality is accepted as a compatible alias.
720p, 1080p Output aspect ratio. Only used when there is no first frame and no reference video — otherwise the material decides. aspect_ratio is accepted as a compatible alias.
16:9, 9:16, 1:1 Keep the reference video's original sound. ⚠️ Requires ref_videos: O1 cannot generate an audio track, it can only retain an existing one.
Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.
"https://your-server.com/goenhance/callback"
