reference_image_urlsarray<string>필수캐릭터, 사물, 의상, 장소를 위한 레퍼런스 사진 최대 7장입니다. JPEG 또는 PNG. 프롬프트에서 각각을 <<<image_1>>>, <<<image_2>>> 등으로 지칭하세요.
- 기본값
- 지정되지 않음
- 제약 조건
- minItems:1maxItems:7
kling/o3/reference-to-videoKling O3(Kling 3.0 Omni) reference-to-video는 인물·의상·장소 같은 레퍼런스 이미지 최대 7장을 새 샷 하나에 함께 등장시킵니다. 720p·1080p·4K의 3~15초이며 네이티브 오디오는 선택입니다.
예시는 선택한 엔드포인트의 공개 파라미터 정의를 사용합니다. API 키와 예시 미디어를 바꾼 뒤 서버에서 요청하세요.
SDK 및 연동https://api.spicyapi.ai/api/v1/jobs/createTaskAPI 키는 서버 환경 변수 SPICY_API_KEY에 보관하세요. Bearer 인증을 사용하고 JSON 요청에는 Content-Type: application/json을 지정하세요.
Authorization: Bearer $SPICY_API_KEY# Generate the idempotency key once; reuse it when retrying after a lost response.
export SPICY_IDEMPOTENCY_KEY="${SPICY_IDEMPOTENCY_KEY:-$(uuidgen)}"
curl -X POST https://api.spicyapi.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SPICY_IDEMPOTENCY_KEY" \
-d '{
"model": "kling/o3/reference-to-video",
"input": {
"aspect_ratio": "16:9",
"duration_seconds": 5,
"generate_audio": false,
"prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
"reference_image_urls": [
"https://example.com/reference.png"
],
"resolution": "720p",
"shot_type": "single"
}
}'
# Copy data.taskId from the response into TASK_ID, then poll the status.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.spicyapi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"이 모델의 입력 스키마에서 뽑아낸 예시입니다. API도 모든 요청을 같은 스키마로 검증합니다.
이 필드들은 요청 본문의 input 객체 안에 넣습니다. 이름과 타입은 API와 동일합니다. 기본값이 적혀 있지 않은 필드는 임의로 가정하지 마세요.
일부 필드는 다른 입력값에 따라 필수가 됩니다. 조건부 필수 항목의 정확한 규칙은 아래 전체 JSON Schema에서 확인하세요.
reference_image_urlsarray<string>필수캐릭터, 사물, 의상, 장소를 위한 레퍼런스 사진 최대 7장입니다. JPEG 또는 PNG. 프롬프트에서 각각을 <<<image_1>>>, <<<image_2>>> 등으로 지칭하세요.
promptstring필수번호가 매겨진 각 레퍼런스가 무엇인지(<<<image_1>>>, <<<image_2>>> 등) 말하고, 이들이 함께 만들어낼 샷을 설명하세요. 각 사진의 역할을 지정해야 서로 뒤섞이지 않습니다.
multi_promptarray<object>조건부 필수shot_type이 customize일 때 쓰는 샷 목록입니다. 최대 6개 샷을 순서대로 넣고 각 샷에 프롬프트(최대 512자)와 정수 초 길이를 지정합니다. 길이의 합은 duration_seconds와 같아야 하며 과금도 그대로 duration_seconds 기준입니다.
multi_prompt[].duration_secondsinteger객체 내 필수Length of this shot in whole seconds, 1 to 15.
multi_prompt[].promptstring객체 내 필수What happens in this shot, up to 512 characters.
shot_typestring선택single은 한 테이크로 이어지는 촬영을 요청합니다(완전히 보장되지는 않습니다). multi는 모델이 알아서 여러 샷으로 나눕니다. customize는 multi_prompt에 적은 샷 목록대로 나눕니다. 어느 쪽을 골라도 가격은 같습니다.
"single""multi""customize"duration_secondsinteger선택요금에 영향정수 초 단위로 3~15초 사이입니다. 해상도, 오디오와 함께 가격을 결정합니다.
keep_original_audioboolean선택참고 영상에 원래 있던 소리를 결과물에 남깁니다. 기본으로 켜져 있으며 참고 영상을 넣었을 때만 의미가 있습니다. 가격에는 영향이 없습니다.
generate_audioboolean선택요금에 영향같은 과정에서 따옴표로 쓴 대사, 효과음, 배경음이 담긴 사운드트랙을 생성합니다. 720p와 1080p에서는 무음보다 초당 비용이 더 들지만, 4K에서는 음성을 켜든 끄든 가격이 같습니다. 참고 영상과 함께 쓸 수 없습니다.
resolutionstring선택요금에 영향720p, 1080p, 4K 중 선택합니다. 상위 등급일수록 초당 비용이 더 듭니다.
"720p""1080p""4k"aspect_ratiostring선택16:9, 9:16, 1:1 중 선택합니다. 구도에 맞도록 샷을 쓰기 전에 먼저 정하세요.
"16:9""9:16""1:1"elementsarray<object>선택4K 실행용 이름 붙은 피사체를 하나 지정합니다. 이름, 한 줄 설명, 같은 인물이나 사물의 사진 2~4장(5~30초 음성 샘플은 선택)을 지정하고, 프롬프트나 샷 목록에서 피사체가 나와야 할 자리에 @이름을 적습니다. 요청당 하나이며, reference_image_urls와 합쳐 7개까지인 한도에 포함됩니다. 가격에는 영향이 없습니다.
elements[].descriptionstring객체 내 필수One line on who or what this subject is.
elements[].image_urlsarray<string>객체 내 필수2 to 4 images of this subject.
elements[].namestring객체 내 필수Name for this subject; write @name in the prompt where it should appear.
elements[].end_msinteger선택Trim end, in milliseconds, when the subject is taken from a video clip. Defaults to 8000.
elements[].reference_audio_urlsarray<string>선택Optional voice samples for this subject, 5 to 30 seconds each.
elements[].start_msinteger선택Trim start, in milliseconds, when the subject is taken from a video clip. Defaults to 0.
reference_video_urlsarray<string>선택요금에 영향선택 사항인 참고 영상(1개)으로, 새 샷이 그 움직임, 카메라 워크, 인물을 참고합니다. 프롬프트에서는 <<<video_1>>>로 지칭하십시오. 영상을 쓰면 참고 이미지는 최대 4장이고 generate_audio는 꺼 두어야 합니다. 참고 영상을 넣은 실행은 넣지 않은 경우보다 초당 요율이 높으며, 4K에서는 쓸 수 없습니다.
{
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"shot_type": {
"const": "customize"
}
},
"required": [
"shot_type"
]
},
"then": {
"required": [
"multi_prompt"
]
}
}
],
"properties": {
"aspect_ratio": {
"default": "16:9",
"description": "Output aspect ratio.",
"enum": [
"16:9",
"9:16",
"1:1"
],
"type": "string",
"x-ui": {
"order": 80,
"widget": "radio"
}
},
"duration_seconds": {
"default": 5,
"description": "Output length in whole seconds, from 3 to 15. Billed per second.",
"maximum": 15,
"minimum": 3,
"type": "integer",
"x-ui": {
"affects_price": true,
"order": 60,
"step": 1,
"unit": "s",
"widget": "slider"
}
},
"elements": {
"description": "One named subject built from 2 to 4 images of the same character or object. Write @name in the prompt where it should appear. 4K only.",
"items": {
"additionalProperties": false,
"properties": {
"description": {
"description": "One line on who or what this subject is.",
"maxLength": 500,
"minLength": 1,
"type": "string"
},
"end_ms": {
"description": "Trim end, in milliseconds, when the subject is taken from a video clip. Defaults to 8000.",
"minimum": 0,
"type": "integer"
},
"image_urls": {
"description": "2 to 4 images of this subject.",
"items": {
"format": "uri",
"type": "string"
},
"maxItems": 4,
"minItems": 2,
"type": "array"
},
"name": {
"description": "Name for this subject; write @name in the prompt where it should appear.",
"maxLength": 64,
"minLength": 1,
"type": "string"
},
"reference_audio_urls": {
"description": "Optional voice samples for this subject, 5 to 30 seconds each.",
"items": {
"format": "uri",
"type": "string"
},
"type": "array"
},
"start_ms": {
"description": "Trim start, in milliseconds, when the subject is taken from a video clip. Defaults to 0.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"name",
"description",
"image_urls"
],
"type": "object"
},
"maxItems": 1,
"type": "array",
"x-ui": {
"order": 87,
"widget": "object-list"
}
},
"generate_audio": {
"default": false,
"description": "Generate a native soundtrack (voices, effects, ambience) with the picture. Audio costs more per second. Not available with a reference video.",
"type": "boolean",
"x-ui": {
"affects_price": true,
"order": 65,
"widget": "switch"
}
},
"keep_original_audio": {
"default": true,
"description": "Keep the reference video's own sound in the result. Only matters when a reference video is given.",
"type": "boolean",
"x-ui": {
"order": 63,
"widget": "switch"
}
},
"multi_prompt": {
"description": "Shot list for shot_type customize: one entry per shot, in order, each with its own prompt and length in seconds. The lengths must add up to duration_seconds.",
"items": {
"additionalProperties": false,
"properties": {
"duration_seconds": {
"description": "Length of this shot in whole seconds, 1 to 15.",
"maximum": 15,
"minimum": 1,
"type": "integer"
},
"prompt": {
"description": "What happens in this shot, up to 512 characters.",
"maxLength": 512,
"minLength": 1,
"type": "string"
}
},
"required": [
"prompt",
"duration_seconds"
],
"type": "object"
},
"maxItems": 6,
"minItems": 1,
"type": "array",
"x-ui": {
"order": 54,
"widget": "object-list"
}
},
"prompt": {
"description": "Say who and what each reference is (<<<image_1>>>, <<<image_2>>> and so on) and describe the shot they should produce.",
"maxLength": 2500,
"minLength": 1,
"type": "string",
"x-ui": {
"order": 100,
"primary": true,
"reference_tokens": {
"elements": "@{name}",
"reference_image_urls": "<<<image_{index}>>>",
"reference_video_urls": "<<<video_{index}>>>"
},
"widget": "textarea"
}
},
"reference_image_urls": {
"description": "Reference images for characters, objects, outfits or places, up to 7. Refer to them in the prompt as <<<image_1>>>, <<<image_2>>> and so on.",
"items": {
"contentMediaType": [
"image/jpeg",
"image/png",
"image/webp",
"image/gif"
],
"format": "uri",
"type": "string"
},
"maxItems": 7,
"minItems": 1,
"type": "array",
"x-ui": {
"max_size_mb": 10,
"order": 90,
"widget": "multi-upload"
}
},
"reference_video_urls": {
"description": "Optional reference video (one clip) whose motion, camera or characters the new shot should draw on. Refer to it in the prompt as <<<video_1>>>. With a video, use up to 4 reference images. A run with a reference video is billed at a higher per-second rate.",
"items": {
"contentMediaType": [
"video/mp4",
"video/webm",
"video/quicktime"
],
"format": "uri",
"type": "string"
},
"maxItems": 1,
"minItems": 1,
"type": "array",
"x-ui": {
"accept": [
"video/mp4",
"video/webm"
],
"affects_price": true,
"order": 88,
"widget": "multi-upload"
}
},
"resolution": {
"default": "720p",
"description": "Output resolution. Higher tiers cost more per second.",
"enum": [
"720p",
"1080p",
"4k"
],
"type": "string",
"x-ui": {
"affects_price": true,
"order": 70,
"widget": "radio"
}
},
"shot_type": {
"default": "single",
"description": "single keeps one continuous shot; multi lets the model cut the prompt into several shots on its own; customize follows the shot list you give in multi_prompt.",
"enum": [
"single",
"multi",
"customize"
],
"type": "string",
"x-ui": {
"order": 55,
"widget": "radio"
}
}
},
"required": [
"prompt",
"reference_image_urls"
],
"type": "object",
"x-pricing": {
"billingMode": "variant_matrix",
"presenceFields": {
"with_video": "reference_video_urls"
},
"variantFields": [
"resolution",
"generate_audio",
"with_video"
],
"variantKeyOmitDefaults": [
"with_video"
]
}
}HTTP 202는 접수되었다는 뜻이며 생성 완료가 아닙니다. 반환된 taskId를 저장하고 같은 작업을 조회하세요. 결과를 기다리는 동안 작업을 다시 생성하지 마세요.
HTTP/1.1 202 Accepted
Location: /api/v1/jobs/recordInfo?taskId=job_01k3m8x9q2z4v7n5p6r8s0t1w3
{
"code": 200,
"msg": "success",
"request_id": "req_example_create",
"data": {
"taskId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
"state": "queued",
"estimatedCost": "0.750000"
}
}접수 응답에 이번 예상 비용이 포함되므로 앱의 작업 기록과 청구 화면에 같은 금액을 표시할 수 있습니다.
curl --get "https://api.spicyapi.ai/api/v1/jobs/recordInfo" \
--data-urlencode "taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"약 2초 간격으로 시작해서 점점 간격을 넓히세요. 종료 상태가 나오면 멈추고, 연결이 끊겼더라도 원래 taskId를 그대로 조회하세요. 다시 생성할 때는 처음에 쓴 Idempotency-Key와 본문을 그대로 써야 합니다.
import { verifyWebhook } from "@spicyapi/sdk";
// express.raw keeps the bytes we signed; express.json never matches.
app.post("/hooks/spicy", express.raw({ type: "application/json" }), (req, res) => {
const { payload } = verifyWebhook({
rawBody: req.body,
timestamp: req.header("X-Webhook-Timestamp"),
signature: req.header("X-Webhook-Signature"),
payloadVersion: Number(req.header("X-Webhook-Payload-Version")),
secret: process.env.SPICY_WEBHOOK_SECRET,
});
res.status(200).end();
void handleFinishedTask(payload);
});작업을 만들 때 callBackUrl을 넘기면 완료된 레코드가 POST로 전달됩니다 — 폴링 루프가 아예 필요 없습니다. 모든 전달에는 X-Webhook-Timestamp, X-Webhook-Signature, X-Webhook-Payload-Version이 함께 옵니다. 서명은 taskId.timestamp.sha256(body)에 대한 base64 HMAC-SHA256이므로 반드시 원본 바이트로 검증해야 합니다. JSON을 파싱했다가 다시 직렬화하면 바이트가 달라져 검증이 실패합니다. 실패한 전달은 재시도되므로 같은 taskId가 두 번 올 수 있습니다. 핸들러를 멱등하게 만드세요. 먼저 2xx로 답하고 처리는 그다음에 — 응답이 느리면 전달 실패로 간주됩니다.
state가 succeeded일 때만 output을 사용하세요. 실패 시 errorCode, errorMessage, request_id로 원인을 확인하세요. 예시 비용과 상태는 실제 청구 내역이 아닙니다.
{
"code": 200,
"msg": "success",
"request_id": "req_example_record",
"data": {
"taskId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
"model": "kling/o3/reference-to-video",
"state": "succeeded",
"output": {
"assets": [
{
"key": "tasks/2026/08/28/job_01k3m8x9q2z4v7n5p6r8s0t1w3/3f7a1c9e5b2d48f0a6c1e3d5b7f9a1c3.mp4",
"mime": "video/mp4",
"url": "https://example.r2.cloudflarestorage.com/results/job_01k3m8x9q2z4v7n5p6r8s0t1w3/result.mp4?X-Amz-Signature=SIGNATURE_FROM_RESPONSE",
"expiresAt": "2026-08-28T12:20:08.000Z"
}
]
},
"cost": "0.750000",
"settled": true,
"createdAt": "2026-08-28T12:00:00Z",
"completedAt": "2026-08-28T12:00:30Z"
}
}사용 가능한 파일은 assets[].url에서 바로 열거나 다운로드할 수 있으며 API Authorization 헤더가 필요하지 않습니다. 서명 URL은 expiresAt에 만료됩니다. 보관 기간 내에 작업을 다시 조회하면 URL이 갱신됩니다. 처리 중이거나 사용할 수 없는 파일에는 URL이 없습니다. 서명 URL은 비공개로 보관하세요.
앱, 터미널, AI 어시스턴트 또는 시각적 워크플로에서 SpicyAPI를 사용하세요. 원하는 설정 가이드를 선택하세요.
위 코드를 직접 쓸 필요는 없습니다. MCP 서버를 한 번만 연결해 두면 MCP를 지원하는 에이전트(Claude Code, Codex, Cursor, Windsurf, VS Code, Gemini CLI, Cline, LibreChat)가 이 모델을 이름으로 호출합니다. 셸에서 명령 한 줄로 실행할 수도 있습니다.
kling/o3/reference-to-video로 해 질 녘 네온이 켜진 옥상을 5초, 천천히 다가가는 컷으로 만들어서 ./out/에 저장해 줘.
에이전트가 공개 카탈로그에서 모델을 찾고, 로컬 파일을 대신 업로드한 뒤, 정확한 견적과 최대 청구액을 보여 주고 확인을 기다립니다. 승인하기 전에는 요금이 발생하지 않습니다.
claude mcp add spicyapi -e SPICY_API_KEY=$SPICY_API_KEY \
-- npx --yes --package=@spicyapi/mcp spicyapi-mcp
npx skills add spicyapi-ai/spicy-skill첫 줄은 도구를, 둘째 줄은 Skill을 넘겨줍니다. Skill은 그 도구를 다루는 규칙입니다 — 청구 전에 견적을 받고, 로컬 파일은 바이트를 붙여 넣는 대신 업로드하고, 완성된 산출물 URL을 추측하지 않고 읽습니다. 다른 클라이언트도 각자의 설정 파일로 같은 서버를 사용합니다. 개발자 페이지를 참고하세요.
npx @spicyapi/cli tasks create --model kling/o3/reference-to-video \
--input-json '{"aspect_ratio":"16:9","duration_seconds":5,"generate_audio":false,"prompt":"A slow aerial shot drifting over a misty pine forest at sunrise","reference_image_urls":["https://example.com/reference.png"],"resolution":"720p","shot_type":"single"}' \
--wait입력값은 위 예시와 마찬가지로 이 엔드포인트의 스키마에서 생성했습니다. --wait는 작업이 끝날 때까지 폴링해 결과를 출력하고, CI에서는 --yes로 확인 절차를 건너뜁니다. 먼저 SPICY_API_KEY를 설정하세요. API와 CLI, MCP 서버가 같은 키를 씁니다.
npx @spicyapi/cli tasks create --model kling/o3/reference-to-video \
--input-json '{…}' --retention 1h --wait
npx @spicyapi/cli tasks get $TASK_ID # read back the retention that applied--retention은 보관 기간을 줄이기만 합니다 — 30m, 1h, 7d, 또는 0이면 작업이 종료 상태에 도달하는 즉시 삭제됩니다. 실제로 적용되는 값은 요청과 계정 설정, 플랫폼 상한 중 가장 짧은 값이므로 요청한 숫자가 그대로 반영됐다고 가정하지 말고 작업 레코드에서 다시 읽으세요. 계정이 허용하는 것보다 긴 값을 넘기면 아무 일도 일어나지 않습니다.
ComfyUI Manager나 아래 명령으로 SpicyAPI 노드를 설치한 뒤 캔버스에서 Kling O3 · Reference to Video를 검색하세요. 노드는 이 페이지와 같은 옵션을 제공하며, 실행하기 전에 가격을 보여 줍니다.
cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi삽입된 패널은 이 페이지와 같은 스키마를 참조하므로 API 사양과 어긋나지 않습니다. 문서 검색 대상에 포함하려면 /api/embed/models/의 JSON을 받아 직접 렌더링하세요.
<iframe src="https://spicyapi.ai/embed/ko/models/kling-o3/api?model=kling%2Fo3%2Freference-to-video" width="100%" height="560" loading="lazy" title="요청 예시" style="border:1px solid rgba(0,0,0,.12)"></iframe>