即梦 API 管理控制台

🎨 即梦 API 控制台

🎨 即梦 API 管理控制台

总调用次数

0

总消耗积分

0

活跃 Key 数

0

使用模型数

0

API Key 使用统计

Key 描述 调用次数 消耗积分 剩余积分 最后使用

模型使用统计

模型 调用次数 消耗积分
加载中...
加载中...

支持的模型列表

模型ID 名称 类型 ReqKey 支持分辨率 积分消耗 来源
加载中...

API Key 管理

名称 Key 状态 创建时间 操作

Session 管理

SessionId 描述 启用 积分 有效性 最后使用时间 操作
一、标准 API 接口
适用于后端服务、脚本、CLI 工具等直接调用。鉴权方式:Header 携带 Authorization: Bearer <api_key>,服务端自动分配可用 Session
1. 图像生成 API
POST http://localhost:8000/v1/images/generations
Authorization: Bearer <api_key>
Content-Type: application/json
参数类型必填默认值说明
modelstring否jimeng-image-5.0-lite模型ID
promptstring是-正向提示词
negative_promptstring否""反向提示词(不希望出现的内容)
ratiostring否1:1比例:1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9
resolutionstring否2k分辨率:1k, 2k, 4k(3.x/2.x仅支持1k)
sample_strengthnumber否0.5采样强度 0-1,仅参考图模式生效
filePathstring否""参考图URL/路径,填写后自动进入图生图模式
response_formatstring否url返回格式:url 或 b64_json
curl -X POST http://localhost:8000/v1/images/generations \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-image-4.7", "prompt": "一只在太空中飞行的柴犬,赛博朋克风格", "negative_prompt": "模糊, 低质量", "ratio": "16:9", "resolution": "2k" }' # 图生图(带参考图) curl -X POST http://localhost:8000/v1/images/generations \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-image-4.7", "prompt": "将这张图变成梵高风格", "filePath": "https://example.com/ref.jpg", "sample_strength": 0.6 }' # 文件上传(multipart/form-data) curl -X POST http://localhost:8000/v1/images/generations \ -H "Authorization: Bearer <api_key>" \ -F "model=jimeng-image-4.7" \ -F "prompt=将这张图变成梵高风格" \ -F "file=@./reference.jpg"
响应示例
{ "success": true, "data": [ { "url": "https://lf3-jimeng.jianying.com/..." } ] }
2. 视频生成 API
POST http://localhost:8000/v1/videos/generations
Authorization: Bearer <api_key>
Content-Type: application/json
参数类型必填默认值说明
modelstring否jimeng-video-seedance-2.0-mini视频模型ID
promptstring是-视频内容描述
ratiostring否16:9比例:16:9, 9:16, 1:1, 4:3, 3:4, 21:9
resolutionstring否720p分辨率:720p, 1080p, 4k(因模型而异)
durationnumber否10时长(秒):5 或 10
file_pathsstring[]否[]首尾帧图片URL数组,1张=首帧,2张=首帧+尾帧
response_formatstring否url返回格式:url 或 b64_json
curl -X POST http://localhost:8000/v1/videos/generations \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-video-seedance-2.0-pro", "prompt": "城市夜景延时摄影,车流如织", "ratio": "16:9", "resolution": "1080p", "duration": 10 }' # 图生视频(首帧+尾帧) curl -X POST http://localhost:8000/v1/videos/generations \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-video-seedance-2.0-pro", "prompt": "从日出到日落的延时变化", "file_paths": [ "https://example.com/sunrise.jpg", "https://example.com/sunset.jpg" ] }'
响应示例
{ "success": true, "data": { "url": "https://lf3-jimeng.jianying.com/..." } }
3. 模型列表 API
GET http://localhost:8000/v1/models
Authorization: Bearer <api_key>
查询参数类型默认值说明
refreshstringfalse设为 true 或 1 强制刷新即梦官网模型缓存
typestring无过滤:image 仅图像,video 仅视频
# 获取所有模型 curl http://localhost:8000/v1/models \ -H "Authorization: Bearer <api_key>" # 仅获取视频模型 curl "http://localhost:8000/v1/models?type=video" \ -H "Authorization: Bearer <api_key>" # 强制刷新缓存 curl "http://localhost:8000/v1/models?refresh=true" \ -H "Authorization: Bearer <api_key>"
响应示例
{ "data": [{ "id": "jimeng-image-4.7", "object": "model", "owned_by": "jimeng-image", "name": "Seedream 4.7", "model_req_key": "high_aes_general_v43", "supported_resolutions": ["2k", "4k"], "default_resolution": "2k", "source": "static", "benefit_count_by_resolution": { "2k": 4, "4k": 1 } }] }
benefit_count_by_resolution 表示"每积分可生成的图片数",如 "2k": 4 = 每积分可生成4张2K图
4. Token 有效性检查
POST http://localhost:8000/token/check
Content-Type: application/json
参数类型必填说明
tokenstring是要检查的即梦 refresh_token
curl -X POST http://localhost:8000/token/check \ -H "Content-Type: application/json" \ -d '{"token": "your-refresh-token"}'
响应示例
{ "live": true }
5. Token 积分查询
POST http://localhost:8000/token/points
Authorization: Bearer <api_key>
参数类型必填说明
AuthorizationHeader是Bearer 格式传入 API Key,服务端验证后自动分配可用 Session
curl -X POST http://localhost:8000/token/points \ -H "Authorization: Bearer <api_key>"
响应示例
[ { "token": "abc...xyz", "points": 1234 }, { "token": "def...uvw", "points": 5678 } ]
6. 本地媒体文件访问
GET http://localhost:8000/media/:date/:filename
无需鉴权,直接访问本地缓存的媒体文件
路径参数说明
:date日期目录,格式 YYYY-MM-DD
:filename文件名,如 1234567890.jpg、abc123.mp4
# 访问图片 curl http://localhost:8000/media/2026-07-20/1234567890.jpg # 访问视频 curl http://localhost:8000/media/2026-07-20/abc123.mp4
支持格式:png、jpg、jpeg、gif、webp、mp4、webm
7. 健康检查
GET http://localhost:8000/ping
curl http://localhost:8000/ping # 响应:pong
8. 异步任务提交(推荐)
解决同步接口长时间阻塞导致调用方超时重试的问题。提交后立即返回 task_id,通过轮询查询任务状态和结果。
POST http://localhost:8000/v1/tasks/submit
Authorization: Bearer <api_key>
Content-Type: application/json
参数类型必填说明
typestring是任务类型:image 或 video
promptstring是生成提示词
modelstring否模型ID,默认 jimeng-image-5.0-lite 或 jimeng-video-seedance-2.0-mini
ratiostring否比例,如 1:1、16:9、9:16
resolutionstring否分辨率,如 2k、4k、720p、1080p
negative_promptstring否反向提示词(仅图像)
sample_strengthnumber否精细度,0-1(仅图像)
durationnumber否视频时长,5 或 10(仅视频)
# 提交图像生成任务 curl -X POST http://localhost:8000/v1/tasks/submit \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "type": "image", "model": "jimeng-image-4.7", "prompt": "一只可爱的猫咪在窗台上晒太阳" }' # 提交视频生成任务 curl -X POST http://localhost:8000/v1/tasks/submit \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "type": "video", "model": "jimeng-video-seedance-2.0-pro", "prompt": "一只猫在草地上奔跑 16:9", "duration": 10 }'
响应示例
{ "task_id": "550e8400-e29b-41d4-a716-446655440000", "status": "pending", "type": "image", "created_at": "2026-07-20T12:00:00.000Z" }
9. 任务状态查询
GET http://localhost:8000/v1/tasks/:task_id
Authorization: Bearer <api_key>
curl http://localhost:8000/v1/tasks/550e8400-e29b-41d4-a716-446655440000 \ -H "Authorization: Bearer <api_key>"
状态流转
pending → processing → completed | failed
响应示例 - 处理中
{ "task_id": "550e8400-...", "type": "image", "status": "processing", "prompt": "一只可爱的猫咪", "model": "jimeng-image-4.7", "created_at": "2026-07-20T12:00:00", "updated_at": "2026-07-20T12:00:05" }
响应示例 - 完成
{ "task_id": "550e8400-...", "type": "image", "status": "completed", "prompt": "一只可爱的猫咪", "model": "jimeng-image-4.7", "result": { "created": 1753036800, "data": [ { "url": "https://lf3-jimeng.jianying.com/..." } ] } }
响应示例 - 失败
{ "task_id": "550e8400-...", "type": "image", "status": "failed", "error": "积分不足:当前session已标记为不可用" }
轮询建议:图像任务每 3-5 秒查询一次,视频任务每 10-15 秒查询一次。任务结果保留 24 小时后自动清理。
二、OpenAI 兼容接口
兼容 OpenAI Chat Completions 格式,可直接接入 Dify、Coze、FastGPT 等 AI Agent 平台。Base URL:http://your-server:8000/v1
10. OpenAI Chat Completions
POST http://localhost:8000/v1/chat/completions
Authorization: Bearer <api_key>
Content-Type: application/json
参数类型必填说明
modelstring否模型ID,图像 jimeng-image-*,视频 jimeng-video-*
messagesarray是消息数组,支持纯文本和多模态格式
streamboolean否是否流式输出,默认 false
# 文生图 curl -X POST http://localhost:8000/v1/chat/completions \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-image-4.7", "messages": [{"role": "user", "content": "一只可爱的猫咪"}] }' # 图生图(多模态消息) curl -X POST http://localhost:8000/v1/chat/completions \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-image-4.7", "messages": [{ "role": "user", "content": [ {"type": "text", "text": "将这张图变成梵高风格"}, {"type": "image_url", "image_url": {"url": "https://example.com/img.jpg"}} ] }] }' # 视频生成(model以 jimeng-video- 开头自动路由) curl -X POST http://localhost:8000/v1/chat/completions \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng-video-seedance-2.0-pro", "messages": [{"role": "user", "content": "一只猫在草地上奔跑"}] }'
响应示例
{ "id": "uuid", "model": "jimeng-image-4.7", "object": "chat.completion", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "![image_0](https://lf3-jimeng.jianying.com/...)\n" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 1, "completion_tokens": 1, "total_tokens": 2 } }
- 图像结果以 Markdown ![image](url) 格式嵌在 content 中
- 视频结果以 ![video](url) 格式嵌在 content 中
- 该接口会自动在提示词前追加 "一次只生成2张图片," 前缀
11. AI Agent 接入指南
配置项值
API Base URLhttp://your-server:8000/v1
API Key在管理面板创建的 API Key
Modeljimeng-image-4.7(图像)或 jimeng-video-seedance-2.0-pro(视频)
支持平台:Dify、Coze/扣子、FastGPT、LobeChat、Open-WebUI 等

Dify:设置 → 模型供应商 → 添加 OpenAI-API-compatible → 填入 Base URL 和 API Key
Coze:创建 Bot → 添加插件 → 自定义 API 工具 → 配置 Base URL + Header 鉴权
FastGPT/LobeChat:模型管理 → 添加 OpenAI 兼容 → 填入地址和密钥

注意:model 名称必须以 jimeng-image- 或 jimeng-video- 开头
快捷测试
模型ID名称类型支持分辨率积分消耗
选择模型查看详情