Skip to main content
POST
cURL
このエンドポイントを使用すると、CometAPI を通じて非同期の Kling Omni Image タスクを作成できます。作成リクエストでは task_id が返されます。 Kling Omni 画像タスクを取得 を使用して、生成された画像 URL が利用可能になるまでタスクをポーリングします。
プロバイダーのパラメータに関する完全なリファレンスについては、 Kling Image O1 のドキュメント.

リクエスト形式を選択

  • 単一画像生成: promptimage_listresolutionresult_type: singlen、および aspect_ratio を送信します
  • 透かし付き出力: クエリレスポンスで透かし付き結果 URL が必要な場合は、watermark_info.enabled: true を追加します
  • モデル ID: ルートのデフォルトを使用するには model_name を省略するか、kling-image-o1kling-v3-omni など、テスト済みの Omni Image モデル ID を送信します
参照画像には image_list の項目を使用し、各項目に image フィールドを含めます。プロンプトからはインデックスで参照でき、たとえば最初の項目には <<<image_1>>>、2 番目の項目には <<<image_2>>> を使用します。

タスクフロー

1

タスクを作成

POST /kling/v1/images/omni-image を送信し、返された data.task_id を保存します。
2

タスクを照会

次の GET /kling/v1/images/omni-image/ を、data.task_statussucceed または failed になるまでポーリングします。
3

画像を永続保存

タスクが成功したら、永続的なアクセスが必要な場合は data.task_result.images[].url を自身のストレージにコピーします。
完全なレスポンススキーマとタスクステータスの詳細については、 Kling Omni 画像タスクを取得を参照してください。次のリクエストは、1 つのタスクを一度だけ照会します。

結果フィールド

成功したクエリレスポンスでは、生成画像が data.task_result.images に返されます。各項目には次の内容を含めることができます。 生成されたアセット URL は期限切れになるか、プロバイダーサービスによって削除される場合があります。ワークフローで長期保存が必要な場合は、完成した画像を自身のストレージ層に保存してください。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI API key.

ヘッダー

Content-Type
string

Must be application/json.

ボディ

application/json
prompt
string
必須

Text prompt for the generated image. The prompt can reference images with <<<image_1>>>, <<<image_2>>>, and matching indexes from image_list. Maximum length is 2,500 characters.

model_name
string

Optional model ID for this Omni Image request. Omit this field to use the route default.

image_list
object[]

Reference images that the prompt can cite with <<<image_1>>>, <<<image_2>>>, and so on. Keep the total number of reference images within the provider limits for the selected model.

resolution
enum<string>
デフォルト:1k

Requested output resolution. Use 1k, 2k, or 4k; omitted requests use 1k.

利用可能なオプション:
1k,
2k,
4k
result_type
enum<string>
デフォルト:single

Use single for a single-image task.

利用可能なオプション:
single
n
integer
デフォルト:1

Number of single-image results to generate. Range: 1 to 9.

必須範囲: 1 <= x <= 9
aspect_ratio
enum<string>
デフォルト:auto

Requested output aspect ratio in width:height format. Use auto to let the provider choose from the prompt and references.

利用可能なオプション:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9,
auto
watermark_info
object

Watermark options. When enabled is true, the task can return watermarked result URLs in addition to the original result URLs.

callback_url
string<uri>

Webhook URL that receives task status notifications when the task status changes. Omit this field to poll manually.

external_task_id
string

User-defined task ID for your own tracking. It does not replace the system-generated task_id and must be unique per account.

レスポンス

200 - application/json

Task accepted.

code
integer
必須

Response code. 0 means the task request was accepted.

message
string
必須

Response message.

data
object
必須
request_id
string

Request identifier returned by CometAPI when present.

最終更新日 2026年7月31日