Midjourney
Premium AI image generation with text-to-image, image-to-image, upscale, and variation
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/generateTask/midjourney | Create generation task |
| GET | /api/v1/statusTask/midjourney | Query task status |
Authentication
All requests require an API Key in the header:
Request Body
Parameters
Common Parameters
request_typestringasynccallback_urlstringproviderstringautoInput Parameters
All modes require the input object with mode-specific parameters.
Universal Input Parameters:
modestringversionstringv6.1speedstringfastOptional Enhancement Parameters:
enableTranslationbooleanfalseaspectstring1:1chaosinteger0stylizeinteger100weirdinteger0Model Version Guide
Available Versions: v6, v6.1, v7, niji 6, niji 7 (Default: v6.1)
v7 (Latest, April 2025)
- Best overall quality with breakthrough improvements in text/image understanding
- Exceptional accuracy in human anatomy, hand details, and object textures
- Includes Sketch Mode for rapid iteration and enhanced image reference capabilities
- Recommended for: Professional work requiring highest quality and detail
v6.1 (Default, July 2024)
- ~25% faster than v6 with more coherent results
- Precise details and textures with excellent balance of speed and quality
- Recommended for: General use and production workflows
v6 (December 2023)
- Improved prompt accuracy for longer inputs and enhanced coherence
- Advanced image prompting and remix capabilities
- Recommended for: Projects requiring specific v6 characteristics
niji 7 (Latest for Anime)
- Professional anime creation with precise character control and rich stylization
- Dramatic lighting, flexible style adjustment from photorealistic to highly stylized
- Superior multi-character consistency and aesthetic quality
- Recommended for: Anime, manga, and illustration projects
niji 6 (June 2024)
- Specialized for Eastern/anime aesthetics with improved Japanese text rendering
- Better anime eye structure and detail rendering
- Recommended for: Anime-style illustrations with Japanese text
Mode: text-to-image (Text-to-Image Generation)
Generate images from text descriptions.
modestringpromptstringversionstringspeedstringNote: text-to-image mode also supports optional enhancement parameters (aspect, chaos, stylize, weird, enableTranslation) listed above.
Mode: image-to-image (Image-to-Image Generation)
Generate new images based on reference images. Use descriptive language in prompts rather than editing instructions.
Best Practice: Describe the desired result, not the editing action.
- ✅ Good: "a dog lying in a park"
- ❌ Bad: "change the background to a park"
modestringpromptstringimage_urlsstring[]versionstringspeedstringMode: upload-paint (Inpainting / Region Editing)
Edit specific regions of an image by painting a mask. Requires precise mask definition.
modestringpromptstringimage_urlsstring[]versionstringspeedstringmaskobjectcanvasobjectimgPosobjectMode: vary (Create Variations)
Generate similar but varied versions of a previous result.
modestringtaskIdstringimageIndexintegertypeintegerpromptstringMode: upscale (High-Resolution Upscaling)
Upscale a previous result to higher resolution.
modestringtaskIdstringimageIndexintegertypeintegerAvailable Modes
Currently Available:
text-to-image— Text-to-image generationimage-to-image— Image-to-image generation with reference imagesupload-paint— Inpaint specific regions (requires mask)vary— Create variations with similar styleupscale— High-resolution upscaling
Additional Capabilities (Contact us to enable):
Outpaint— Extend image boundariesRetexture— Apply new textures to imagesRemove Background— Background removalReroll— Re-execute generation task
Examples
Text-to-Image
Image-to-Image
Upload-Paint (Inpainting)
Vary (Create Variation)
Upscale
Response
POST /api/v1/generateTask/midjourney
Returns taskId on success for subsequent status queries.
Success:
Error:
GET /api/v1/statusTask/midjourney
Query task execution status and results via taskId.
Success:
Failed:
Status Response Fields
| Field | Type | Description |
|---|---|---|
taskId | string | Unique task identifier |
state | string | pending processing success failed |
resultJson | string | JSON containing resultUrls array (on success), typically 4 images |
failCode | string | Error code (on failure) |
failMsg | string | Error message (on failure) |
createTime | integer | Task creation timestamp (ms) |
completeTime | integer | Task completion timestamp (ms) |
costTime | integer | Processing duration (ms) |
Error Codes
| Code | Description |
|---|---|
| 400 | Invalid parameters or request error |
| 401 | Invalid or missing API Key |
| 429 | Rate limit exceeded |
| Fail Code | Description |
|---|---|
CONTENT_VIOLATION | Content violates safety guidelines |
INVALID_IMAGE_URL | Cannot access provided image URL |
INVALID_TASK_ID | Invalid previous task ID |
Rate Limits
| Limit | Value |
|---|---|
| Requests | 10000 / minute |
| Concurrent tasks | 1000 |
Exceeding limits returns 429 error. Wait and retry.
Tips
-
Prompt translation: Enable
enableTranslation: truefor non-English prompts. English typically yields better results in Midjourney. -
Aspect ratio: Choose based on use case:
1:1- Social media posts, avatars4:3- Classic photography, presentations16:9- Widescreen, videos, banners9:16- Mobile stories, vertical videos
-
Chaos parameter: Control result diversity:
0-30- Consistent, predictable results (recommended for production)30-70- Balanced variety with creative exploration70-100- Maximum diversity, experimental outputs
-
Stylize parameter: Balance realism vs artistry:
0-250- Literal interpretation, realistic250-750- Balanced (default: 100)750-1000- Highly artistic, creative interpretation
-
Weird parameter: Add surreal/unconventional elements:
10-300- Subtle unusual touches300-1000- Noticeable non-traditional elements1000-3000- Extreme surrealism and abstraction
-
Generation time:
fastmode: ~30-45 seconds, generates 4 imagesturbomode: ~15-25 seconds, faster- Submit task, wait 20 seconds, then poll every 3 seconds
-
Callback mode: Use
callbackmode to avoid frequent polling. -
Image expiration: Result URLs are valid for 15 days. Download promptly.
-
Content moderation: Prompts must comply with safety guidelines.
-
Version selection: See the Model Version Guide above for detailed recommendations on choosing the right version for your use case
-
Recommended workflow:
- Use
text-to-imageto generate initial 4 images - Select preferred image (0-3), use
upscalefor high-resolution output - Or use
varyto create more variations - Iterate until desired result
- Use
-
Image-to-image mode:
- Use descriptive language in prompts: describe what you want to see, not editing actions
- Example: "a dog in a park" instead of "change background to park"
- More reference images = less control over output. Use 1-2 images for best results
-
Upload-paint mode (inpainting):
mask.areas: Define polygon regions with width, height, and points array. Points are in clockwise order as [x1,y1,x2,y2,...] from top-left originmask.url: Black/white mask image with same dimensions as original (white = regenerate region). Supports base64 encodingimgPos: Specifies image position and size on canvas
-
Upscale types:
- Type 0: Standard HD
- Type 1: Creative HD (adds creative details)
- Type 2: 2x HD resolution
- Type 3: 4x HD resolution
-
Image formats:
image_urlssupports JPG, PNG, WebP, max 10MB per image.