- Get Started
- Endpoints
- Flux
- AI Hug
- LLM
- Midjourney
- Faceswap
- TTS
- Song(Suno+Udio)
- Trellis
- Luma Dream Machine
- Kling
- Hailuo
- Skyreels
- WanX
- Hunyuan Video
- PiAPI Account Management
- Mmaudio
- DiffRhythm
- Tools
- Resources
- Legacy Documentation
Reroll
POST
https://api.piapi.ai/api/v1/task
Re-run
or Re-roll
button from the offcial Midjourney.Request
Header Params
X-API-Key
string
required
Body Params application/json
model
enum<string>
required
Allowed value:
midjourney
task_type
enum<string>
required
Allowed value:
reroll
input
object
required
origin_task_id
string
required
prompt
string
optional
aspect_ratio
string
optional
Default:
1:1
skip_prompt_check
boolean
optional
Default:
false
config
object
optional
webhook_config
object
optional
service_mode
enum<string>
optional
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.Allowed values:
publicprivate
Example
{
"model": "midjourney",
"task_type": "reroll",
"input": {
"origin_task_id": "4b12f7bf-028b-417e-9bcd-b600a6b0a03c",
"prompt": "angry cat wearing hat, smoking",
"aspect_ratio": "16:9",
"skip_prompt_check": false
},
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.piapi.ai/api/v1/task' \
--header 'X-API-Key;' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "midjourney",
"task_type": "reroll",
"input": {
"origin_task_id": "4b12f7bf-028b-417e-9bcd-b600a6b0a03c",
"prompt": "angry cat wearing hat, smoking",
"aspect_ratio": "16:9",
"skip_prompt_check": false
},
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}'
Responses
🟢200OK
application/json
Body
code
integer
required
data
object
required
task_id
string
required
model
string
required
task_type
string
required
status
enum<string>
required
Allowed values:
CompletedProcessingPendingFailedStaged
input
object
required
output
object
required
meta
object
required
detail
null
required
logs
array [object]
required
error
object
required
message
string
required
Example
{
"code": 200,
"data": {
"task_id": "ed4b09f0-1989-41f1-80ab-11570897096e",
"model": "midjourney",
"task_type": "reroll",
"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"
}
🟠400Bad Request
🟠401Unauthorized
🔴500Server Error
Modified at 2024-10-18 10:59:19