> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiid.edu.kg/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling オールインワンリファレンス

> このシリーズはOpenAIの動画生成形式をサポートしています（詳細はリンク [動画生成Sora互換形式](/api-reference/ja/video-generation-sora-compatible-format/create-video) を参照してください）。

Kling 4.0 ネイティブタスクAPI。本サイトの Bearer API Key を使用して認証します。リクエスト本文に model は不要です。settings.resolution=720p では kling-4.0、1080p では kling-4.0-1080p を使用し、デフォルトは1080pです。作成後、返された data.id を使用して GET /tasks?task_ids=タスクID を呼び出します。複数のIDはカンマで区切ります。照会結果の data は配列で、生成された動画は data[].outputs[].url にあります。

現在、プロンプト、first_frame、last_frame、refer_image、feature_video に対応する生成シナリオをサポートしています。middle_frame、base_video、element、voice、音声参照、コールバック、またはカスタム外部タスクIDはサポートしていません。空でないoptions.callback_url、空でないoptions.external_task_id、空でないcontents.id、およびその他の未サポートのフィールドは400を返します。optionsは省略するか空のオブジェクトを指定でき、watermark_info.enabled=falseを指定することもできます。ウォーターマークの有効化は現在サポートされていません。現在、動画の長さは4～30秒をサポートし、デフォルトは10秒です。3秒はサポートされていません。テキスト生成および参照シナリオのアスペクト比はデフォルトで16:9です。adaptiveを明示的に指定すると400が返されます。先頭・末尾フレームのシナリオでは、settings.aspect_ratioを明示的に指定できません。アスペクト比は最初のframe画像のサイズによって決まります。

汎用参照の contents には、空でない prompt と、サポートされているメディアを少なくとも 1 つ含める必要があります。従来の開始・終了フレームのシナリオでは first_frame、last_frame、または両方を指定できますが、処理可否は現在利用可能なモデルの機能に準拠します。機能が一致しない場合はリクエストが拒否され、フレーム画像が通常の参照画像に暗黙的に変換されることはありません。開始・終了フレームを新規に統合する場合は、画像から動画を生成するエンドポイントの使用を推奨します。開始・終了フレームは、refer_image の参照画像または feature_video の参照動画と併用できません。併用すると 400 が返されます。参照シナリオでは、refer_image の参照画像と feature_video の参照動画を組み合わせることができます。first_frame、last_frame、refer_image はそれぞれ最大 1 件、feature_video は最大 5 件指定できます。id を参照する複数参照画像のシナリオは、現在サポートされていません。



## OpenAPI

````yaml api-reference/ja/openapi.json POST /omni-video/kling-4.0
openapi: 3.0.0
info:
  title: 出海营 API 参考ドキュメント
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: OpenAI形式(Chat)
  - name: OpenAI形式（Responses）
  - name: 画像生成Gemini形式
  - name: 画像生成OpenAI DALL-E形式
  - name: モデル一覧の取得
  - name: 動画生成HappyHorseとWan
  - name: 動画生成Kling形式
  - name: 動画生成OmniとVeo形式
  - name: Video generation Seedance
  - name: 動画生成Sora対応形式
  - name: Video generation Vidu
  - name: 音楽生成タスクの形式
paths:
  /omni-video/kling-4.0:
    post:
      tags:
        - 動画生成Kling形式
      summary: Kling オールインワンリファレンス
      description: >-
        このシリーズはOpenAIの動画生成形式をサポートしています（詳細はリンク
        [動画生成Sora互換形式](/api-reference/ja/video-generation-sora-compatible-format/create-video)
        を参照してください）。


        Kling 4.0 ネイティブタスクAPI。本サイトの Bearer API Key を使用して認証します。リクエスト本文に model
        は不要です。settings.resolution=720p では kling-4.0、1080p では kling-4.0-1080p
        を使用し、デフォルトは1080pです。作成後、返された data.id を使用して GET /tasks?task_ids=タスクID
        を呼び出します。複数のIDはカンマで区切ります。照会結果の data は配列で、生成された動画は data[].outputs[].url
        にあります。


        現在、プロンプト、first_frame、last_frame、refer_image、feature_video
        に対応する生成シナリオをサポートしています。middle_frame、base_video、element、voice、音声参照、コールバック、またはカスタム外部タスクIDはサポートしていません。空でないoptions.callback_url、空でないoptions.external_task_id、空でないcontents.id、およびその他の未サポートのフィールドは400を返します。optionsは省略するか空のオブジェクトを指定でき、watermark_info.enabled=falseを指定することもできます。ウォーターマークの有効化は現在サポートされていません。現在、動画の長さは4～30秒をサポートし、デフォルトは10秒です。3秒はサポートされていません。テキスト生成および参照シナリオのアスペクト比はデフォルトで16:9です。adaptiveを明示的に指定すると400が返されます。先頭・末尾フレームのシナリオでは、settings.aspect_ratioを明示的に指定できません。アスペクト比は最初のframe画像のサイズによって決まります。


        汎用参照の contents には、空でない prompt と、サポートされているメディアを少なくとも 1
        つ含める必要があります。従来の開始・終了フレームのシナリオでは
        first_frame、last_frame、または両方を指定できますが、処理可否は現在利用可能なモデルの機能に準拠します。機能が一致しない場合はリクエストが拒否され、フレーム画像が通常の参照画像に暗黙的に変換されることはありません。開始・終了フレームを新規に統合する場合は、画像から動画を生成するエンドポイントの使用を推奨します。開始・終了フレームは、refer_image
        の参照画像または feature_video の参照動画と併用できません。併用すると 400
        が返されます。参照シナリオでは、refer_image の参照画像と feature_video
        の参照動画を組み合わせることができます。first_frame、last_frame、refer_image はそれぞれ最大 1
        件、feature_video は最大 5 件指定できます。id を参照する複数参照画像のシナリオは、現在サポートされていません。
      operationId: create_kling4_native_omni_video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - contents
              properties:
                settings:
                  type: object
                  additionalProperties: false
                  properties:
                    resolution:
                      type: string
                      enum:
                        - 720p
                        - 1080p
                      default: 1080p
                    duration:
                      type: integer
                      minimum: 4
                      maximum: 30
                      default: 10
                    aspect_ratio:
                      type: string
                      enum:
                        - '21:9'
                        - '16:9'
                        - '9:16'
                        - '1:1'
                options:
                  type: object
                  additionalProperties: false
                  description: 省略するか、空のオブジェクトを渡すか、ウォーターマークを明示的に無効化できます。
                  properties:
                    watermark_info:
                      type: object
                      additionalProperties: false
                      required:
                        - enabled
                      properties:
                        enabled:
                          type: boolean
                          enum:
                            - false
                contents:
                  type: array
                  minItems: 2
                  description: >-
                    空でないpromptとサポート対象のメディアを同時に含める必要があります。画像から動画生成ではfirst_frameが必須です。first_frame/last_frameはrefer_image/feature_videoと併用できません。併用した場合は400が返されます。各メディアの数量制限については、API仕様を参照してください。従来の先頭・末尾フレームリクエストは、現在利用可能なモデルの機能に基づいて検証されます。先頭・末尾フレームの新規連携には、画像から動画生成エンドポイントの使用を推奨します。
                  items:
                    oneOf:
                      - type: object
                        additionalProperties: false
                        required:
                          - type
                          - text
                        properties:
                          type:
                            type: string
                            enum:
                              - prompt
                          text:
                            type: string
                            minLength: 1
                      - type: object
                        additionalProperties: false
                        required:
                          - type
                          - url
                        properties:
                          type:
                            type: string
                            enum:
                              - first_frame
                              - last_frame
                              - refer_image
                              - feature_video
                          url:
                            type: string
                            format: uri
                            pattern: ^https?://
                  not:
                    items:
                      properties:
                        type:
                          enum:
                            - prompt
              oneOf:
                - description: >-
                    過去の開始・終了フレーム互換シナリオ：first_frame、last_frame、または両方。現在利用可能なモデルの機能により制限されます。参照素材を混在させないでください。aspect_ratioを省略した場合、画角は最初のframeに従います。
                  properties:
                    contents:
                      items:
                        properties:
                          type:
                            enum:
                              - prompt
                              - first_frame
                              - last_frame
                    settings:
                      not:
                        required:
                          - aspect_ratio
                - description: >-
                    参考シナリオ：refer_image と feature_video
                    は組み合わせて使用でき、アスペクト比はデフォルトで16:9です。
                  properties:
                    contents:
                      items:
                        properties:
                          type:
                            enum:
                              - prompt
                              - refer_image
                              - feature_video
                    settings:
                      properties:
                        aspect_ratio:
                          type: string
                          enum:
                            - '21:9'
                            - '16:9'
                            - '9:16'
                            - '1:1'
                          default: '16:9'
            examples:
              kling4_native_720p:
                summary: Kling 720p
                value:
                  settings:
                    resolution: 720p
                    duration: 10
                    aspect_ratio: '16:9'
                  options: {}
                  contents:
                    - type: prompt
                      text: A cinematic product shot with natural motion
                    - type: refer_image
                      url: https://example.com/reference.jpg
                    - type: feature_video
                      url: https://example.com/motion.mp4
              kling4_native_1080p:
                summary: Kling 1080p
                value:
                  settings:
                    resolution: 1080p
                    duration: 10
                    aspect_ratio: '16:9'
                  options: {}
                  contents:
                    - type: prompt
                      text: A cinematic product shot with natural motion
                    - type: refer_image
                      url: https://example.com/reference.jpg
                    - type: feature_video
                      url: https://example.com/motion.mp4
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - request_id
                  - data
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                  request_id:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: 本サイトのタスクID。照会時にそのまま渡します。
                      status:
                        type: string
                        enum:
                          - submitted
                          - processing
                          - succeeded
                          - failed
                      create_time:
                        type: integer
                        format: int64
                        description: 作成時刻（Unixミリ秒）。
                      update_time:
                        type: integer
                        format: int64
                        description: 更新時刻（Unixミリ秒）。
                      external_id:
                        type: string
                        maxLength: 0
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: SUCCEED
                    request_id: request_example
                    data:
                      id: task_example
                      status: submitted
                      create_time: 1792710000000
                      update_time: 1792710000000
                      external_id: ''
        '400':
          description: リクエストパラメータが無効であるか、サポートされていないフィールドが含まれています。
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Bearer Token を使用して認証します。
        形式: `Authorization: Bearer sk-xxxxxx`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.