Skip to content

任务:视频特效-单图

说明:以下内容为原始 OpenAPI 规范(不删减),样式做简要整理,保留全部字段和描述。


原始 OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /kling/v1/videos/effects:
    post:
      summary: 任务:视频特效-单图
      deprecated: false
      description: ''
      tags:
        - 视频模型(Video)/快手可灵AI
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              title: 通用请求体
              description: |-
                根据 effect_scene 实现不同的特效效果。
                - 单图特效:fuzzyfuzzy、squish、expansion
                - 双人互动特效:hug、kiss、heart_gesture
              type: object
              properties:
                effect_scene:
                  type: string
                  title: 场景名称
                  description: |
                    特效场景名称
                  enum:
                    - fuzzyfuzzy
                    - squish
                    - expansion
                  x-apifox-enum:
                    - value: fuzzyfuzzy
                      name: 快来惹毛我
                      description: ''
                    - value: squish
                      name: 捏捏乐
                      description: ''
                    - value: expansion
                      name: 万物膨胀
                      description: ''
                input:
                  title: 任务输入结构体
                  description: 支持不同任务输入的结构体。根据 scene 不同,结构体里传的字段不同,具体见「场景请求体」说明。
                  type: object
                  x-apifox-orders:
                    - model_name
                    - image
                    - duration
                  properties:
                    duration:
                      type: string
                      title: 视频时长
                      description: 单位 秒
                      enum:
                        - '5'
                      x-apifox-enum:
                        - value: '5'
                          name: ''
                          description: ''
                    image:
                      type: string
                      description: >-
                        参考图像


                        支持传入图片Base64编码或图片URL(确保可访问)

                        请注意,若您使用base64的方式,请确保您传递的所有图像数据参数均采用Base64编码格式。在提交数据时,请不要在Base64编码字符串前添加任何前缀,例如data:image/png;base64,。正确的参数格式应该直接是Base64编码后的字符串。

                        示例:

                        正确的Base64编码参数:

                        1

                        iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==

                        错误的Base64编码参数(包含data:前缀):

                        1

                        data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==

                        请仅提供Base64编码的字符串部分,以便系统能够正确处理和解析您的数据。

                        图片格式支持.jpg / .jpeg / .png

                        图片文件大小不能超过10MB,图片分辨率不小于300*300px,图片宽高比要在1:2.5 ~ 2.5:1之间
                    model_name:
                      type: string
                      title: 模型名称
                      description: 注意:单人特效仅支持 `kling-v1-6`
                      enum:
                        - kling-v1-6
                      x-apifox-enum:
                        - value: kling-v1-6
                          name: ''
                          description: ''
                  required:
                    - duration
                    - image
                    - model_name
                callback_url:
                  title: 任务结果回调通知地址
                  description: >-
                    本次任务结果回调通知地址,如果配置,服务端会在任务状态发生变更时主动通知。具体通知的消息 schema
                    见Callback 协议。
                  type: string
                external_task_id:
                  title: 自定义任务 ID
                  description: 用户自定义任务 ID,传入不会覆盖系统生成的任务 ID,但支持通过该 ID 进行任务查询。单用户下需要保证唯一性。
                  type: string
              required:
                - effect_scene
                - input
              x-apifox-orders:
                - effect_scene
                - input
                - callback_url
                - external_task_id
            example:
              effect_scene: expansion
              input:
                model_name: kling-v1-6
                image: >-
                  https://p1-kling.klingai.com/bs2/upload-ylab-stunt/kling/ai_se/%E8%86%A8%E8%83%80case-%E8%B7%AF%E4%B8%8A%E7%BA%A2%E8%89%B2%E6%B1%BD%E8%BD%A6.jpg?x-kcdn-pid=112452&x-oss-process=image
                duration: '5'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  request_id:
                    type: string
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                      task_status:
                        type: string
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                      task_result:
                        type: object
                        properties:
                          images:
                            type: array
                            items:
                              type: object
                              properties:
                                url:
                                  type: string
                                index:
                                  type: integer
                              x-apifox-orders:
                                - url
                                - index
                          videos:
                            type: 'null'
                        required:
                          - images
                          - videos
                        x-apifox-orders:
                          - images
                          - videos
                      task_status_msg:
                        type: string
                      action:
                        type: string
                      status:
                        type: string
                      fail_reason:
                        type: string
                      submit_time:
                        type: integer
                      start_time:
                        type: integer
                      finish_time:
                        type: integer
                      progress:
                        type: string
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                          created_at:
                            type: integer
                          updated_at:
                            type: integer
                          task_result:
                            type: object
                            properties:
                              images:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    url:
                                      type: string
                                    index:
                                      type: integer
                                  x-apifox-orders:
                                    - url
                                    - index
                              videos:
                                type: 'null'
                            required:
                              - images
                              - videos
                            x-apifox-orders:
                              - images
                              - videos
                          task_status:
                            type: string
                          task_status_msg:
                            type: string
                        required:
                          - task_id
                          - created_at
                          - updated_at
                          - task_result
                          - task_status
                          - task_status_msg
                        x-apifox-orders:
                          - task_id
                          - created_at
                          - updated_at
                          - task_result
                          - task_status
                          - task_status_msg
                    required:
                      - task_id
                      - task_status
                      - created_at
                      - updated_at
                      - task_result
                      - task_status_msg
                      - action
                      - status
                      - fail_reason
                      - submit_time
                      - start_time
                      - finish_time
                      - progress
                      - data
                    x-apifox-orders:
                      - task_id
                      - action
                      - status
                      - fail_reason
                      - submit_time
                      - start_time
                      - finish_time
                      - progress
                      - data
                      - created_at
                      - updated_at
                      - task_result
                      - task_status
                      - task_status_msg
                  '':
                    type: string
                required:
                  - code
                  - message
                  - data
                  - request_id
                  - ''
                x-apifox-orders:
                  - code
                  - message
                  - data
                  - request_id
                  - ''
              example:
                code: 0
                message: SUCCEED
                request_id: CmYgjmbyMToAAAAAAF6svw
                data:
                  task_id: CmYgjmbyMToAAAAAAF6svw
                  task_status: submitted
                  created_at: 1727338013674
                  updated_at: 1727338013674
          headers: {}
          x-apifox-name: 成功
      security:
        - bearer: []
      x-apifox-folder: 视频模型(Video)/快手可灵AI
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5076588/apis/api-285197745-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.gpt.ge
    description: 线上
security:
  - bearer: []