POST
https://zx1.deepwl.net
/
v1
/
images
/
generations
即梦图像生成
curl --request POST \
  --url https://zx1.deepwl.net/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "n": 123,
  "size": "<string>",
  "image": [
    {}
  ],
  "ratio": "<string>",
  "resolution": "<string>"
}
'
{
  "created": 1735689600,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
    }
  ]
}

即梦图像生成

OpenAI 兼容格式的图像生成接口,支持即梦模型的图像生成能力。
  • 路由入口是 POST /v1/images/generations
  • 当前使用 application/json 提交。
  • 支持即梦模型(jimeng-4.0jimeng-4.5)。
  • 支持通过 image 字段传入参考图进行图生图。

支持模型

  • jimeng-4.0:即梦 4.0 模型
  • jimeng-4.5:即梦 4.5 模型

方法与路径

POST /v1/images/generations

请求示例

curl -X POST https://zx1.deepwl.net/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "model": "jimeng-4.0",
    "prompt": "A close-up depiction of a domestic cat in a relaxed state. The cat features vibrant orange fur, with striking white markings around its eyes that extend down to its soft, pink nose.",
    "n": 1,
    "size": "1024*1024"
  }'

带参考图示例

curl -X POST https://zx1.deepwl.net/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "model": "jimeng-4.0",
    "prompt": "参考图片生成写实类型的图像",
    "n": 1,
    "image": ["https://example.com/reference.png"],
    "ratio": "16:9",
    "resolution": "2k"
  }'

响应示例

{
  "created": 1735689600,
  "data": [
    {
      "url": "https://example.com/generated-image.png",
      "revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
    }
  ]
}

认证

Authorization: Bearer YOUR_API_KEY

Body

model
string
必填
模型名称。支持 jimeng-4.0jimeng-4.5
prompt
string
必填
提示词。生成图像的文本描述,支持中文和英文。
n
integer
必填
图像数量。生成图片的数量。
size
string
图像大小。分辨率设置,例如 1024*1024
image
array
垫图。参考图片 URL 数组,用于图生图场景。
ratio
string
图片比例。例如 1:116:99:164:33:4 等。
resolution
string
分辨率。可选值:1k2k4k

Response

created
integer
生成时间戳(Unix 时间戳)。
data
array
生成结果数组。
data[].url
string
生成图片的 URL 地址。
data[].revised_prompt
string
改写后的提示词(部分上游会返回)。

相关接口