API reference
🇺🇸 English
  • 🇨🇳 Chinese
  • 🇺🇸 English
  1. Kling-API
API reference
🇺🇸 English
  • 🇨🇳 Chinese
  • 🇺🇸 English
  • Chat Models
    • Chat
      • Create chat completion
      • vision
    • OpenAI-Realtime
    • Completions
      • Instruct
    • Audio
      • Transcriptions
      • Translations
      • Speech
    • Image generation
      • DALL·E 3
    • Embeddings
      • Create
    • Models
      • model list
    • Help
      • 常见问题及解决办法
  • Anthropic
    • Anthropic Claude
      POST
  • Suno
    • Generate music
      POST
    • Generate lyrics
      POST
    • Upload music
      POST
    • Music concat
      POST
    • Fetch task
      GET
    • Fetch batch tasks
      POST
  • Udio
    • Generate music
      POST
    • Fetch task
      GET
  • Midjourney API
    • Quick
    • Task Submit
      • Imagine
      • Action
      • Modal
      • Blend
      • Describe
      • Shorten
      • Upload discord
    • Get Task
      • Fetch task by ids
      • Fetch task by id
      • Get seed
  • Flux
    • Official
      • Generate
      • Finetune
      • Fetch task
    • OpenAI Dalle3
  • Recraft
    • Official
      • Generate Image
      • Vectorize Image
      • Remove Background
      • Clarity Upscale
      • Generative Upscale
      • Create style
    • OpenAI Dalle3
  • Ideogram
    • Generate
    • Remix
    • Edit
    • Upscale
    • Describe
  • Luma
    • Official
      • Generate
      • Fetch task
    • Own format
      • Submit
        • Generate
        • Get video of no mark
        • 扩展视频
      • Get task
        • Get task
        • Get batch task
  • Runway
    • Official
      • image to video
      • get task
    • reverse
      • text to video
      • image to video
      • video2video
      • Act-one
      • Get task
  • Kling-API
    • Callback
    • Generate image
      POST
    • Text 2 Video
      POST
    • Image 2 Video
      POST
    • Video extend
      POST
    • Get task
      GET
    • lip-sync
      POST
    • kolors-virtual-try-on
      POST
  • Replicate
    • Generate
    • Get
  • MiniMax
    • Generate video
    • Get task
    • Get file
  1. Kling-API

Callback

📌
对于异步任务(图像生成 / 视频生成),若您在创建任务时主动设置了callback_url,则当任务状态发生变更时、服务端会主动通知,协议如下
{
  "task_id": "string", //任务ID,系统生成
  "task_status": "string", //任务状态,枚举值:submitted(已提交)、processing(处理中)、succeed(成功)、failed(失败)
  "task_status_msg": "string", //任务状态信息,当任务失败时展示失败原因(如触发平台的内容风控等)
  "created_at": 1722769557708, //任务创建时间,Unix时间戳、单位ms
  "updated_at": 1722769557708, //任务更新时间,Unix时间戳、单位ms
  "task_result":{
  	"images":[ //图片类任务的结果
      {
        "index": int, //图片编号,0-9
        "url": "string" //生成图片的URL,例如:https://h1.inkwai.com/bs2/upload-ylab-stunt/1fa0ac67d8ce6cd55b50d68b967b3a59.png
      }
    ],
    "videos":[ //视频类任务的结果
  		{
        "id": "string", //视频ID;全局唯一
    		"url": "string", //视频的URL
        "duration": "string" //视频总时长,单位s
      }
  	]
	}
}
Previous
Get task
Next
Generate image
Built with