🎨 即梦 Jimeng AI

OpenAI 兼容接口 · 多模型图像与视频生成 · 多账号池调度

🔐 认证

所有 API 请求需在 Header 中携带 API Key(在管理后台生成):

Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
获取 API Key:登录管理后台 → 🔑 API Key → 生成新 Key。每个调用方可独立分配。

📋 模型列表

GET/v1/models

返回所有可用模型及配置。已配置即梦账号时自动拉取官网动态模型并缓存。支持 ?type=image / ?type=video 过滤,?refresh=true 强制刷新。

curl https://jm.01ai.space/v1/models \
  -H "Authorization: Bearer <API_Key>"

🖼️ 图像模型

模型 ID说明分辨率
jimeng-image-5.0-lite5.0 Lite(最新)2K (默认) / 4K
jimeng-image-4.74.72K (默认) / 4K
jimeng-image-4.64.62K (默认) / 4K
jimeng-image-4.54.52K (默认) / 4K
jimeng-image-4.14.12K (默认) / 4K
jimeng-image-4.04.02K (默认) / 4K
jimeng-image-3.13.11K (默认)
jimeng-image-3.03.01K (默认)
jimeng-image-2.0-pro2.0 Pro仅 1K

🎬 视频模型

模型 ID说明时长
jimeng-video-seedance-2.0-miniSeedance 2.0 Mini5s / 10s
jimeng-video-seedance-2.0-fastSeedance 2.0 Fast5s / 10s
jimeng-video-seedance-2.0-proSeedance 2.0 Pro5s / 10s
jimeng-video-seedance-1.5-proSeedance 1.5 Pro5s / 10s
jimeng-video-3.0-pro3.0 Pro5s / 10s
jimeng-video-3.03.05s / 10s
jimeng-video-3.0-fast3.0 Fast5s / 10s
jimeng-video-s2.0S2.0 轻量5s
jimeng-video-2.0-pro2.0 Pro5s

📐 比例支持

图像:21:9 / 16:9 / 3:2 / 4:3 / 1:1 / 3:4 / 2:3 / 9:16

视频:16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 21:9   |   提示词写「横屏」「竖屏」「方形」自动识别

💬 对话补全

POST/v1/chat/completions

OpenAI 兼容格式。支持纯文本生图/视频 + 多模态(带参考图)+ SSE 流式。根据模型名自动判定图像或视频生成。

# 文生图
curl -X POST https://jm.01ai.space/v1/chat/completions \
  -H "Authorization: Bearer <API_Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "jimeng-image-4.1",
  "messages": [{"role":"user","content":"一只在太空中飞行的柴犬,赛博朋克风格"}]
}'
# 多模态(带参考图)
curl -X POST https://jm.01ai.space/v1/chat/completions \
  -H "Authorization: Bearer <API_Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "jimeng-image-4.5",
  "messages": [{
    "role":"user",
    "content":[
      {"type":"text","text":"把这张图变成梵高风格"},
      {"type":"image_url","image_url":{"url":"https://example.com/img.jpg"}}
    ]
  }]
}'
# 视频生成 + 流式
curl -X POST https://jm.01ai.space/v1/chat/completions \
  -H "Authorization: Bearer <API_Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "jimeng-video-3.0-fast",
  "messages": [{"role":"user","content":"一只狗在草地上奔跑 5秒"}],
  "stream": true
}'

🖼️ 图像生成

POST/v1/images/generations

独立图像生成接口,支持参考图混合模式。

model模型 ID(见上方列表)
prompt提示词(必填)
ratio比例,默认 1:1
resolution分辨率:1k / 2k / 4k
filePath参考图 URL 或 Base64(可选)
response_formaturl(默认)或 b64_json
curl -X POST https://jm.01ai.space/v1/images/generations \
  -H "Authorization: Bearer <API_Key>" \
  -H "Content-Type: application/json" \
  -d '{"model":"jimeng-image-4.1","prompt":"一只猫","ratio":"9:16","resolution":"2k"}'

🎬 视频生成

POST/v1/videos/generations

独立视频生成接口,支持首尾帧控制。

model模型 ID(见上方列表)
prompt提示词(必填)
ratio比例,默认 16:9
duration时长:5 或 10 秒
file_paths首帧/尾帧图 URL 数组(可选)
resolution默认 720p
curl -X POST https://jm.01ai.space/v1/videos/generations \
  -H "Authorization: Bearer <API_Key>" \
  -H "Content-Type: application/json" \
  -d '{"model":"jimeng-video-3.0-fast","prompt":"一只狗在奔跑","ratio":"16:9","duration":5}'

⚙️ 返回格式

// 图像 — /v1/images/generations
{"created": 1700000000, "data": [{"url": "https://jm.01ai.space/storage/2026-08/xxx.png"}]}

// 视频 — /v1/videos/generations
{"created": 1700000000, "data": [{"url": "https://jm.01ai.space/storage/2026-08/xxx.mp4"}]}

// 聊天 — /v1/chat/completions
{"id": "...", "choices": [{"message": {"content": "![image](url)\n![image](url)"}}]}

// 错误
{"code": -2001, "message": "...", "data": null}

📝 注意事项