POST
/
api
/
v1
/
mj
/
generate
Generate Midjourney Image
curl --request POST \
  --url https://api.kie.ai/api/v1/mj/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "taskType": "mj_txt2img",
  "speed": "relaxed",
  "prompt": "Help me generate a sci-fi themed fighter jet in a beautiful sky, to be used as a computer wallpaper",
  "fileUrls": [
    "https://example.com/image.jpg"
  ],
  "aspectRatio": "16:9",
  "version": "7",
  "variety": 10,
  "stylization": 1,
  "weirdness": 1,
  "waterMark": "",
  "enableTranslation": false,
  "callBackUrl": "https://api.example.com/callback",
  "ow": 500,
  "videoBatchSize": 1,
  "motion": "high"
}'
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "mj_task_abcdef123456"
  }
}

Usage Guide

  • This endpoint creates images based on your text prompt
  • Multiple variations will be generated
  • Supports text-to-image, image-to-image, and image-to-video generation

Developer Notes

  • Recommendation for First-Time Users: Start with simple prompts for best results.
  • Generated image files are retained for 15 days before being deleted.
  • Ensure all required fields are provided for optimal generation.

Authorizations

Authorization
string
header
required

All APIs require authentication via Bearer Token.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header: Authorization: Bearer YOUR_API_KEY

Note:

  • Keep your API Key secure and do not share it with others
  • If you suspect your API Key has been compromised, reset it immediately in the management page

Body

application/json

Response

200
application/json

Request successful

The response is of type object.