> ## 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/cn/视频生成sora兼容格式/创建视频)）。

Kling 4.0 原生任务接口。使用本站 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与至少一个支持的媒体。历史首尾帧场景可传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/cn/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: 视频生成Seedance格式
  - name: 视频生成Sora兼容格式
  - name: 视频生成Vidu格式
  - name: 音乐生成任务格式
paths:
  /omni-video/kling-4.0:
    post:
      tags:
        - 视频生成Kling格式
      summary: Kling 全能参考
      description: >-
        该系列支持OpenAI视频生成格式（详见链接
        [视频生成Sora兼容格式](/api-reference/cn/视频生成sora兼容格式/创建视频)）。


        Kling 4.0 原生任务接口。使用本站 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与至少一个支持的媒体。历史首尾帧场景可传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。各媒体数量限制见接口说明。历史首尾帧请求按当前可用模型能力校验；首尾帧新接入推荐图生视频入口。
                  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.