Skip to main content
POST
https://www.geeknow.top
/
mj
/
submit
/
imagine
Midjourney 任务提交
curl --request POST \
  --url https://www.geeknow.top/mj/submit/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mode": "<string>",
  "prompt": "<string>",
  "base64Array": [
    "<string>"
  ],
  "state": "<string>",
  "notifyHook": "<string>",
  "dimensions": "<string>",
  "botType": "<string>",
  "taskId": "<string>",
  "maskBase64": "<string>",
  "index": 123,
  "motion": "<string>",
  "action": "<string>"
}
'
{
  "code": 1,
  "description": "Submit success",
  "result": "1712158011464906"
}

Documentation Index

Fetch the complete documentation index at: https://docs.geeknow.top/llms.txt

Use this file to discover all available pages before exploring further.

Midjourney 任务提交

Midjourney 提交接口统一属于 /mj/submit/* 这一组。不同动作使用不同路径,但成功响应风格基本一致。

通用响应

{
  "code": 1,
  "description": "Submit success",
  "result": "1712158011464906"
}
code
integer
状态码。常见值:1 提交成功、22 排队中、23 队列已满、24 prompt 可能包含敏感词。
description
string
状态说明。
result
string | array<string>
任务 ID。上传 Discord 图片接口返回的是图片 URL 数组。

认证

Authorization: Bearer YOUR_API_KEY

提交 Imagine 任务

POST /mj/submit/imagine
执行 Imagine 操作,提交绘图任务。
{
  "mode": "RELAX",
  "prompt": "Cat",
  "base64Array": [
    "data:image/png;base64,xxx1",
    "data:image/png;base64,xxx2"
  ],
  "state": "",
  "notifyHook": ""
}
mode
string
required
调用模式,常见值为 RELAXFAST
prompt
string
required
提示词。
base64Array
array<string>
垫图 Base64 数组。
state
string
自定义参数。
notifyHook
string
回调地址。

提交 Blend 任务

POST /mj/submit/blend
执行 Blend 操作,提交融图任务。
{
  "mode": "RELAX",
  "base64Array": [
    "data:image/png;base64,xxx1",
    "data:image/png;base64,xxx2"
  ],
  "dimensions": "SQUARE",
  "botType": "mj",
  "notifyHook": "",
  "state": ""
}
mode
string
required
调用模式,常见值为 RELAXFAST
base64Array
array<string>
required
图片 Base64 数组。
dimensions
string
比例。常见值:PORTRAITSQUARELANDSCAPE
botType
string
bot 类型,常见值:mjniji
notifyHook
string
回调地址。
state
string
自定义参数。

提交 Modal 任务

POST /mj/submit/modal
当其他任务返回 code = 21 或需要补充提示词时,可调用该接口继续提交。
{
  "taskId": "1712204995849323",
  "maskBase64": "data:image/png;base64,xxx1",
  "prompt": "Cat"
}
taskId
string
required
原任务 ID。
maskBase64
string
局部重绘蒙版 Base64。
prompt
string
新的提示词。

提交 Describe 任务

POST /mj/submit/describe
执行 Describe 操作,提交图生文任务。
{
  "mode": "RELAX",
  "base64": "data:image/png;base64,xxx",
  "botType": "mj",
  "notifyHook": "",
  "state": ""
}
你给的 Apifox 使用 base64 字段;但当前项目 DTO 中显式接收的是 base64Array。如果上游渠道要求单图 base64,建议同时结合实际网关行为验证。文档这里保留 Apifox 的调用写法,但项目侧主要保证的是这条路由存在。

提交 Shorten 任务

POST /mj/submit/shorten
执行 Shorten 操作。
{
  "mode": "RELAX",
  "prompt": "Cat",
  "botType": "mj",
  "notifyHook": "",
  "state": ""
}

提交 SwapFace 任务

POST /mj/insight-face/swap
提交 SwapFace 换脸任务。 项目当前代码实际按 JSON Base64 方式解析:
{
  "sourceBase64": "data:image/png;base64,xxx1",
  "targetBase64": "data:image/png;base64,xxx2"
}
这和你给的 Apifox multipart/form-data 文件上传示例不一样。当前网关代码实际校验的是 sourceBase64targetBase64,缺少时会返回 sour_base64_and_target_base64_is_required

提交 Video 任务

POST /mj/submit/video
Video 接口当前支持两种模式:
  1. 基于 prompt 直接生成视频
  2. 基于已有 taskId 继续生成视频
{
  "mode": "FAST",
  "prompt": "a car",
  "taskId": "1712204995849323",
  "index": 1,
  "motion": "low",
  "image": "url",
  "action": "extend",
  "state": "",
  "notifyHook": ""
}
mode
string
required
调用模式,常见值为 RELAXFAST
taskId
string
父任务 ID。基于已有图片扩展视频时使用。
index
integer
视频索引号。
motion
string
运动强度,常见值:lowhigh
action
string
视频任务动作。示例里常见值为 extend

上传文件到 Discord

POST /mj/submit/upload-discord-images
上传图片到 Discord,返回图片 URL 列表。
{
  "mode": "RELAX",
  "base64Array": [
    "data:image/png;base64,xxx1"
  ]
}
{
  "code": 1,
  "description": "success",
  "result": [
    "https://cdn.discordapp.com/attachments/..."
  ]
}

常见本地校验错误

描述常见触发条件
bind_request_body_failed请求体格式错误
prompt_is_requiredImagine 未传 prompt
task_id_is_required需要基于任务继续操作时未传 taskId
action_is_required继续操作类接口缺少 action
index_is_required继续操作类接口缺少 index
content_is_requiredsimple-change 类操作缺少 content
task_not_found传入的原任务不存在
task_status_not_success需要依赖原任务成功态时,原任务尚未成功
quota_not_enough余额不足

相关接口