Midjourney Task Submission
curl --request POST \
--url https://www.token-nova.com/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>"
}
'import requests
url = "https://www.token-nova.com/mj/submit/imagine"
payload = {
"mode": "<string>",
"prompt": "<string>",
"base64Array": ["<string>"],
"state": "<string>",
"notifyHook": "<string>",
"dimensions": "<string>",
"botType": "<string>",
"taskId": "<string>",
"maskBase64": "<string>",
"index": 123,
"motion": "<string>",
"action": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: '<string>',
prompt: '<string>',
base64Array: ['<string>'],
state: '<string>',
notifyHook: '<string>',
dimensions: '<string>',
botType: '<string>',
taskId: '<string>',
maskBase64: '<string>',
index: 123,
motion: '<string>',
action: '<string>'
})
};
fetch('https://www.token-nova.com/mj/submit/imagine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.token-nova.com/mj/submit/imagine",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'prompt' => '<string>',
'base64Array' => [
'<string>'
],
'state' => '<string>',
'notifyHook' => '<string>',
'dimensions' => '<string>',
'botType' => '<string>',
'taskId' => '<string>',
'maskBase64' => '<string>',
'index' => 123,
'motion' => '<string>',
'action' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.token-nova.com/mj/submit/imagine"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"base64Array\": [\n \"<string>\"\n ],\n \"state\": \"<string>\",\n \"notifyHook\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"botType\": \"<string>\",\n \"taskId\": \"<string>\",\n \"maskBase64\": \"<string>\",\n \"index\": 123,\n \"motion\": \"<string>\",\n \"action\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.token-nova.com/mj/submit/imagine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"base64Array\": [\n \"<string>\"\n ],\n \"state\": \"<string>\",\n \"notifyHook\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"botType\": \"<string>\",\n \"taskId\": \"<string>\",\n \"maskBase64\": \"<string>\",\n \"index\": 123,\n \"motion\": \"<string>\",\n \"action\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/mj/submit/imagine")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"base64Array\": [\n \"<string>\"\n ],\n \"state\": \"<string>\",\n \"notifyHook\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"botType\": \"<string>\",\n \"taskId\": \"<string>\",\n \"maskBase64\": \"<string>\",\n \"index\": 123,\n \"motion\": \"<string>\",\n \"action\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 1,
"description": "Submit success",
"result": "1712158011464906"
}
Midjourney
Midjourney Task Submission
Submit Midjourney imagine, blend, modal, describe, shorten, swap face, video, and Discord image upload tasks.
POST
https://www.token-nova.com
/
mj
/
submit
/
imagine
Midjourney Task Submission
curl --request POST \
--url https://www.token-nova.com/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>"
}
'import requests
url = "https://www.token-nova.com/mj/submit/imagine"
payload = {
"mode": "<string>",
"prompt": "<string>",
"base64Array": ["<string>"],
"state": "<string>",
"notifyHook": "<string>",
"dimensions": "<string>",
"botType": "<string>",
"taskId": "<string>",
"maskBase64": "<string>",
"index": 123,
"motion": "<string>",
"action": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: '<string>',
prompt: '<string>',
base64Array: ['<string>'],
state: '<string>',
notifyHook: '<string>',
dimensions: '<string>',
botType: '<string>',
taskId: '<string>',
maskBase64: '<string>',
index: 123,
motion: '<string>',
action: '<string>'
})
};
fetch('https://www.token-nova.com/mj/submit/imagine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.token-nova.com/mj/submit/imagine",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'prompt' => '<string>',
'base64Array' => [
'<string>'
],
'state' => '<string>',
'notifyHook' => '<string>',
'dimensions' => '<string>',
'botType' => '<string>',
'taskId' => '<string>',
'maskBase64' => '<string>',
'index' => 123,
'motion' => '<string>',
'action' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.token-nova.com/mj/submit/imagine"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"base64Array\": [\n \"<string>\"\n ],\n \"state\": \"<string>\",\n \"notifyHook\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"botType\": \"<string>\",\n \"taskId\": \"<string>\",\n \"maskBase64\": \"<string>\",\n \"index\": 123,\n \"motion\": \"<string>\",\n \"action\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.token-nova.com/mj/submit/imagine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"base64Array\": [\n \"<string>\"\n ],\n \"state\": \"<string>\",\n \"notifyHook\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"botType\": \"<string>\",\n \"taskId\": \"<string>\",\n \"maskBase64\": \"<string>\",\n \"index\": 123,\n \"motion\": \"<string>\",\n \"action\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/mj/submit/imagine")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"base64Array\": [\n \"<string>\"\n ],\n \"state\": \"<string>\",\n \"notifyHook\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"botType\": \"<string>\",\n \"taskId\": \"<string>\",\n \"maskBase64\": \"<string>\",\n \"index\": 123,\n \"motion\": \"<string>\",\n \"action\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 1,
"description": "Submit success",
"result": "1712158011464906"
}
Midjourney Task Submission
The Midjourney submission interfaces all belong to the/mj/submit/* group. Different actions use different paths, but the success response style is basically the same.
Common Response
{
"code": 1,
"description": "Submit success",
"result": "1712158011464906"
}
integer
Status code. Common values:
1 submission successful, 22 queued, 23 queue full, 24 prompt may contain sensitive words.string
Status description.
string | array<string>
Task ID. The upload Discord image interface returns an array of image URLs.
Authentication
Authorization: Bearer YOUR_API_KEY
Submit Imagine Task
POST /mj/submit/imagine
Imagine action and submit an image generation task.
{
"mode": "RELAX",
"prompt": "Cat",
"base64Array": [
"data:image/png;base64,xxx1",
"data:image/png;base64,xxx2"
],
"state": "",
"notifyHook": ""
}
string
required
Invocation mode, common values are
RELAX and FAST.string
required
Prompt.
array<string>
Base64 array for image references.
string
Custom parameter.
string
Callback URL.
Submit Blend Task
POST /mj/submit/blend
Blend action and submit an image blending task.
{
"mode": "RELAX",
"base64Array": [
"data:image/png;base64,xxx1",
"data:image/png;base64,xxx2"
],
"dimensions": "SQUARE",
"botType": "mj",
"notifyHook": "",
"state": ""
}
string
required
Invocation mode, common values are
RELAX and FAST.array<string>
required
Image Base64 array.
string
Ratio. Common values:
PORTRAIT, SQUARE, LANDSCAPE.string
Bot type, common values:
mj, niji.string
Callback URL.
string
Custom parameter.
Submit Modal Task
POST /mj/submit/modal
code = 21 or require additional prompt input, you can call this interface to continue submitting.
{
"taskId": "1712204995849323",
"maskBase64": "data:image/png;base64,xxx1",
"prompt": "Cat"
}
string
required
Original task ID.
string
Base64 for the partial redraw mask.
string
New prompt.
Submit Describe Task
POST /mj/submit/describe
Describe action and submit an image-to-text task.
{
"mode": "RELAX",
"base64": "data:image/png;base64,xxx",
"botType": "mj",
"notifyHook": "",
"state": ""
}
The Apifox example you provided uses the
base64 field; however, the current project DTO explicitly accepts base64Array. If the upstream channel requires a single-image base64, it is recommended to verify it together with the actual gateway behavior. This document preserves the Apifox invocation style here, but on the project side the main guarantee is that this route exists.Submit Shorten Task
POST /mj/submit/shorten
Shorten action.
{
"mode": "RELAX",
"prompt": "Cat",
"botType": "mj",
"notifyHook": "",
"state": ""
}
Submit SwapFace Task
POST /mj/insight-face/swap
SwapFace face-swapping task.
The current project code actually parses it in JSON Base64 format:
{
"sourceBase64": "data:image/png;base64,xxx1",
"targetBase64": "data:image/png;base64,xxx2"
}
This is different from the
multipart/form-data file upload example you provided in Apifox. The current gateway code actually validates sourceBase64 and targetBase64; if they are missing, it will return sour_base64_and_target_base64_is_required.Submit Video Task
POST /mj/submit/video
- Generate a video directly based on
prompt - Continue generating a video based on an existing
taskId
{
"mode": "FAST",
"prompt": "a car",
"taskId": "1712204995849323",
"index": 1,
"motion": "low",
"image": "url",
"action": "extend",
"state": "",
"notifyHook": ""
}
string
required
Invocation mode, common values are
RELAX and FAST.string
Parent task ID. Used when extending a video based on an existing image.
integer
Video index number.
string
Motion intensity, common values:
low, high.string
Video task action. In examples, the common value is
extend.Upload Files to Discord
POST /mj/submit/upload-discord-images
{
"mode": "RELAX",
"base64Array": [
"data:image/png;base64,xxx1"
]
}
{
"code": 1,
"description": "success",
"result": [
"https://cdn.discordapp.com/attachments/..."
]
}
Common Local Validation Errors
| Description | Common Trigger Condition |
|---|---|
bind_request_body_failed | Invalid request body format |
prompt_is_required | prompt not provided for Imagine |
task_id_is_required | taskId not provided when continuing an operation based on a task |
action_is_required | action missing for continuation-type interfaces |
index_is_required | index missing for continuation-type interfaces |
content_is_required | content missing for simple-change type operations |
task_not_found | The original task does not exist |
task_status_not_success | When the original task must be in a successful state, but it has not succeeded yet |
quota_not_enough | Insufficient balance |
