总请求
{{ stats.requests?.total || 0 }}
成功率
{{ successRate }}%
队列
{{ queueStatus.running }}/{{ queueStatus.maxConcurrency }}
Session
{{ sessions.filter(s=>s.enabled).length }}/{{ sessions.length }}
Session状态
{{ s.name }} ({{ s.region }})
{{ s.credits }}积分
暂无Session
最近错误
{{ e.code }}{{ e.count }}次
无错误 👍
Session管理
| 状态 | 名称 | 区域 | Token | 积分 | 统计 | 操作 |
|---|---|---|---|---|---|---|
| ● | {{ s.name }} | {{ s.region.toUpperCase() }} | {{ maskToken(s.token) }} | {{ s.credits }} | {{ s.successCount||0 }}/{{ s.failCount||0 }} |
|
暂无Session
API Key管理
| 状态 | 名称 | Key | 限流 | 操作 |
|---|---|---|---|---|
| ● | {{ k.name }} | {{ k.key }} | {{ k.rateLimit || '无限制' }} |
暂无API Key
模型配置
{{ m.displayName || m.id }}
{{ m.enabled?'启用':'禁用' }}{{ m.id }}
类型{{ m.type==='image'?'图像':'视频' }}
积分
站点开关
暂无模型
任务监控
队列配置
{{ queueStatus.running }}
执行中
{{ queueStatus.queued }}
排队中
{{ queueStatus.maxConcurrency }}
最大并发
{{ queueStatus.maxQueueSize }}
队列容量
使用帮助
🚀 快速开始
- 获取SessionID:登录即梦AI网站,按F12打开开发者工具,在Application → Cookies中找到
sessionid - 添加Session:在Session管理页面添加获取的sessionid
- 创建API Key:在API Key页面创建用于调用API的密钥
- 调用API:使用Bearer Token认证调用OpenAI兼容接口
⚙️ 基础配置
API地址:http://localhost:5100
认证方式:Bearer Token(在请求头中添加 Authorization: Bearer YOUR_API_KEY)
默认管理密码:admin123(生产环境请修改)
📋 获取模型列表
获取所有可用的模型列表
GET
/v1/models请求示例:
curl http://localhost:5100/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
成功响应:
{
"object": "list",
"data": [
{
"id": "jimeng-3.0",
"object": "model",
"created": 1704067200,
"owned_by": "jimeng"
},
{
"id": "jimeng-3.0-pro",
"object": "model",
"created": 1704067200,
"owned_by": "jimeng"
}
]
}
🎨 图像生成 API
使用文本提示生成图像(OpenAI兼容格式)
POST
/v1/images/generations请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型ID,如 jimeng-3.0, jimeng-3.0-pro |
prompt | string | 是 | 图像描述提示词 |
n | integer | 否 | 生成数量,默认1,最大4 |
size | string | 否 | 图像尺寸,如 1024x1024 |
response_format | string | 否 | url 或 b64_json |
请求示例:
curl -X POST http://localhost:5100/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jimeng-3.0",
"prompt": "一只可爱的橘猫,戴着圣诞帽,在雪地里玩耍",
"n": 1,
"size": "1024x1024"
}'
✅ 成功响应:
{
"created": 1704067200,
"data": [
{
"url": "https://example.com/generated-image.png",
"revised_prompt": "一只可爱的橘猫..."
}
]
}
🎬 视频生成 API
使用文本提示生成视频
POST
/v1/videos/generations请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型ID,如 pixeldance |
prompt | string | 是 | 视频描述提示词 |
image | string | 否 | 参考图像URL(图生视频) |
请求示例:
curl -X POST http://localhost:5100/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "pixeldance",
"prompt": "一只猫咪在草地上奔跑"
}'
✅ 成功响应:
{
"created": 1704067200,
"data": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
💬 Chat API(兼容模式)
使用OpenAI Chat格式调用图像生成
POST
/v1/chat/completions请求示例:
curl -X POST http://localhost:5100/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jimeng-3.0",
"messages": [
{
"role": "user",
"content": "画一只可爱的小猫"
}
]
}'
✅ 成功响应:
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1704067200,
"model": "jimeng-3.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": ""
},
"finish_reason": "stop"
}
]
}
❌ 错误响应示例
认证失败 (401):
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}
请求参数错误 (400):
{
"error": {
"message": "Missing required parameter: prompt",
"type": "invalid_request_error",
"code": "missing_parameter"
}
}
模型不存在 (404):
{
"error": {
"message": "Model 'xxx' not found",
"type": "invalid_request_error",
"code": "model_not_found"
}
}
任务超时 (408):
{
"error": {
"message": "Task timeout after 120 seconds",
"type": "timeout_error",
"code": "task_timeout"
}
}
队列已满 (429):
{
"error": {
"message": "Queue is full, please try again later",
"type": "rate_limit_error",
"code": "queue_full"
}
}
Session积分不足 (402):
{
"error": {
"message": "No session available with sufficient credits",
"type": "billing_error",
"code": "insufficient_credits"
}
}
服务器错误 (500):
{
"error": {
"message": "Internal server error",
"type": "server_error",
"code": "internal_error"
}
}
🤖 支持的模型
图像生成模型:
jimeng-3.0- 基础版jimeng-3.0-pro- 专业版jimeng-3.0-t2i-s- 极速版jimeng-3.0-t2i-p- 高质量jimeng-4.5- 最新版本
视频生成模型:
pixeldance- 文生视频seaweed- 图生视频
💻 编程语言示例
Python:
import openai
client = openai.OpenAI(
api_key="YOUR_API_KEY",
base_url="http://localhost:5100/v1"
)
# 生成图像
response = client.images.generate(
model="jimeng-3.0",
prompt="一只可爱的小猫",
n=1,
size="1024x1024"
)
print(response.data[0].url)
JavaScript/Node.js:
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'http://localhost:5100/v1'
});
const response = await client.images.generate({
model: 'jimeng-3.0',
prompt: '一只可爱的小猫',
n: 1,
size: '1024x1024'
});
console.log(response.data[0].url);
使用 fetch:
const response = await fetch('http://localhost:5100/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'jimeng-3.0',
prompt: '一只可爱的小猫',
n: 1,
size: '1024x1024'
})
});
const data = await response.json();
console.log(data.data[0].url);
🐳 Docker 部署
使用 docker-compose:
# 设置环境变量
export ADMIN_PASSWORD=your_secure_password
# 启动服务
docker-compose up -d
# 查看日志
docker-compose logs -f
使用 docker run:
docker run -d \
--name jimeng-api \
-p 5100:5100 \
-e ADMIN_PASSWORD=your_password \
-v jimeng-data:/app/data \
jimeng-api:latest
⚠️ 注意事项
- SessionID有效期有限,请定期检查和更新
- 每个Session都有积分限制,系统会自动轮询可用Session
- 图像生成通常需要10-60秒,视频生成可能需要更长时间
- 并发请求数受任务队列限制,超出会排队等待
- 生产环境请务必修改默认管理密码
- 建议配置多个Session以提高可用性