OpenAI 兼容接口 · 多模型图像与视频生成 · 多账号池调度
所有 API 请求需在 Header 中携带 API Key(在管理后台生成):
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/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-lite | 5.0 Lite(最新) | 2K (默认) / 4K |
jimeng-image-4.7 | 4.7 | 2K (默认) / 4K |
jimeng-image-4.6 | 4.6 | 2K (默认) / 4K |
jimeng-image-4.5 | 4.5 | 2K (默认) / 4K |
jimeng-image-4.1 | 4.1 | 2K (默认) / 4K |
jimeng-image-4.0 | 4.0 | 2K (默认) / 4K |
jimeng-image-3.1 | 3.1 | 1K (默认) |
jimeng-image-3.0 | 3.0 | 1K (默认) |
jimeng-image-2.0-pro | 2.0 Pro | 仅 1K |
| 模型 ID | 说明 | 时长 |
|---|---|---|
jimeng-video-seedance-2.0-mini | Seedance 2.0 Mini | 5s / 10s |
jimeng-video-seedance-2.0-fast | Seedance 2.0 Fast | 5s / 10s |
jimeng-video-seedance-2.0-pro | Seedance 2.0 Pro | 5s / 10s |
jimeng-video-seedance-1.5-pro | Seedance 1.5 Pro | 5s / 10s |
jimeng-video-3.0-pro | 3.0 Pro | 5s / 10s |
jimeng-video-3.0 | 3.0 | 5s / 10s |
jimeng-video-3.0-fast | 3.0 Fast | 5s / 10s |
jimeng-video-s2.0 | S2.0 轻量 | 5s |
jimeng-video-2.0-pro | 2.0 Pro | 5s |
图像: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 | 提示词写「横屏」「竖屏」「方形」自动识别
/v1/chat/completionsOpenAI 兼容格式。支持纯文本生图/视频 + 多模态(带参考图)+ 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
}'
/v1/images/generations独立图像生成接口,支持参考图混合模式。
| model | 模型 ID(见上方列表) |
| prompt | 提示词(必填) |
| ratio | 比例,默认 1:1 |
| resolution | 分辨率:1k / 2k / 4k |
| filePath | 参考图 URL 或 Base64(可选) |
| response_format | url(默认)或 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"}'
/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": "\n"}}]}
// 错误
{"code": -2001, "message": "...", "data": null}
/storage/),返回永久链接