PixVerse V6 首尾帧/转场
本页由 ModelFold 文档站根据上游官方 OpenAPI 文档同步生成。接口路径、参数、示例与官方保持一致;品牌与 API 域名已替换为 ModelFold。
接口
POST /jobs/createTask
完整 URL: https://ai.modelfold.online/v1/jobs/createTask
鉴权:所有请求都需要
Authorization: Bearer <API_KEY>请求头。
查询任务状态
提交任务后,可通过统一的查询接口查看任务进度并获取结果:
- [Get Task Details](/market/common/get-task-detail) — 了解如何查询任务状态并获取生成结果
TIP
生产环境中,建议使用 callBackUrl 参数接收生成完成的自动通知,而非轮询状态接口。
TIP
开启音频价格更高。当前价格见 ai.modelfold.online/pricing。
## 相关资源
- [Market Overview](/market/quickstart) — 浏览所有可用模型
- [Common API](/common-api/get-account-credits) — 查看账户积分与使用情况
请求参数
请求体 (application/json)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 生成任务的模型名称。必填字段。 默认值:"pixverse-v6/transition"。 可选值:pixverse-v6/transition。 示例:pixverse-v6/transition。 |
callBackUrl | string | 否 | 用于在生成任务完成时接收通知的回调 URL。选填,但建议在生产环境中使用。 - 任务生成后,系统将通过 POST 请求将任务状态和结果推送到此 URL - 回调内容包括生成内容的 URL 和任务相关信息 - 您的回调 API 必须支持 POST 请求和 JSON 格式的请求体 - 或者,您可以通过调用任务详情 API 主动轮询任务状态 示例: https://example.com/callback。 |
input | object | 是 | 生成任务的输入参数 |
input.prompt | string | 是 | 生成提示词,不能为空,长度限制为 3–5000 个字符。 示例:A cat walking on the beach at sunset。 |
input.duration | integer | 是 | 必填。生成视频时长,单位秒 示例:5。 |
input.quality | string | 是 | 必填。清晰度。 可选值:360p / 540p / 720p / 1080p。 示例:1080p。 |
input.generate_audio_switch | boolean | 否 | 是否生成音频。 示例:false。 |
input.seed | integer | 否 | 随机种子,可选。范围 0-2147483647。 示例:42。 |
input.first_frame_image_url | string | 是 | 首帧图片 URL,必填。支持 HTTP、HTTPS 和 OSS 地址,图片格式支持 JPG、JPEG、PNG 和 WebP,单个图片文件大小不超过 20 MB。 示例:https://example.com/first_frame.jpg。 |
input.last_frame_image_url | string | 是 | 尾帧图片 URL,必填。支持 HTTP、HTTPS 和 OSS 地址,图片格式支持 JPG、JPEG、PNG 和 WebP,单个图片文件大小不超过 20 MB。 示例:https://example.com/last_frame.jpg。 |
请求示例
bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "pixverse-v6/transition",
"input": {
"prompt": "Create a smooth transition from the first scene to the final scene",
"first_frame_image_url": "https://example.com/first-frame.png",
"last_frame_image_url": "https://example.com/last-frame.png",
"duration": 5,
"quality": "720p",
"generate_audio_switch": false,
"seed": 123456
},
"callBackUrl": "https://example.com/ModelFold/callback"
}'json
{
"model": "pixverse-v6/transition",
"input": {
"prompt": "Create a smooth transition from the first scene to the final scene",
"first_frame_image_url": "https://example.com/first-frame.png",
"last_frame_image_url": "https://example.com/last-frame.png",
"duration": 5,
"quality": "720p",
"generate_audio_switch": false,
"seed": 123456
},
"callBackUrl": "https://example.com/ModelFold/callback"
}响应
200 —
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | 请求状态码。请求失败时 HTTP 状态仍为 200,请始终以本字段判断:200 表示成功,其他值均表示失败,原因见 msg。常见值:401 API key 无效或缺失;402 积分不足;429 超出频率限制;422 或 500 请求未能处理(请先查看 msg、检查参数,再决定是否重试)。 可选值:200 / 401 / 402 / 404 / 422 / 429 / 433 / 455 / 500 / 501 / 505。 示例:200。 |
msg | string | 是 | 响应消息,失败时的错误描述 |
data | object | 是 | — |
data.taskId | string | 是 | 可以使用任务 ID 与“获取任务详细信息”端点一起查询任务状态。 |
json
{
"id": "task_1234567890abcdef"
}500 — Server error.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | Response status code - 200: Success - Request has been processed successfully - 401: Unauthorized - Authentication credentials are missing or invalid - 402: Insufficient Credits - Account does not have enough credits to perform the operation - 404: Not Found - The requested resource or endpoint does not exist - 408: Timeout - No result has been returned for over 10 minutes. - 422: Validation Error - The request parameters failed validation checks - 429: Rate Limited - Request limit has been exceeded for this resource - 455: Service Unavailable - System is currently undergoing maintenance - 500: Server Error - An unexpected error occurred while processing the request - 501: Generation Failed - Content generation task failed - 505: Feature Disabled - The requested feature is currently disabled |
msg | string | 是 | Response message, error description when failed |
data | object | 是 | — |
json
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}回调
videoTaskCompleted
回调地址:{request.body#/callBackUrl}(即请求体里的 callBackUrl)。
当 pixverse-v6/transition 任务成功或失败时,系统会发送此回调。
回调体参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | 统一回调状态码:成功为 200,失败为 501。 可选值:200 / 501。 示例:200。 |
msg | string | 是 | 统一回调消息。 可选值:Playground task completed successfully. / Playground task failed.。 示例:Playground task completed successfully.。 |
data | object | 是 | — |
data.taskId | string | 是 | 任务唯一标识符。 |
data.model | string | 是 | 任务使用的模型。 可选值:pixverse-v6/transition。 示例:pixverse-v6/transition。 |
data.state | string | 是 | 任务最终状态。 可选值:success / fail。 示例:success。 |
data.param | string | 是 | 包含已提交任务参数的 JSON 字符串。 |
data.resultJson | string | 否 | 任务成功时,包含 resultUrls、firstFrameUrl、lastFrameUrl 或 resultObject 的 JSON 字符串。仅在 state 为 success 时出现。 |
data.failCode | string | 否 | 失败码,数字字符串,如 "400"、"500"。仅在 state 为 fail 时出现。 |
data.failMsg | string | 否 | 失败原因,仅在 state 为 fail 时出现。 |
data.costTime | integer | 否 | 处理耗时(秒),成功和失败回调都会返回。 |
data.completeTime | integer | 否 | 任务完成时间戳。 |
data.createTime | integer | 否 | 任务创建时间戳。 |
data.updateTime | integer | 否 | 完成时间请以 completeTime 为准;updateTime 可能与 createTime 相同。 |
data.creditsConsumed | number | 否 | 本任务消耗的积分;失败任务为 0。 |
任务成功完成
json
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "task_example_video_webhook_001",
"model": "pixverse-v6/transition",
"state": "success",
"param": "{\"input\":\"{}\",\"callBackUrl\":\"https://example.com/callback\",\"model\":\"pixverse-v6/transition\"}",
"resultJson": "{\"resultUrls\":[\"https://example.com/generated-video.mp4\"]}",
"costTime": 12,
"completeTime": 1234567890,
"createTime": 1234560000,
"updateTime": 1234567890,
"creditsConsumed": 1.23
}
}任务失败
json
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "task_example_video_webhook_001",
"model": "pixverse-v6/transition",
"state": "fail",
"param": "{\"input\":\"{}\",\"callBackUrl\":\"https://example.com/callback\",\"model\":\"pixverse-v6/transition\"}",
"failCode": "400",
"failMsg": "<error detail>",
"costTime": 12,
"creditsConsumed": 0
}
}