Skip to content

Imagine - 提交绘图任务 ​

提交 Midjourney 图片生成任务。任务采用异步执行方式,提交成功后返回任务 ID。

一、接口信息 ​

项目内容
请求方式POST
请求地址/mj/submit/imagine
完整地址https://api.hllapi.vip/mj/submit/imagine
Content-Typeapplication/json
鉴权方式Bearer Token

二、请求头 ​

参数类型必填说明
AuthorizationString是Bearer API Key
Content-TypeString是application/json

三、请求参数 ​

参数类型必填说明
botTypeString是任务类型,已验证值 MID_JOURNEY
promptString是绘图提示词
base64ArrayArray是图片 Base64 数组,纯文字绘图传空数组

四、请求示例 ​

JSON ​

{
  "botType": "MID_JOURNEY",
  "prompt": "A cute white cat sitting on a wooden table --ar 1:1",
  "base64Array": []
}

cURL ​

curl -X POST "https://api.hllapi.vip/mj/submit/imagine" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"botType":"MID_JOURNEY","prompt":"A cute white cat sitting on a wooden table --ar 1:1","base64Array":[]}'

PowerShell ​

$headers = @{
    Authorization = "Bearer YOUR_API_KEY"
}

$body = @{
    botType = "MID_JOURNEY"
    prompt = "A cute white cat sitting on a wooden table --ar 1:1"
    base64Array = @()
} | ConvertTo-Json

Invoke-RestMethod `
    -Uri "https://api.hllapi.vip/mj/submit/imagine" `
    -Method POST `
    -Headers $headers `
    -ContentType "application/json" `
    -Body $body

五、成功响应 ​

以下为真实测试返回结构:

{
  "code": 1,
  "description": "提交成功",
  "result": "1794254436902883",
  "properties": {
    "discordInstanceId": "示例实例ID",
    "discordChannelId": "示例频道ID"
  }
}

六、返回字段 ​

字段说明
code请求结果代码
description请求结果描述
result生成任务 ID
properties任务扩展信息

七、下一步操作 ​

提交成功后,保存 result 中的任务 ID。

使用 Fetch 接口查询任务状态、生成进度和图片地址。

查看 Fetch 任务查询接口

八、注意事项 ​

  1. API Key 必须使用有效的火灵灵 API 密钥。
  2. 请勿重复提交任务来代替状态查询。
  3. 图片生成需要等待上游执行完成。
  4. 其他可选参数及图片输入方式尚待进一步验证。

火灵灵 API · 开发者服务中心