curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "kling-4.0-long-image",
"input": {
"prompt": "Design a long image for a specialty coffee brand's official website, including the hero section, product showcase, roasting philosophy, store information, and footer. Follow the visual style of @StyleImage.",
"skill": "webpage",
"style_image_url": "https://example.com/style-reference.png",
"resolution": "2K"
}
}
EOF
{
"code": 200,
"data": {
"task_id": "task-unified-1794470400-abcd1234",
"status": "not_started",
"created_time": "2026-11-12T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Kling
Kling Image 4.0 Long Image
Kling Image 4.0 Long Image API 根据提示词把完整的网页或电商商品详情页设计成一张长图,可选商品图、风格参考图和主体参考图。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "kling-4.0-long-image",
"input": {
"prompt": "Design a long image for a specialty coffee brand's official website, including the hero section, product showcase, roasting philosophy, store information, and footer. Follow the visual style of @StyleImage.",
"skill": "webpage",
"style_image_url": "https://example.com/style-reference.png",
"resolution": "2K"
}
}
EOF
{
"code": 200,
"data": {
"task_id": "task-unified-1794470400-abcd1234",
"status": "not_started",
"created_time": "2026-11-12T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
kling-4.0-long-image 把完整的网站页面或电商商品详情页设计成一张长图,从首屏一直到页脚。适合落地页样稿、网站改版方案和网店商品详情页。Kling Image 4.0 Long Image 属于快手 Kling Image 4.0 系列。
模型
- kling-4.0-long-image — 网页和电商商品详情页的长图设计
功能
- 网页设计:在一张长图中呈现完整的网站版式,例如首屏、产品展示、品牌故事和页脚等区块。
- 电商商品详情页:围绕 1 到 3 张商品图设计,页面长度可选 short、medium 或 long。
- 网页设计支持风格参考图(
@StyleImage)和主体参考图(@SubjectImage)。 - 输出
1K(1024 像素宽)或2K(2048 像素宽),高度随内容变化。 - 输出 PNG。
输入模式
- 网页(
skill:webpage,默认)— 在prompt中描述网站及其各个区块。可选传入style_image_url,让设计沿用它的视觉与版式风格(@StyleImage);传入subject_image_url,让设计围绕图中的主体展开(@SubjectImage)。 - 电商(
skill:ecommerce)— 在image_urls中传入 1 到 3 张商品图(@Image1、@Image2、@Image3),并在prompt中描述详情页。用length选择页面长度。
必填参数
prompt(string):描述页面及其各个区块的提示词,1–50,000 个字符,必须包含非空白文本。用@Image1、@Image2、@Image3指代商品图,用@StyleImage指代风格参考图,用@SubjectImage指代主体参考图。
可选参数
skill(string):webpage或ecommerce。默认为webpage。image_urls(array of strings):ecommerce的商品图,1 到 3 个可公开访问的 HTTP(S) 图片 URL,该模式下必填。每张图片不超过 30 MB,宽和高至少 300 像素,宽高比(宽 / 高)在 0.4 到 2.5 之间。style_image_url(string):webpage的风格参考图 URL。设计会沿用它的视觉与版式风格。subject_image_url(string):webpage的主体参考图 URL。设计会围绕图中的主体展开。length(string):ecommerce的页面长度:short(约 2–5 个区块)、medium(约 6–10 个区块)或long(约 11–18 个区块)。默认为medium。resolution(string):1K或2K。默认为1K。
输出
- 在
files中返回一张 PNG 长图。1K时宽 1024 像素,2K时宽 2048 像素;高度取决于内容和页面长度。 - 示例:
1K的webpage设计约为 1024×5848;2K的ecommercelong页面可达 2048×54941(约 87 MB)。
示例
网页
参照参考图风格设计的咖啡品牌网站:{
"model": "kling-4.0-long-image",
"input": {
"prompt": "Design a long image for a specialty coffee brand's official website, including the hero section, product showcase, roasting philosophy, store information, and footer. Follow the visual style of @StyleImage.",
"skill": "webpage",
"style_image_url": "https://example.com/style-reference.png",
"resolution": "2K"
}
}
电商详情页
根据一张商品图生成的中等长度商品详情页:{
"model": "kling-4.0-long-image",
"input": {
"prompt": "Design a product detail page for the insulated water bottle in @Image1: hero shot, key features, capacity and size, materials, and lifestyle scenes.",
"skill": "ecommerce",
"image_urls": ["https://example.com/water-bottle.png"],
"length": "medium",
"resolution": "1K"
}
}
注意事项
image_urls和length用于skill为ecommerce的请求;style_image_url和subject_image_url用于skill为webpage的请求。- 即使只有一张图,
image_urls也必须是数组。 - 每次请求生成一张图片。
- 长图通常需要约 2 到 12 分钟:网页设计和
1K电商页面约 2 到 4 分钟,2K的long电商页面最长约 12 分钟。请使用callback_url或轮询查询任务状态直到任务完成。 - 如需生成普通图片、编辑图片或生成组图,请使用 Kling Image 4.0。
授权
所有 API 接口都需要 Bearer Token 认证。
创建 API Key:登录 PoYo,进入 仪表盘 → API 密钥(poyo.ai/zh/dashboard/api-key),点击创建 Key。
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
响应
任务提交成功
业务状态码。200 表示成功,其他值都表示请求失败。请务必检查这个字段:部分参数校验错误会以 HTTP 200 返回,响应体里的 code 为 400。
200:成功400:请求参数无效401:API Key 缺失或无效402:积分不足403:没有权限404:资源不存在408:请求超时429:请求频率超限500:服务器内部错误502:上游服务错误503:服务暂不可用
详见错误码。
可用选项:
200, 400, 401, 402, 403, 404, 408, 429, 500, 502, 503 示例:
200