Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apidoc.deerapi.com/llms.txt

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

HOST: https://api.deerapi.com 所有请求必须在 Header 中携带 API Key:
Authorization: Bearer <DEERAPI_KEY>

1. 提交 Imagine(绘图)任务

接口: POST https://api.deerapi.com/mj/submit/imagine

请求示例

{
  "base64Array": [],
  "notifyHook": "",
  "prompt": "Cat",
  "state": ""
}

请求参数

参数说明必须类型
prompt提示词string
base64Array垫图 base64 数组string[]
notifyHook回调地址string
state自定义参数string

响应参数

参数说明类型
code状态码:1 提交成功、21 已存在、22 排队中、4 内部错误int
description描述string
properties扩展字段object
result任务 IDstring

响应示例

{
  "code": 1,
  "description": "提交成功",
  "properties": {},
  "result": 1320098173412546
}

2. 执行动作(Action)

接口: POST https://api.deerapi.com/mj/submit/action 用于所有关联按钮动作:UPSCALE、VARIATION、REROLL、ZOOM 等。

3. 绘图变化(Change)

接口: POST https://api.deerapi.com/mj/submit/change

请求示例

{
  "action": "UPSCALE",
  "index": 1,
  "notifyHook": "",
  "state": "",
  "taskId": "1320098173412546"
}

请求参数

参数说明必须类型
action操作类型:UPSCALE(放大)、VARIATION(变换)、REROLL(重新生成)string
index序号 1~4,UPSCALE / VARIATION 时必传条件必须int
taskId任务 IDstring
notifyHook回调地址(为空时使用全局)string
state自定义参数string

响应参数

参数说明类型
code状态码:1 提交成功、21 已存在、22 排队中、其他为错误int
description描述string
properties扩展字段object
result任务 IDstring

4. 提交 Modal(局部重绘 / Zoom)

接口: POST https://api.deerapi.com/mj/submit/modal 针对 Midjourney 有弹窗的操作,需要提交对应数据。

请求示例

{
  "maskBase64": "",
  "prompt": "",
  "taskId": "14001934816969359"
}

请求参数

参数说明必须类型
taskId任务 IDstring
prompt提示词string
maskBase64局部重绘的蒙版 base64string

5. 指定 ID 获取任务

接口: GET https://api.deerapi.com/mj/task/{id}/fetch

请求参数

参数说明类型
id任务 ID(路径参数)string

响应参数

参数说明类型
id任务 IDstring
action操作类型(UPSCALE / VARIATION / REROLL / DESCRIBE / BLEND)string
prompt提示词string
promptEn英文提示词string
status任务状态:SUBMITTED / IN_PROGRESS / FAILURE / SUCCESSstring
progress进度百分比string
imageUrl生成图片 URLstring
failReason失败原因string
submitTime提交时间(ms 时间戳)int
startTime开始执行时间int
finishTime结束时间int
state自定义参数string
description任务描述string
buttons可用操作按钮列表array

响应示例

{
  "id": "1712310326047513",
  "action": "UPSCALE",
  "prompt": "a lovely Japan countryside --niji 6 --ar 16:9",
  "promptEn": "a lovely Japan countryside --niji 6 --ar 16:9",
  "description": "Submit success",
  "state": "",
  "submitTime": 1712310326047,
  "startTime": 1712310328336,
  "finishTime": 1712310329602,
  "imageUrl": "https://api.deerapi.com/mj/image/1712310326047513",
  "status": "SUCCESS",
  "progress": "100%",
  "failReason": "",
  "buttons": [
    {
      "customId": "MJ::JOB::upsample_v6_2x_subtle::1::125fd761-3d07-4252-8513-8a07dce51ce7::SOLO",
      "emoji": "upscale_1",
      "label": "Upscale (Subtle)",
      "type": 2,
      "style": 2
    }
  ],
  "properties": {
    "finalPrompt": "a lovely Japan countryside --niji 6 --ar 16:9"
  }
}