POST
/
api
/
v1
/
mj
/
generate
生成Midjourney图像
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"
  }
}

使用指南

  • 此端点根据您的文本提示词创建图像
  • 将生成多个变体
  • 支持文本生成图像、图像生成图像和图像生成视频

开发者说明

  • 新用户建议:从简单的提示词开始以获得最佳效果。
  • 生成的图像文件在删除前保留15天。
  • 确保提供所有必需字段以获得最佳生成效果。

Authorizations

Authorization
string
header
required

所有 API 都需要通过 Bearer Token 进行认证。

获取 API Key:

  1. 访问 API Key 管理页面 获取您的 API Key

使用方法: 添加到请求头: Authorization: Bearer YOUR_API_KEY

注意:

  • 请妥善保管您的 API Key,不要与他人分享
  • 如果您怀疑 API Key 已泄露,请立即在管理页面重置

Body

application/json

Response

请求成功

The response is of type object.