Kling O3 — First last frame API
First last frame with Kling O3: request parameters, examples and response handling.
Endpoint: POST https://api.higgsfield.ai/kling-video/o3/first-last-frame
Endpoint ID: kling-video/o3/first-last-frame
#Usage notes
- first_frame_url supplies the starting frame; last_frame_url is optional. These names differ from the image_url and last_image_url fields on Kling 3.0 image-to-video.
- For a single shot, set multi_shots to false and provide prompt. For multiple shots, set multi_shots to true and provide 1–6 multi_prompt objects, each containing prompt and a positive integer duration.
- Always include a non-empty top-level prompt, including when using multi_prompt.
- Each shot prompt is limited to 512 characters. Custom-shot durations are summed for generation and billing; the top-level duration does not override that sum.
- Native audio uses sound: on or off and defaults to off.
- Keep the top-level prompt within 2,500 characters; longer prompts are truncated.
- The example.com media URLs are placeholders. Replace them with public HTTPS URLs to your own media before submitting.
#Quick start
Replace the example media URLs with publicly accessible URLs for your own files before submitting.
curl --request POST \
--url https://api.higgsfield.ai/kling-video/o3/first-last-frame \
--header "Authorization: Key ${HF_API_KEY_ID}:${HF_API_KEY_SECRET}" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY}" \
--data '{
"prompt": "A slow cinematic camera move around the subject in warm evening light.",
"first_frame_url": "https://example.com/first-frame.jpg",
"multi_shots": false
}'
import higgsfield_client
arguments = (
{'prompt': 'A slow cinematic camera move around the subject in warm evening '
'light.',
'first_frame_url': 'https://example.com/first-frame.jpg',
'multi_shots': False}
)
result = higgsfield_client.subscribe(
"kling-video/o3/first-last-frame",
arguments=arguments,
)
print(result["video"]["url"])
import { config, higgsfield } from "@higgsfield/client/v2";
config({ credentials: process.env.HF_CREDENTIALS });
const result = await higgsfield.subscribe("kling-video/o3/first-last-frame", {
input:
{
"prompt": "A slow cinematic camera move around the subject in warm evening light.",
"first_frame_url": "https://example.com/first-frame.jpg",
"multi_shots": false
},
withPolling: true,
});
if (result.status === "completed") {
console.log(result.video?.url);
}
#Input schema
mode string (default: pro)
Allowed values: "std", "pro", "4k".
sound string (default: off)
Enable sound for the output video.
Allowed values: "on", "off".
prompt string
Write your prompt here
duration integer (default: 5)
Requested output duration in seconds.
Minimum: 3.
Maximum: 15.
multi_shots boolean (default: false)
See the complete JSON schema below.
aspect_ratio string
Output width-to-height ratio.
Allowed values: "16:9", "9:16", "1:1".
multi_prompt array
Minimum items: 1.
Maximum items: 6.
Nested fields
multi_prompt[].prompt string
Text instructions for the generation or edit.
Maximum characters: 512.
multi_prompt[].duration integer
Requested output duration in seconds.
Minimum: 1.
Maximum: 15.
last_frame_url string
Format: uri.
first_frame_url string required
Format: uri.
Complete JSON schema
{
"if": {
"properties": {
"multi_shots": {
"const": true
}
}
},
"else": {
"required": [
"prompt",
"first_frame_url"
]
},
"then": {
"required": [
"multi_prompt",
"first_frame_url"
]
},
"type": "object",
"title": "Kling O3 Playground",
"properties": {
"mode": {
"enum": [
"std",
"pro",
"4k"
],
"type": "string",
"default": "pro"
},
"sound": {
"enum": [
"on",
"off"
],
"type": "string",
"default": "off"
},
"prompt": {
"type": "string",
"title": "Prompt",
"description": "Write your prompt here"
},
"duration": {
"type": "integer",
"title": "Duration",
"default": 5,
"maximum": 15,
"minimum": 3
},
"multi_shots": {
"type": "boolean",
"default": false
},
"aspect_ratio": {
"enum": [
"16:9",
"9:16",
"1:1"
],
"type": "string"
},
"multi_prompt": {
"type": "array",
"items": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"maxLength": 512
},
"duration": {
"type": "integer",
"maximum": 15,
"minimum": 1
}
}
},
"maxItems": 6,
"minItems": 1
},
"last_frame_url": {
"type": "string",
"title": "Last frame URL",
"format": "uri"
},
"first_frame_url": {
"type": "string",
"title": "First frame URL",
"format": "uri"
}
}
}
#Response
Submission returns a request handle. Poll status_url until status is completed, or use webhooks.
{
"status": "queued",
"request_id": "REQUEST_ID",
"status_url": "https://api.higgsfield.ai/requests/REQUEST_ID/status",
"cancel_url": "https://api.higgsfield.ai/requests/REQUEST_ID/cancel"
}
A completed response includes the following output fields:
{
"status": "completed",
"request_id": "REQUEST_ID",
"video": {
"url": "https://example.com/output.mp4"
}
}
See idempotent requests, polling, request errors and authentication for shared request handling.