Endpoints
| Método | Endpoint | Descripción |
|---|---|---|
| POST | /api/v1/generateTask/midjourney | Crear tarea de generación |
| GET | /api/v1/statusTask/midjourney | Consultar estado de la tarea |
Autenticación
Todas las solicitudes requieren una clave API en el header:Cuerpo de la solicitud
Parámetros
Common Parameters
async (polling) or callback (webhook)
Callback URL, required when request_type=callback (conditional)
Routing strategy: auto, value, or official
Input Parameters
All modes require theinput object with mode-specific parameters.
Universal Input Parameters:
Operation mode: text-to-image, image-to-image, vary, or upscale
Model version (see version guide below). Options: ‘v6’, ‘v6.1’, ‘v7’, ‘niji 6’, ‘niji 7’
Generation speed: ‘fast’ or ‘turbo’
Auto-translate prompts to English for better results. English prompts typically perform better in Midjourney.
Image aspect ratio. Options: 1:1 (square), 4:3 (classic), 2:3 (portrait), 16:9 (widescreen), 9:16 (mobile). Full list: 1:1, 1:2, 2:1, 2:3, 3:2, 3:4, 4:3, 5:6, 6:5, 9:16, 16:9
Variation level (0-100). Low (0-30): consistent results. Medium (30-70): balanced variety. High (70-100): diverse, unexpected results.
Artistic vs realistic balance (0-1000). Low (0-250): realistic, literal. Medium (250-750): balanced. High (750-1000): highly artistic.
Surreal/unconventional effects (0-3000). Low (10-300): subtle quirks. Medium (300-1000): noticeable unusual elements. High (1000-3000): extreme surrealism.
Model 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
- ~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
- Improved prompt accuracy for longer inputs and enhanced coherence
- Advanced image prompting and remix capabilities
- Recommended for: Projects requiring specific v6 characteristics
- 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
- 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.Set to ‘text-to-image’
Text description, 1-2000 characters
Model version: ‘v6.1’, ‘v7’, ‘niji 6’, or ‘niji 7’
Generation speed: ‘fast’ or ‘turbo’
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”
Set to ‘image-to-image’
Descriptive text of desired result (not editing instructions). Use descriptive language: ‘a dog in a park’ instead of ‘change background to park’
Array of reference image URLs. More images = less control over output. Recommended: 1-2 images for better results
Model version: ‘v6.1’, ‘v7’, ‘niji 6’, or ‘niji 7’
Generation speed: ‘fast’ or ‘turbo’
Mode: upload-paint (Inpainting / Region Editing)
Edit specific regions of an image by painting a mask. Requires precise mask definition.Set to ‘upload-paint’
Text description for the masked region
Array with 1 image URL (the source image to edit)
Model version: ‘v6.1’, ‘v7’, ‘niji 6’, or ‘niji 7’
Generation speed: ‘fast’ or ‘turbo’
Inpainting region (choose one method: areas or url)
Canvas dimensions
Image position and size on canvas
Mode: vary (Create Variations)
Generate similar but varied versions of a previous result.Set to ‘vary’
Previous task ID
Image index from previous result (0-3)
Variation strength: 0=Subtle variation, 1=Strong variation
Optional text guidance for the variation
Mode: upscale (High-Resolution Upscaling)
Upscale a previous result to higher resolution.Set to ‘upscale’
Previous task ID
Image index from previous result (0-3)
Upscale type: 0=Standard HD, 1=Creative HD, 2=2x HD, 3=4x HD
Available 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
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
Respuesta
POST /api/v1/generateTask/midjourney
DevuelvetaskId en éxito para consultas de estado posteriores.
Éxito:
GET /api/v1/statusTask/midjourney
Consulta el estado de ejecución y resultados de la tarea víataskId.
Campos de respuesta de estado
Identificador único de la tarea.
Estado actual:
pending, processing, success, or failed.JSON string containing
resultUrls array. Only present on success. Parse with JSON.parse().Error code. Only present when
state is failed. See Códigos de error.Human-readable error message. Only present when
state is failed.Task creation timestamp (Unix milliseconds).
Task completion timestamp (Unix milliseconds).
Processing duration in milliseconds.
Códigos de error
| Código | Descripción |
|---|---|
| 400 | Parámetros inválidos o error de solicitud |
| 401 | Clave API inválida o faltante |
| 429 | Límite de tasa excedido |
| Fail Code | Descripción |
|---|---|
CONTENT_VIOLATION | Content violates safety guidelines |
INVALID_IMAGE_URL | Cannot access provided image URL |
INVALID_TASK_ID | Invalid previous task ID |
Límites de tasa
| Límite | Valor |
|---|---|
| Requests | 10000 / minute |
| Concurrent tasks | 1000 |
429. Espera y reintenta.
Consejos
-
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.