Skip to content

Midjourney Image Formats (Midjourney Proxy/Plus)

Midjourney Image Formats (Midjourney Proxy/ Plus)

Section titled “Midjourney Image Formats (Midjourney Proxy/ Plus)”

Overview

Please note

This interface is not the official Midjourney API. It is a Midjourney proxy API based on the open-source project midjourney-proxy by novicezk.

This project has two versions, both of which are supported by 4All API:

  • Open-source version midjourney-proxy
  • Paid version midjourney-proxy-plus

We sincerely appreciate the author’s contribution, which makes it easy to use Midjourney’s powerful capabilities. If you have the time, please give the author a Star. If you’re able to, we recommend supporting the paid version, which offers more features.

Feature CategoryOpen-source VersionPaid Version
Basic Features
Imagine commands and related actions
Image reference support
Blend (image blending)
Describe (image-to-text)
Real-time task progress
Chinese prompt translation
prompt sensitive-word detection
user-token connects to wss
Multi-account configuration
Advanced Features
Shorten (prompt analysis)
Pan
Zoom
Vary Region
Link button actions with Remix mode
Get image seed value
Account Management
Persistent account pool
Multiple storage backends supported (Redis/MySQL)
Account info retrieval and settings
Task cancellation
Built-in admin panel
Intelligent Features
MJ V6.0 support
Automatic account status monitoring
Automatic mode switching
niji・journey Bot support
InsightFace face service
Security & Reliability
Dynamic configuration support
Fix for token disconnect issues
Automatic verification
Automatic appeals for banned words

Midjourney is a powerful image generation and editing model that can create, edit, and modify images from natural-language descriptions. By exposing different interfaces, it can handle a wide range of image generation and processing tasks.

  • Initial task
  • Imagine: text to image
  • Blend: multi-image blending
  • Describe: image description
  • Swap Face: face replacement
  • Image processing
  • U1-U4: upscale operations
  • V1-V4: variation generation
  • Pan: image shifting
  • Zoom: image scaling
  • Special workflows
  • Action + Modal: actions that require a confirmation dialog
  • Action direct execution: actions that do not require a dialog
  • Task management
  • Get task details
  • Get image Seed
  • Upload to Discord
curl --location --request POST 'https://4All API地址/mj/submit/imagine' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"botType": "MID_JOURNEY",
"prompt": "Cat",
"base64Array": [],
"accountFilter": {
"channelId": "",
"instanceId": "",
"modes": [],
"remark": "",
"remix": true,
"remixAutoConsidered": true
},
"notifyHook": "",
"state": ""
}'

Response example:

{
"code": 1,
"description": "提交成功",
"properties": {},
"result": 1320098173412546
}
curl --location --request POST 'https://4All API地址/mj/submit/blend' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"botType": "MID_JOURNEY",
"base64Array": [
"data:image/png;base64,xxx1",
"data:image/png;base64,xxx2"
],
"dimensions": "SQUARE",
"accountFilter": {
"channelId": "",
"instanceId": "",
"modes": [],
"remark": "",
"remix": true,
"remixAutoConsidered": true
},
"notifyHook": "",
"state": ""
}'

Response example:

{
"code": 1,
"description": "提交成功",
"properties": {},
"result": 1320098173412546
}
curl --location --request POST 'https://4All API地址/mj/submit/describe' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"botType": "MID_JOURNEY",
"base64": "data:image/png;base64,xxx",
"accountFilter": {
"channelId": "",
"instanceId": "",
"modes": [],
"remark": "",
"remix": true,
"remixAutoConsidered": true
},
"notifyHook": "",
"state": ""
}'

Response example:

{
"code": 1,
"description": "提交成功",
"properties": {},
"result": 1320098173412546
}
curl --location --request POST 'https://4All API地址/mj/submit/modal' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"maskBase64": "",
"prompt": "",
"taskId": "14001934816969359"
}'

Response example:

{
"code": 1,
"description": "提交成功",
"properties": {},
"result": 1320098173412546
}
curl --location --request POST 'https://4All API地址/mj/insight-face/swap' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"sourceBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RDnYdriP1wsS81kwU8OVs/R3xu8s6bX7+zYnOH8coSqpmRSBjqerjcBlr2OB/lbAf/2Q==",
"targetBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD849k="
}'

Response example:

{
"code": 0,
"description": "string",
"result": "string"
}
curl --location --request POST 'https://4All API地址/mj/submit/action' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"chooseSameChannel": true,
"customId": "MJ::JOB::upsample::1::82c51c9d-bc33-4c07-a471-36c3dcb1a6f0",
"taskId": "1728781324658687",
"accountFilter": {
"channelId": "",
"instanceId": "",
"modes": [],
"remark": "",
"remix": true,
"remixAutoConsidered": true
},
"notifyHook": "",
"state": ""
}'

Response example:

{
"code": 1,
"description": "提交成功",
"properties": {},
"result": 1320098173412546
}
curl --location --request POST 'https://4All API地址/mj/submit/upload-discord-images' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"base64Array": [],
"filter": {
"channelId": "",
"instanceId": "",
"remark": ""
}
}'

Response example:

{
"code": 0,
"description": "string",
"result": [
"string"
]
}
curl --location --request POST 'https://4All API地址/mj/task/list-by-condition' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"ids": []
}'

Response example:

[
{
"action": "IMAGINE",
"buttons": [
{
"customId": "string",
"emoji": "string",
"label": "string",
"style": 0,
"type": 0
}
],
"description": "string",
"failReason": "string",
"finishTime": 0,
"id": "string",
"imageUrl": "string",
"progress": "string",
"prompt": "string",
"promptEn": "string",
"properties": {},
"startTime": 0,
"state": "string",
"status": "NOT_START",
"submitTime": 0
}
]
curl --location --request GET 'https://4All API地址/mj/task/{id}/fetch' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Content-Type: application/json'

Response example:

{
"action": "IMAGINE",
"buttons": [
{
"customId": "string",
"emoji": "string",
"label": "string",
"style": 0,
"type": 0
}
],
"description": "string",
"failReason": "string",
"finishTime": 0,
"id": "string",
"imageUrl": "string",
"progress": "string",
"prompt": "string",
"promptEn": "string",
"properties": {},
"startTime": 0,
"state": "string",
"status": "NOT_START",
"submitTime": 0
}
curl --location --request GET 'https://4All API地址/mj/task/{id}/image-seed' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $4All API_API_KEY' \
--header 'Content-Type: application/json'

Response example:

{
"code": 0,
"description": "string",
"result": "string"
}
POST /mj/submit/imagine

Create an image from a text prompt.

POST /mj/submit/blend

Blend multiple input images to generate a new image.

POST /mj/submit/describe

Generate a text description from an input image.

POST /mj/submit/modal

Submit modal information for fine-tuning image generation details.

POST /mj/insight-face/swap

Perform face swapping using a source image and a target image.

POST /mj/submit/action

Perform follow-up actions on a generated image, such as upscaling or adjustments.

POST /mj/submit/upload-discord-images

Upload images to Discord.

POST /mj/task/list-by-condition

Query task details by a specified list of task IDs.

GET /mj/task/{id}/fetch

Get task details by task ID.

GET /mj/task/{id}/image-seed

Get the seed value of the image generated by the specified task.

Include the following in the request header for API key authentication:

Authorization: Bearer $4All API_API_KEY$OPENAI_API_KEY

Where $OPENAI_API_KEY is your API key.

  • Type: enum string
  • Required: No
  • Default: MID_JOURNEY
  • Possible values:
  • MID_JOURNEY: Midjourney model
  • NIJI_JOURNEY: Niji Journey model
  • Description: The bot type to use
  • Type: string
  • Required: Yes
  • Description: The text prompt for image generation
  • Tips:
  • Use clear and specific descriptions
  • You can include artistic style, composition, and other details
  • English and Chinese input are both supported
  • Type: string array
  • Required: No
  • Description: The base64-encoded array for reference images
  • Format: Each item should be a complete base64 image string, including the MIME type prefix
  • Type: object
  • Required: No
  • Properties:
  • channelId: channel ID
  • instanceId: account instance ID
  • modes: account mode array, possible values: RELAX, FAST, TURBO
  • remark: content contained in the remark field
  • remix: whether the account supports remix
  • remixAutoConsidered: remix auto-submit setting
  • Type: string
  • Required: No
  • Description: Callback URL after the task is completed. If empty, the global notifyHook is used
  • Type: string
  • Required: No
  • Description: Custom state parameter, which can be used to track the request
  • Type: string array
  • Required: Yes
  • Description: Base64-encoded array of images to blend
  • Format: Must contain base64 strings for 2-5 images
  • Type: enum string
  • Required: No
  • Possible values:
  • PORTRAIT: 2:3 aspect ratio
  • SQUARE: 1:1 aspect ratio
  • LANDSCAPE: 3:2 aspect ratio
  • Description: Aspect ratio setting for the output image
  • Type: string
  • Required: Yes
  • Description: Base64-encoded image to describe
  • Format: Complete base64 string including the MIME type prefix
  • Type: string
  • Required: No
  • Description: Base64-encoded mask image for local inpainting
  • Type: string
  • Required: No
  • Description: Text prompt for the inpainted region
  • Type: string
  • Required: Yes
  • Description: ID of the original task
  • Type: string
  • Required: Yes
  • Description: Base64-encoded source face image
  • Requirement: The image must contain a clear face
  • Type: string
  • Required: Yes
  • Description: Base64-encoded target image
  • Requirement: The image must contain the face to be replaced
  • Type: boolean
  • Required: No
  • Default: false
  • Description: Whether to choose an account in the same channel
  • Type: string
  • Required: Yes
  • Description: Action identifier
  • Format: A string in a specific format, such as "MJ::JOB::upsample::1::xxx"
  • Type: string
  • Required: Yes
  • Description: The task ID on which to perform the action
  • Type: string array
  • Required: Yes
  • Description: Base64-encoded array of images to upload
  • Type: object
  • Required: No
  • Properties:
  • channelId: target channel ID
  • instanceId: account instance ID
  • remark: remark information
  • Type: string array
  • Required: Yes
  • Description: List of task IDs to query

All endpoints return a similar response structure:

  • Type: integer
  • Description: Status code
Status CodeDescription
1Submitted successfully
22Task queued
21Invalid parameters
23System error
24Account unavailable
25Insufficient balance
  • Type: string
  • Description: Response description
  • Type: object
  • Description: Extended properties
  • Type: string or array
  • Description: Returned result, which may be a task ID or other data
  • Type: enum string
  • Description: Task type
String ValueDescription
IMAGINECreate image
UPSCALEUpscale image
VARIATIONGenerate variation
ZOOMZoom image
PANShift image
DESCRIBEImage description
BLENDImage blending
SHORTENShorten prompt
SWAP_FACEFace replacement
  • Type: object array
  • Description: Action buttons that can be executed
Array FieldDescription
customIdAction identifier
emojiButton icon
labelButton text
styleStyle (2=Primary, 3=Green)
typeType used internally by the system
  • Type: string
  • Description: Task description
  • Type: string
  • Description: Reason the task failed
  • Type: integer
  • Description: Task completion timestamp
  • Type: string
  • Description: Unique task identifier
  • Type: string
  • Description: URL of the generated image
  • Type: string
  • Description: Task progress information
  • Type: string
  • Description: Original prompt
  • Type: string
  • Description: English prompt
  • Type: enum string
  • Description: Task status
String ValueDescription
NOT_STARTNot started
SUBMITTEDSubmitted
MODALIn modal operation
IN_PROGRESSIn progress
FAILUREFailed
SUCCESSSuccess
CANCELCanceled
  • Type: integer
  • Description: Task submission timestamp
  • Type: integer
  • Description: Task start execution timestamp

When a request encounters an issue, the API returns an error response:

  • 400 Bad Request: Invalid request parameters
  • 401 Unauthorized: API key is invalid or missing
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Resource does not exist
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error :