Skip to main content
POST
cURL

이미지 생성

전체 파라미터 참조는 Kling 공식 문서를 확인하세요.
이 엔드포인트를 사용해 Kling의 이미지 생성 API로 정지 이미지를 만들 수 있습니다. 동일한 비동기 작업 흐름을 통해 텍스트 전용 요청과 이미지 참조 요청을 모두 지원합니다.

첫 요청

model_name: kling-v3, prompt, n, aspect_ratio부터 시작하세요. 첫 요청이 사용 가능한 작업을 반환한 뒤에만 참조 이미지, fidelity 제어 또는 고급 필드를 추가하세요. model_name을 생략하면 레거시 호환 기본값이 사용되므로, 새로운 통합에서는 kling-v3를 명시적으로 보내세요.

응답 읽기

반환된 task_id를 저장한 다음, task_status가 종료 상태에 도달할 때까지 해당하는 Kling 이미지 조회 경로를 폴링하세요. 워크플로에 내구성 있는 저장소가 필요하다면, 생성이 완료된 후 최종 결과물을 자체 저장 계층으로 복사하세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

헤더

Content-Type
string
기본값:application/json

Must be application/json.

본문

application/json
prompt
string
필수

Text prompt describing the image to generate. Maximum 2500 characters.

model_name
enum<string>
기본값:kling-v1

Kling image model variant. Use kling-v3 for new requests. Omitting model_name uses the legacy CometAPI route default.

사용 가능한 옵션:
kling-v1,
kling-v1-5,
kling-v2,
kling-v2-1,
kling-v3
negative_prompt
string

Elements to exclude from the image. Maximum 2500 characters. Not supported when image is provided.

image
string

Reference image as a raw Base64 string without a data: prefix, or a public URL. Accepted formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1.

image_reference
enum<string>

Reference mode for legacy image-to-image requests when image is provided.

사용 가능한 옵션:
subject,
face
image_fidelity
number
기본값:0.5

How closely the output follows the reference image. Range: 0-1. Used by legacy image-reference models.

필수 범위: 0 <= x <= 1
human_fidelity
number
기본값:0.45

Human-subject fidelity control. Range: 0-1. Used only by legacy subject-reference requests.

필수 범위: 0 <= x <= 1
element_list
object[]

Optional Kling element references. The total count of element references and input images must not exceed 10.

resolution
enum<string>
기본값:1k

Output resolution. Defaults to 1k.

사용 가능한 옵션:
1k,
2k
n
integer
기본값:1

Number of images to generate. Range: 1-9.

필수 범위: 1 <= x <= 9
aspect_ratio
enum<string>
기본값:16:9

Output aspect ratio (width:height).

사용 가능한 옵션:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9
watermark_info
object

Watermark options.

callback_url
string

Webhook URL to receive task status updates when the task completes.

external_task_id
string

Optional user-defined task ID for your own tracking. Must be unique per account.

응답

200 - application/json

Task request accepted or an error response returned by the API.

code
필수

Response code. 0 means the task request was accepted.

message
string
필수

Response message.

data
object
필수
request_id
string

Request identifier returned when present.