Midjourney Action 操作执行端点 - TimRouter API 中转端点

POST https://api.timrouter.com/mj/submit/action 在线调试 →
Authorization

在 Header 新增配置项 Authorization,其值为 Bearer 之后拼接组合 Token

代码示例: Authorization: Bearer ********************

官方技术文档:https://docs.midjourney.com/hc/en-us/articles/32804058614669-Upscalers

请求配置项

Header 配置项
Authorization string
按需传入
示例: Bearer {{YOUR_API_KEY}}
Body 配置项 application/json
chooseSameChannel boolean
必须传入
是否选择同一频道下的账号,默认只使用任务关联的账号
customId string
按需传入
动作标识 可选 示例: MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011
taskId string
按需传入
任务ID 可选 示例: 14001934816969359
notifyHook string
按需传入
回调地址, 为空时使用全局notifyHook
state string
按需传入
自定义参数 可选 { "chooseSameChannel": true, "customId": "MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011", "taskId": "14001934816969359", "notifyHook": "", "state": "" } 请求
示例
{
    "chooseSameChannel": true,
    "customId": "MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011",
    "taskId": "14001934816969359",
    "notifyHook": "",
    "state": ""
}

请求代码示例

var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
   "chooseSameChannel": true,
   "customId": "MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011",
   "taskId": "14001934816969359",
   "notifyHook": "",
   "state": ""
});

var requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body: raw,
   redirect: 'follow'
};

fetch("https://api.timrouter.com/mj/submit/action", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
import http.client
import json

conn = http.client.HTTPSConnection("api.timrouter.com")
payload = json.dumps({
   "chooseSameChannel": True,
   "customId": "MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011",
   "taskId": "14001934816969359",
   "notifyHook": "",
   "state": ""
})
headers = {
   'Authorization': 'Bearer YOUR_API_KEY',
   'Content-Type': 'application/json'
}
conn.request("POST", "/mj/submit/action", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

输出返回响应

返回响应配置项 🟢 200 OK · application/json
image
按需传入
application/json
created integer
必须传入
data array [object]
必须传入
url string
必须传入
{ "created": 1589478378, "data": [ { "url": "https://..." }, { "url": "https://..." } ] }
示例
{
    "created": 1589478378,
    "data": [
        {
            "url": "https://..."
        },
        {
            "url": "https://..."
        }
    ]
}