Midjourney AI Image Generator API documentation
Generate images with Midjourney AI Image Generator (Midjourney).
Endpoints
| Contract item | Value |
|---|---|
| Capability | midjourney-ai-image-generator |
| Submit | POST https://vidmage.ai/api/v1/midjourney-ai-image-generator/submit |
| Query | POST https://vidmage.ai/api/v1/midjourney-ai-image-generator/query |
| Task identifier | taskId |
| Result field | imageUrl |
Authenticate with Authorization: Bearer YOUR_API_KEY. Save the task identifier and query the same capability. Use a stable Idempotency-Key for submission retries.
Product guide: Midjourney Image API
Parameters and input rules
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
prompt | string | Yes | Not specified | Text prompt describing the image to generate (max 8192 chars). For an unspecified character or figurine, use an original non-branded character with no logos and no resemblance to existing copyrighted superheroes; preserve any character the user explicitly names. Minimum characters: 1Maximum characters: 8192 |
aspectRatio | string | No | "1:1" | Output aspect ratio. Values: "1:1", "4:3", "3:2", "16:9", "3:4", "2:3", "9:16" |
negativePrompt | string | No | Not specified | Describe content that should not appear in the image. Maximum characters: 2000 |
chaos | integer | No | 0 | Increase variation and unpredictability. Minimum: 0Maximum: 100Multiple of: 1 |
quality | string | No | "1" | Rendering quality level. Values: "1", "2", "4" |
stylize | integer | No | 0 | Control the strength of Midjourney styling. Minimum: 0Maximum: 1000Multiple of: 1 |
weird | integer | No | 0 | Control unconventional and experimental aesthetics. Minimum: 0Maximum: 3000Multiple of: 1 |
raw | boolean | No | false | Reduce automatic styling for more literal prompt control. |
imageUrl | string | No | Not specified | Optional base image prompt. |
iw | integer | No | 1 | Control the influence of the base image prompt. Requires imageUrl when supplied. Minimum: 0Maximum: 3Multiple of: 1Requires imageUrl when supplied. |
sref | string | No | Not specified | Optional style reference image. |
sw | integer | No | 100 | Control the influence of the style reference. Requires sref when supplied. Minimum: 0Maximum: 1000Multiple of: 1Requires sref when supplied. |
sv | integer | No | 4 | Style reference model version. Requires sref when supplied. Minimum: 1Maximum: 6Multiple of: 1Requires sref when supplied. |
oref | string | No | Not specified | Optional Omni reference image. |
ow | integer | No | 100 | Control the influence of the Omni reference. Requires oref when supplied. Minimum: 1Maximum: 1000Multiple of: 1Requires oref when supplied. |
tile | boolean | No | false | Create a seamless repeating pattern. |
text to image
These are public VidMage field names. The server maps them to provider fields. Input media selects the mode; use its limits together with the parameter table.
| Control | Mode-specific rule |
|---|---|
prompt | Required; 1–8192 characters. |
aspectRatio | Values: "1:1", "4:3", "3:2", "16:9", "3:4", "2:3", "9:16". Default: 1:1. |
resolution | Not used in this mode. |
negativePrompt | Describe content that should not appear in the image. Maximum characters: 2000 |
chaos | Increase variation and unpredictability. Minimum: 0Maximum: 100Multiple of: 1Default: 0 |
quality | Rendering quality level. Values: "1", "2", "4"Default: "1" |
stylize | Control the strength of Midjourney styling. Minimum: 0Maximum: 1000Multiple of: 1Default: 0 |
weird | Control unconventional and experimental aesthetics. Minimum: 0Maximum: 3000Multiple of: 1Default: 0 |
raw | Reduce automatic styling for more literal prompt control. Default: false |
imageUrl | Optional base image prompt. |
iw | Control the influence of the base image prompt. Minimum: 0Maximum: 3Multiple of: 1Requires imageUrl when supplied.Default: 1 |
sref | Optional style reference image. |
sw | Control the influence of the style reference. Minimum: 0Maximum: 1000Multiple of: 1Requires sref when supplied.Default: 100 |
sv | Style reference model version. Minimum: 1Maximum: 6Multiple of: 1Requires sref when supplied.Default: 4 |
oref | Optional Omni reference image. |
ow | Control the influence of the Omni reference. Minimum: 1Maximum: 1000Multiple of: 1Requires oref when supplied.Default: 100 |
tile | Create a seamless repeating pattern. Default: false |
Example request
{
"imageUrl": "https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp",
"prompt": "A serene mountain observatory above the clouds at sunrise, cinematic wide-angle landscape photography",
"aspectRatio": "1:1",
"chaos": 0,
"quality": "1",
"stylize": 0,
"weird": 0,
"raw": false,
"iw": 1,
"sref": "https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp",
"sw": 100,
"sv": 4,
"oref": "https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp",
"ow": 100,
"tile": false
}# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/midjourney-ai-image-generator/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"imageUrl":"https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp","prompt":"A serene mountain observatory above the clouds at sunrise, cinematic wide-angle landscape photography","aspectRatio":"1:1","chaos":0,"quality":"1","stylize":0,"weird":0,"raw":false,"iw":1,"sref":"https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp","sw":100,"sv":4,"oref":"https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp","ow":100,"tile":false}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Task results and recovery
URL of the generated image. Read imageUrl from the completed query response. Preserve taskId while the task is running.
curl -X POST "https://vidmage.ai/api/v1/midjourney-ai-image-generator/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "imageUrl": "https://..." } }Submission and task queries report the available task and usage information. A timeout is not a confirmed failure. Recover the existing task instead of resubmitting.
For face selection and error recovery, follow Task lifecycle. MCP uses the normalized taskId argument in get_task_result, including capabilities whose REST identifier is requestId.
Credits
| Component / option | Rate | Minimum |
|---|---|---|
| Base rate | 15 credits / generation | — |
Base charge is per generation at the selected resolution.
Use the Playground or the MCP credit estimator for your exact inputs. Credits and billing.
