Seedream5.0 Lite 文生图
本页由 ModelFold 文档站根据上游官方 OpenAPI 文档同步生成。接口路径、参数、示例与官方保持一致;品牌与 API 域名已替换为 ModelFold。
接口
POST /jobs/createTask
完整 URL: https://ai.modelfold.online/v1/jobs/createTask
鉴权:所有请求都需要
Authorization: Bearer <API_KEY>请求头。
基于 Seedream 先进 AI 模型的高质量写实风格图像生成
查询任务状态
提交任务后,可通过统一的查询端点查看任务进度并获取生成结果:
- 获取任务详情 — 了解如何查询任务状态并获取生成结果
TIP
生产环境中,建议使用 callBackUrl 参数接收生成完成的自动通知,而非轮询状态端点。
相关资源
请求参数
请求体 (application/json)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 用于生成的模型名称。必填字段。 - 此端点必须使用 seedream/5-lite-text-to-image 默认值:"seedream/5-lite-text-to-image"。 可选值:seedream/5-lite-text-to-image。 示例:seedream/5-lite-text-to-image。 |
callBackUrl | string | 否 | 接收生成任务完成更新的 URL。可选但建议在生产环境中使用。 - 当生成完成时,系统将向此 URL POST 任务状态和结果 - 回调包含生成的内容 URL 和任务信息 - 您的回调端点应接受包含结果的 JSON 负载的 POST 请求 - 或者,使用获取任务详情端点轮询任务状态 - 为确保回调安全性,请参阅 Webhook 校验指南 了解签名验证实现方法 示例: https://your-domain.com/api/callback。 |
input | object | 否 | 生成任务的输入参数 |
input.prompt | string | 是 | 文本提示词,4–2995 字符。 示例:A full-process cafe design tool for entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, and customer group adaptation, supporting integrated planning of "commercial attributes + aesthetic design." Suitable as a promotional image for a cafe design SaaS product, with a 16:9 aspect ratio.。 |
input.aspect_ratio | string | 是 | 必填。图像的宽高比,决定其视觉形态。 可选值:1:1 / 4:3 / 3:4 / 16:9 / 9:16 / 2:3 / 3:2 / 21:9。 示例:1:1。 |
input.quality | string | 是 | 必填。基础质量输出 2K 图像,高质量输出 3K 图像,超质量输出 4K 图像。 可选值:basic / high / ultra。 示例:basic。 |
input.output_format | string | 否 | 输出图像格式,请显式传入。 可选值:png / jpeg。 示例:png。 |
input.nsfw_checker | boolean | 否 | 默认 false。为 false 时不额外进行内容过滤,结果由模型直接返回。 |
请求示例
bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream/5-lite-text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "A full-process cafe design tool for entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, and customer group adaptation, supporting integrated planning of \"commercial attributes + aesthetic design.\" Suitable as a promotional image for a cafe design SaaS product, with a 16:9 aspect ratio.",
"aspect_ratio": "1:1",
"quality": "basic",
"output_format": "png",
"nsfw_checker": true
}
}'json
{
"model": "seedream/5-lite-text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "A full-process cafe design tool for entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, and customer group adaptation, supporting integrated planning of \"commercial attributes + aesthetic design.\" Suitable as a promotional image for a cafe design SaaS product, with a 16:9 aspect ratio.",
"aspect_ratio": "1:1",
"quality": "basic",
"output_format": "png",
"nsfw_checker": true
}
}响应
200 —
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). 可选值:200 / 401 / 402 / 404 / 422 / 429 / 455 / 500 / 501 / 505。 示例:200。 |
msg | string | 否 | Response message, error description when failed 示例:success。 |
data | object | 是 | — |
data.taskId | string | 否 | Task ID, can be used with Get Task Details endpoint to query task status |
data.recordId | string | 否 | Record ID, can be used to get the record details |
json
{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_seedream_1765166238716"
}
}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
}回调
onImageGenerated
回调地址:{$request.body#/callBackUrl}(即请求体里的 callBackUrl)。
任务成功或失败时发送回调。
回调体参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | 200:成功;501:失败,原因见 data.failCode 与 data.failMsg。 可选值:200 / 501。 示例:200。 |
msg | string | 否 | 状态消息 示例:Playground task completed successfully.。 |
data | object | 否 | — |
data.completeTime | integer | 否 | 任务完成时间,Unix 毫秒时间戳 示例:1786416057000。 |
data.costTime | integer | 否 | 处理耗时(秒),成功和失败回调都会返回。 示例:45。 |
data.createTime | integer | 否 | 任务创建时间,Unix 毫秒时间戳 示例:1786416010000。 |
data.creditsConsumed | number | 否 | 本任务消耗的积分;失败任务为 0。 示例:5.5。 |
data.model | string | 否 | 图片生成使用的模型 示例:seedream/5-lite-text-to-image。 |
data.param | string | 否 | 创建任务时提交的参数,JSON 字符串格式 示例:{"input":"{\"aspect_ratio\":\"1:1\",\"output_format\":\"png\",\"prompt\":\"A full-process cafe design toolfor entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, andcustomer group adaptation, supporting integrated planning of \\\"commercial attributes + aesthetic design.\\\" Suitable as apromotional image for a cafe design SaaS product, with a 16:9 aspect ratio.\",\"nsfw_checker\":true,\"quality\":\"basic\"}","callBackUrl":"https://your-domain.com/api/callback","model":"seedream/5-lite-text-to-image"}。 |
data.resultJson | string | 否 | 图片生成结果,JSON 字符串格式。resultUrls 为生成图片的 URL 列表。仅在 state 为 success 时出现。 示例:{"resultUrls":["https://tempfile.aiquickdraw.com/workers/images/image_7746f86aab72d889c18814925199315e.png"]}。 |
data.state | string | 否 | 任务状态 可选值:success / fail。 示例:success。 |
data.taskId | string | 否 | 任务 ID 示例:d92a0bcf287a90307fb2471a5b5e2836。 |
data.updateTime | integer | 否 | 完成时间请以 completeTime 为准;updateTime 可能与 createTime 相同。 示例:1786416057000。 |
data.failCode | string | 否 | 失败码,数字字符串,如 "400"、"500"。仅在 state 为 fail 时出现。 示例:500。 |
data.failMsg | string | 否 | 失败原因,仅在 state 为 fail 时出现。 示例:<error detail>。 |
成功
json
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "d92a0bcf287a90307fb2471a5b5e2836",
"model": "seedream/5-lite-text-to-image",
"state": "success",
"param": "{\"input\":\"{\\\"aspect_ratio\\\":\\\"1:1\\\",\\\"output_format\\\":\\\"png\\\",\\\"prompt\\\":\\\"A full-process cafe design toolfor entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, andcustomer group adaptation, supporting integrated planning of \\\\\\\"commercial attributes + aesthetic design.\\\\\\\" Suitable as apromotional image for a cafe design SaaS product, with a 16:9 aspect ratio.\\\",\\\"nsfw_checker\\\":true,\\\"quality\\\":\\\"basic\\\"}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"seedream/5-lite-text-to-image\"}",
"resultJson": "{\"resultUrls\":[\"https://tempfile.aiquickdraw.com/workers/images/image_7746f86aab72d889c18814925199315e.png\"]}",
"completeTime": 1786416057000,
"createTime": 1786416010000,
"costTime": 45,
"creditsConsumed": 5.5,
"updateTime": 1786416057000
}
}失败
json
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "d92a0bcf287a90307fb2471a5b5e2836",
"model": "seedream/5-lite-text-to-image",
"state": "fail",
"param": "{\"input\":\"{\\\"aspect_ratio\\\":\\\"1:1\\\",\\\"output_format\\\":\\\"png\\\",\\\"prompt\\\":\\\"A full-process cafe design toolfor entrepreneurs and designers. It covers core needs including store layout, functional zoning, decoration style, equipment selection, andcustomer group adaptation, supporting integrated planning of \\\\\\\"commercial attributes + aesthetic design.\\\\\\\" Suitable as apromotional image for a cafe design SaaS product, with a 16:9 aspect ratio.\\\",\\\"nsfw_checker\\\":true,\\\"quality\\\":\\\"basic\\\"}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"seedream/5-lite-text-to-image\"}",
"failCode": "500",
"failMsg": "<error detail>",
"completeTime": 1786416057000,
"createTime": 1786416010000,
"costTime": 45,
"creditsConsumed": 0,
"updateTime": 1786416057000
}
}