Midjourney
Create a Midjourney imagine task
Use POST /mj/submit/imagine in CometAPI to create Midjourney imagine tasks with full Discord params, track task_id status, and enable image-to-video motion effects.
POST
/
mj
/
submit
/
imagine
cURL
curl https://api.cometapi.com/mj/submit/imagine \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"botType": "MID_JOURNEY",
"prompt": "a paper boat floating on calm water at sunrise --v 6.1",
"accountFilter": {
"modes": [
"FAST"
]
}
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/mj/submit/imagine",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"botType": "MID_JOURNEY",
"prompt": "a paper boat floating on calm water at sunrise --v 6.1",
"accountFilter": {
"modes": [
"FAST"
]
}
},
)
task = response.json()
print(task["code"], task.get("result")) # code 1 means submitted; result is the task id
const response = await fetch("https://api.cometapi.com/mj/submit/imagine", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"botType": "MID_JOURNEY",
"prompt": "a paper boat floating on calm water at sunrise --v 6.1",
"accountFilter": {
"modes": [
"FAST"
]
}
}),
});
const task = await response.json();
console.log(task.code, task.result); // code 1 means submitted; result is the task id
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.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([
'prompt' => 'a paper boat floating on calm water at sunrise --v 6.1'
]),
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://api.cometapi.com/mj/submit/imagine"
payload := strings.NewReader("{\n \"prompt\": \"a paper boat floating on calm water at sunrise --v 6.1\"\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://api.cometapi.com/mj/submit/imagine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a paper boat floating on calm water at sunrise --v 6.1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.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 \"prompt\": \"a paper boat floating on calm water at sunrise --v 6.1\"\n}"
response = http.request(request)
puts response.read_body{
"code": 1,
"description": "Submission successful",
"result": "1773314942177684",
"properties": {
"discordChannelId": "5e6ca8e1f40e4de6",
"discordInstanceId": "5e6ca8e1f40e4de6"
}
}Use this endpoint to start the main Midjourney workflow. Every later step, including upscale, variation, and custom zoom, begins with a successful imagine task.
What the first response gives you
resultis the task id you will poll nextcodecan still be a success code even when it is not HTTP-style200
Core workflow
1
Submit the imagine task
Send the prompt and store the returned task id.
2
Poll until the task finishes
Use Fetch Single Task until the task reaches
SUCCESS, MODAL, or FAILURE.3
Continue with post-processing
When buttons appear, use Action for upscale, variation, reroll, zoom, and similar follow-up operations.
Optional video prompt pattern
If you want motion from a source image, add an image URL plus Midjourney video flags in the prompt, such as--video and --motion.Body
application/json
Response
200 - application/json
Task accepted.
Last modified on June 23, 2026
⌘I
cURL
curl https://api.cometapi.com/mj/submit/imagine \
-H "Authorization: Bearer $COMETAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"botType": "MID_JOURNEY",
"prompt": "a paper boat floating on calm water at sunrise --v 6.1",
"accountFilter": {
"modes": [
"FAST"
]
}
}'import os
import requests
response = requests.post(
"https://api.cometapi.com/mj/submit/imagine",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"botType": "MID_JOURNEY",
"prompt": "a paper boat floating on calm water at sunrise --v 6.1",
"accountFilter": {
"modes": [
"FAST"
]
}
},
)
task = response.json()
print(task["code"], task.get("result")) # code 1 means submitted; result is the task id
const response = await fetch("https://api.cometapi.com/mj/submit/imagine", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"botType": "MID_JOURNEY",
"prompt": "a paper boat floating on calm water at sunrise --v 6.1",
"accountFilter": {
"modes": [
"FAST"
]
}
}),
});
const task = await response.json();
console.log(task.code, task.result); // code 1 means submitted; result is the task id
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.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([
'prompt' => 'a paper boat floating on calm water at sunrise --v 6.1'
]),
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://api.cometapi.com/mj/submit/imagine"
payload := strings.NewReader("{\n \"prompt\": \"a paper boat floating on calm water at sunrise --v 6.1\"\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://api.cometapi.com/mj/submit/imagine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a paper boat floating on calm water at sunrise --v 6.1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.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 \"prompt\": \"a paper boat floating on calm water at sunrise --v 6.1\"\n}"
response = http.request(request)
puts response.read_body{
"code": 1,
"description": "Submission successful",
"result": "1773314942177684",
"properties": {
"discordChannelId": "5e6ca8e1f40e4de6",
"discordInstanceId": "5e6ca8e1f40e4de6"
}
}