DataEyesAI
Official SiteConsoleDocs Home
Getting StartedDeveloper ToolsAI Models API
Official SiteConsoleDocs Home
Getting StartedDeveloper ToolsAI Models API
  1. Midjourney format
  • Getting Started
    • Overview
    • Console (Getting Started)
    • API Key
    • Base URL
  • Developer Tool Integration
    • OpenClaw
    • Claude Code
    • Codex
    • Gemini CLI
    • Grok CLI
    • Other Tools
  • AI Models API
    • OpenAI format (supports major original models)
      • Chat (Response)
        • Create Network Search
        • Create Model Response GPT-5 Enable Thinking
        • Create Function Call
        • Create Model Response
        • Create Model Response (Streaming Return)
        • Create Model Response (Control Thinking Length)
      • ChatGPT Interface
        • Audio
          • Audio to text gpt-4o-transcribe
          • GPT-4o-audio
          • Audio to text whisper-1
          • Audio to text gpt-4o-transcribe
          • Create voice gpt-4o-mini-tts
        • Chat
          • Create chat-based image recognition (non-streaming)
          • Create chat-based image recognition (streaming)
          • Create chat-based image recognition (streaming) best64
          • Official N test
          • Create structured output
          • Control the effort level of the inference model
          • Create chat function call
          • deepseek-ocr recognition
          • Create chat completion (non-stream)
        • Completions
          • ChatGPT automatic completion
          • Create completion
      • Image
        • Edit image
        • Create chat completion (streaming)
        • Create chat completion (qwen-mt-turbo)
        • Create chat completion with deepseek v3.1 level of reasoning (streaming)
      • Audio
        • Speech recognition
        • Speech synthesis
        • Official Function Calling invocation
        • Create chat-generated images (non-streaming)
      • Embedding
        • Text embeddings
    • Anthropic format
      • Chat
      • Chat(prompt cache)
      • Streaming response
      • Chat (deep reasoning)
      • Tool invocation (function call)
      • Analyze image
    • Google Gemini interface
      • Native format
        • Text-to-image + control over aspect ratio + clarity
        • Generate image
        • Text generation
        • Text generation - stream
        • Text generation + reasoning - stream
        • Image generation
        • Formatted output
        • Function call
        • Document understanding
        • URL context [native format]
        • Code execution
        • Video understanding
        • URL context
        • Video understanding - url [native format]
        • Imagen 4
        • Audio understanding
        • Embeddings
        • Chat
        • Edit image
      • Image-to-image Base64 request method
        • Multi-image fusion slice generation with gemini-3-pro-image-preview, controlling aspect ratio and clarity
        • Image editing
        • Single image gemini-3-pro-image-preview, controlling aspect ratio and clarity.
        • Image generation( gemini-2.5-flash-image)
        • Image generation gemini-2.5-flash-image, controlling aspect ratio.
        • Image understanding
      • Image-to-image URL request returns URL request format OpenAI
        • Single image generation with gemini-3-pro-image-preview, controlling aspect ratio and clarity.
        • Multi-image fusion slice generation with gemini-3-pro-image-preview, controlling aspect ratio and clarity.
        • Image understanding
    • NanoBanana
      • OpenAI request
        • Edit image
        • OpenAI image format
      • Gemini request
        • Generate image
        • Edit image
    • Midjourney format
      • Midjourney API Reference
      • Task query interface
        GET
      • Upload image
        POST
      • Get seed (Seed)
        POST
      • Submit Imagine task
        POST
      • Query tasks based on ID list
        POST
      • FaceSwap
        POST
      • Execute Action operation
        POST
      • /mj/submit/blend
        POST
      • Submit Describe task
        POST
      • Submit Modal
        POST
      • Refresh link
        POST
      • Edit image
        POST
      • Query task status by task ID
        GET
      • Get the seed of the task image
        GET
    • Doubao - Painting
      • doubao-seededit-3-0-i2i-250628
      • doubao-seedream-4-0-250828 - text-to-image
      • doubao-seedream-4-0-250828 - image-to-image
      • doubao-seedream-4-0-250828 - multi-image generation
    • Rerank Reordering Model
      • Rerank
    • Video Model
      • Grok Video Generation
        • 00-Overview
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Reference-to-Video
        • 04-Video-Editing
        • 05-Video-Extension
      • Seedance Video Generation
        • 00-Overview
        • 01-Create-Video-Generation-Task
        • 02-Query-Video-Generation-Task
        • 03-Query-Video-Generation-Task-List
        • 04-Cancel-or-Delete-Task
        • Seedance Private Asset Library API Documentation
      • MiniMax-H3 Video Generation
        • 00-Overview
        • 01-Create-Video-Generation
        • 02-Create-Video-Regeneration
        • 03-Create-H3-Context-IR
        • 04-Query-Task
        • 05-List-Tasks
        • 06-Cancel-or-Delete-Task
      • Hailuo Video Generation
        • 00-Overview
        • 01-Text-to-Video-T2V
        • 02-Image-to-Video-I2V
        • 03-First-Last-Frame-FL2V
        • 04-Subject-Reference-S2V
        • 05-Query-Task-Status
        • 06-Video-Download
        • 99-Appendix-Camera-Movement-and-Webhooks
      • Jimeng Video Generation
        • 00-Overview
        • 01-3.0-Pro-Video-Generation
        • 02-720P-Text-to-Video
        • 03-720P-Image-to-Video-First-Frame
        • 04-720P-Image-to-Video-Start-End-Frame
        • 05-720P-Image-to-Video-Camera
        • 06-1080P-Text-to-Video
        • 07-1080P-Image-to-Video-First-Frame
        • 08-1080P-Image-to-Video-Start-End-Frame
        • 09-Error-Codes
      • Kling AI Video Generation
        • 00-Overview
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Omni-Video
        • 04-Multi-Image-to-Video
        • 05-Motion-Control
        • 06-Multi-Elements
        • 07-Video-Extension
        • 08-Lip-Sync
        • 09-Avatar
        • 10-Text-to-Audio
        • 11-Video-to-Audio
        • 12-TTS
        • 13-Custom-Voices
        • 14-Image-Recognition
        • 15-Element-Management
        • 16-Video-Effects
      • Vidu Video Generation
        • 00-Overview
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Reference-to-Video
        • 04-Start-End-Frame
        • 05-Multi-Frame
        • 06-Scene-Template
        • 07-Template-Story
        • 08-Query-Tasks
      • HappyHorse
        • HappyHorse Text-to-Video
        • HappyHorse Image-to-Video (First Frame)
        • HappyHorse Reference-to-Video
        • HappyHorse Video Editing
      • Wan Video Generation
        • 00-Overview.md
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Reference-to-Video
        • 04-Video-Editing
        • 05-First-Last-Frame-to-Video
        • 06-Motion-Transfer-and-Character-Swap
        • 07-Digital-Human-Video
        • 08-VACE-Video-Editing
        • 09-Query-Task
    • Audio API
      • Audio API
      • Gemini TTS API
      • Google DeepMind Lyria API
      • Elevenlabs Speech to Text API Reference
      • Text-to-Music Suno
        • Task Submission
          • Generate Song (Inspiration Mode)
          • Generate Song (Custom Mode)
          • Generate Song (Continuation Mode)
          • Generate Song (Singer Style)
          • Generate Song (Secondary Creation from Uploaded Song)
          • Generate Song (Song Stitching)
          • Generate Lyrics
          • Song Stitching
        • Query Interface
          • Batch Retrieve Tasks
          • Query Single Task
  • Search / Reader Product
    • Web Reader API​​
      • Web Reader API
      • Web Reader API(HK)
    • Web Search API​​
      • Modal Card API
        • Weather
          • All City ID
          • Weather Query API
      • Web Search API
      • Video Search api
      • Trending Search API
    • Document OCR Parsing API
      • fiel upload
      • URL Parsing
  • Advanced & System API
    • Data Updates
    • System interface
      • API Key & Quota Query API
      • API Key Management API
    • API Reference​​
      • Error Codes
      • HTTP Notes
    • List models
      • Models
  1. Midjourney format

Midjourney API Reference

Version: v1.0
Last Updated: 2026-06-15
Base URL: https://cloud.dataeyes.ai
Authentication: Bearer Token

Table of Contents#

1.
Overview
2.
Authentication & General Conventions
3.
API Endpoints
3.1 Submit Image Generation Task (Imagine)
3.2 Query Task Status (Fetch)
3.3 Submit Action Task (Action)
3.4 Retrieve Generated Image (Image)
4.
Complete Workflow
5.
customId Format Specification
6.
Task Status Enum
7.
Error Codes
8.
Complete Code Examples
9.
FAQ

1. Overview#

This API provides a wrapper around Midjourney's image generation capabilities, supporting the following core features:
FeatureDescription
ImagineGenerate images from text prompts (2x2 grid)
Upscale (U1-U4)Upscale a selected image from the grid to high resolution
Variation (V1-V4)Generate variations based on a selected image from the grid
RerollRegenerate the 2x2 grid using the same prompt

2. Authentication & General Conventions#

2.1 Request Headers#

All requests must include the following headers:
HeaderRequiredValueDescription
AuthorizationYesBearer {API_KEY}API Key authentication
Content-TypeYesapplication/jsonRequest body format
User-AgentYesAny valid UA stringRequired — requests without a User-Agent will be blocked by Cloudflare with a 403 response

2.2 Common Response Format#

{
  "code": 1,
  "description": "Submitted successfully",
  "result": "Task ID",
  "properties": { ... }
}
FieldTypeDescription
codeintStatus code. 1 indicates success; other values indicate failure
descriptionstringStatus description message
resultstringTask ID (returned by submission endpoints)
propertiesobjectAdditional information (queue count, instance ID, etc.)

3. API Endpoints#

3.1 Submit Image Generation Task (Imagine)#

Submit a Midjourney image generation task based on a text prompt.
Request
POST /mj/submit/imagine
Request Body
FieldTypeRequiredDescription
promptstringYesMidjourney prompt, supporting native parameters such as --v 6.1, --ar 16:9
botTypestringNoBot type. Default: MID_JOURNEY. Optional: NIJI_JOURNEY
accountFilterobjectNoAccount filter criteria
accountFilter.modesstring[]NoGeneration mode. Options: FAST, RELAX, TURBO
Request Example
Response Example
{
  "code": 1,
  "description": "Submitted successfully",
  "result": "1781524258075013",
  "properties": {
    "discordInstanceId": "273d9093c1c54b6b",
    "discordChannelId": "273d9093c1c54b6b"
  }
}

3.2 Query Task Status (Fetch)#

Query the execution status, progress, and result of a specified task.
Request
GET /mj/task/{taskId}/fetch
Path Parameters
ParameterTypeDescription
taskIdstringTask ID returned when the task was submitted
Request Example
Response Example
{
  "id": "1781524258075013",
  "action": "IMAGINE",
  "prompt": "a futuristic cityscape at sunset --v 6.1",
  "promptEn": "a futuristic cityscape at sunset --v 6.1",
  "description": "Submitted successfully",
  "status": "SUCCESS",
  "progress": "100%",
  "submitTime": 1781524258075,
  "startTime": 1781524259689,
  "finishTime": 1781524294590,
  "imageUrl": "www.yourdomain.com/mj/image/1781524258075013",
  "failReason": "",
  "buttons": [
    {
      "customId": "MJ::JOB::upsample::1::675515df-961f-411e-8e9b-d81ac68427f5",
      "emoji": "",
      "label": "U1",
      "type": 2,
      "style": 2
    },
    {
      "customId": "MJ::JOB::reroll::0::675515df-961f-411e-8e9b-d81ac68427f5::SOLO",
      "emoji": "🔄",
      "label": "",
      "type": 2,
      "style": 2
    }
  ],
  "properties": {
    "finalPrompt": "a futuristic cityscape at sunset --v 6.1 --fast",
    "finalZhPrompt": ""
  }
}
Response Field Descriptions
FieldTypeDescription
idstringUnique task identifier
actionstringTask type: IMAGINE, UPSCALE, VARIATION, REROLL
promptstringOriginal prompt
statusstringTask status — see Task Status Enum
progressstringProgress percentage, e.g., 0%, 50%, 100%
imageUrlstringAccess path for the generated image (replace with actual domain prefix)
failReasonstringFailure reason (populated only on failure)
buttonsarrayAvailable action list, containing button information for U1-U4, V1-V4, Reroll, etc.
buttons[].customIdstringUnique action identifier — must be passed verbatim when submitting an Action
buttons[].labelstringButton display text (U1, V2, etc.)
submitTimeint64Submission timestamp (milliseconds)
startTimeint64Execution start timestamp (milliseconds)
finishTimeint64Completion timestamp (milliseconds)

3.3 Submit Action Task (Action)#

Execute follow-up operations on a completed task (upscale, variation, reroll).
Request
POST /mj/submit/action
Request Body
FieldTypeRequiredDescription
taskIdstringYesOriginal task ID
customIdstringYesThe complete customId obtained from the buttons array in the Fetch response. Do not manually construct this value
Important: The customId contains a unique UUID generated for each task and is not interchangeable between tasks. It must be copied verbatim from the buttons array in the Fetch response.
Request Example
Response Example
{
  "code": 1,
  "description": "Queued, 5 tasks ahead",
  "result": "1781524431429700",
  "properties": {
    "numberOfQueues": 5,
    "discordInstanceId": "273d9093c1c54b6b",
    "discordChannelId": "273d9093c1c54b6b"
  }
}
After an Action is submitted, a new task ID is returned. Poll the status using this new ID.

3.4 Retrieve Generated Image (Image)#

Directly retrieve the image file generated by a task.
Request
GET /mj/image/{taskId}
Path Parameters
ParameterTypeDescription
taskIdstringTask ID
Request Example
Response: Binary image file (Content-Type: image/png)

4. Complete Workflow#

┌─────────────────────────────────────────────────────────────────┐
│                    Midjourney API Workflow                       │
└─────────────────────────────────────────────────────────────────┘

  Step 1                Step 2                Step 3              Step 4
┌─────────┐     ┌──────────────────┐    ┌──────────────┐    ┌──────────────┐
│ Imagine  │────>│  Poll Fetch      │───>│  Get buttons  │───>│ Submit Action │
│ Submit   │     │  Wait for SUCCESS│    │  Extract      │    │ (Optional)   │
│ Task     │     │                  │    │  customId     │    │              │
└─────────┘     └──────────────────┘    └──────────────┘    └──────────────┘
     │                   │                      │                    │
     v                   v                      v                    v
  Returns taskId    Returns full task       buttons array        Returns new taskId
                    info with imageUrl      with customId           ─────┐
                                                                       │
                                                                       v
                                                               ┌──────────────┐
                                                               │ Poll new task │
                                                               │ Wait SUCCESS  │
                                                               └──────────────┘

Detailed Step-by-Step#

Step 1 — Submit Image Generation Task
Send a prompt and receive a taskId (e.g., 1781524258075013).
Step 2 — Poll Task Status
Poll at 3–5 second intervals until status becomes SUCCESS (typically takes 30–120 seconds).
Recommended polling strategy:
Interval: 5 seconds initially, then every 3 seconds
Timeout: Maximum 5 minutes
Termination condition: status is SUCCESS or FAILURE
Step 3 — Extract Available Actions
Once the task is complete, the buttons array in the response contains all executable actions. Each button's customId is the required parameter for submitting an Action.
Step 4 — Submit Follow-up Action (Optional)
Pass the original taskId and the complete customId obtained from buttons. A new taskId is returned — poll again until completion.

5. customId Format Specification#

The customId is dynamically generated by Midjourney and is unique to each task. Format:

5.1 Format Template#

MJ::JOB::{action}::{index}::{uuid}[::SOLO]
ComponentDescription
MJ::JOBFixed prefix
{action}Action type: upsample, variation, reroll
{index}Action index: 1-4 corresponding to grid positions; 0 for reroll
{uuid}Unique task identifier (UUID v4), different for each generation
::SOLOSuffix present only for reroll operations

5.2 Practical Examples#

Using task 1781524258075013 as an example, the Fetch response's buttons contain the following customIds:
ActionLabelcustomId
Upscale #1U1MJ::JOB::upsample::1::675515df-961f-411e-8e9b-d81ac68427f5
Upscale #2U2MJ::JOB::upsample::2::675515df-961f-411e-8e9b-d81ac68427f5
Upscale #3U3MJ::JOB::upsample::3::675515df-961f-411e-8e9b-d81ac68427f5
Upscale #4U4MJ::JOB::upsample::4::675515df-961f-411e-8e9b-d81ac68427f5
Reroll🔄MJ::JOB::reroll::0::675515df-961f-411e-8e9b-d81ac68427f5::SOLO
Variation #1V1MJ::JOB::variation::1::675515df-961f-411e-8e9b-d81ac68427f5
Variation #2V2MJ::JOB::variation::2::675515df-961f-411e-8e9b-d81ac68427f5
Variation #3V3MJ::JOB::variation::3::675515df-961f-411e-8e9b-d81ac68427f5
Variation #4V4MJ::JOB::variation::4::675515df-961f-411e-8e9b-d81ac68427f5

5.3 Grid Position Reference#

┌─────────┬─────────┐
│  1 (U1) │  2 (U2) │
│  (V1)   │  (V2)   │
├─────────┼─────────┤
│  3 (U3) │  4 (U4) │
│  (V3)   │  (V4)   │
└─────────┴─────────┘
Reminder: Do not attempt to manually construct customIds. The UUID portion is generated server-side by Midjourney and must be obtained from the buttons array via the Fetch endpoint.

6. Task Status Enum#

StatusDescriptionTerminal State
NOT_STARTNot startedNo
SUBMITTEDSubmittedNo
IN_PROGRESSIn progress (check the progress field for percentage)No
SUCCESSCompleted successfullyYes
FAILUREFailed (check failReason for details)Yes

7. Error Codes#

CodeDescriptionCause & Resolution
1Submitted successfullyNormal
21Task already existsDuplicate submission — use existing taskId to query
22QueuedQueue is busy — waiting for execution
23Queue is fullRetry later
24Prompt contains sensitive contentModify the prompt and retry
OtherSee description fieldTroubleshoot based on the description

8. Complete Code Examples#

8.1 Python — Full Workflow#

8.2 cURL — Full Workflow#


9. FAQ#

Q1: Can I manually construct a customId?#

No. The UUID in the customId is dynamically generated server-side by Midjourney for each task — different tasks have different UUIDs. You must obtain the complete customId from the buttons array via the Fetch endpoint.

Q2: Why does my request return 403?#

Check whether the User-Agent header is included. Cloudflare's front-end protection blocks requests without a User-Agent, returning 403 error code: 1010.

Q3: How long does a task typically take?#

OperationEstimated Duration
Imagine (2x2 grid)30–120 seconds
Upscale15–60 seconds
Variation30–120 seconds
Reroll30–120 seconds
Actual duration depends on queue length and selected mode (FAST/TURBO/RELAX).

Q4: What is www.yourdomain.com in imageUrl?#

This is a placeholder domain. To retrieve the actual image, use the GET /mj/image/{taskId} endpoint — there is no need to parse the imageUrl field.

Q5: What are the differences between FAST / RELAX / TURBO modes?#

ModeSpeedCost
TURBOFastestHigh
FASTFastMedium
RELAXSlower (queued)Low

End of Document
Previous
Edit image
Next
Task query interface