Imagine
POST
/api/v1/taskThis endpoint from PiAPI's Midjourney API generates 4 unique images in a 2x2 grid from a text description also known as prompt. This endpoint corresponds with the /imagine
command from the offical Midjourney.
Request
Your API Key for authorization.
A prompt is a description that enables Midjourney API to produce an image.
This parameter dictates the ouput image's aspect ratio value.
This parameter indicates the operation process mode
Use this parameter to skip our internal prompt check.
Only Host-Your-Account users on the Pro Plan can use this parameter. This parameter specifies which Midjourney account will process this task.
Webhook provides timely task notifications. Check PiAPI webhook for detail.
This allows users to choose whether this specific task will get processed under PAYG or HYA mode. If unspecified, then this task will get processed under whatever mode (PAYG or HYA)
the user chose on the workspace setting of your account.
public
means this task will be processed under PAYG mode.private
means this task will be processed under HYA mode.
{
"model": "midjourney",
"task_type": "imagine",
"input": {
"prompt": "flying night city",
"aspect_ratio": "16:9",
"process_mode": "fast",
"skip_prompt_check": false,
"bot_id": 0
},
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "https://webhook.site/",
"secret": "123456"
}
}
}
Request samples
Responses
Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged
If you get non-null error message, here are some steps you chould follow:
- Check our common error message
- Retry for several times
- If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon.
{
"code": 200,
"data": {
"task_id": "39631ce-xxxx-xxxx-xxxx-6de760cd2053",
"model": "midjourney",
"task_type": "imagine",
"status": "pending",
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {},
"output": {
"image_url": "",
"image_urls": null,
"temporary_image_urls": null,
"discord_image_url": "",
"actions": [],
"progress": 0,
"intermediate_image_urls": null
},
"meta": {},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}