- 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
Variation
POST
https://api.piapi.ai/api/v1/task
Variations
commands from the offical 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:
variation
input
object
required
origin_task_id
string
required
index
enum<string>
required
High_variation and low_variation are only valid for both V5.2 and V6 tasks (high_variation means vary_strong, low_variation stands for vary_subtle; high_variation and low_variation are meant to use upon upscaled(u1/u2/u3/u4) task, not original imagine/blend task
Allowed values:
1234high_variationlow_variation
prompt
string
required
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": "variation",
"input": {
"origin_task_id": "8409f94e-dd6a-4e5d-874d-3a074e72dcd0",
"index": "1",
"prompt": "angry cat wearing a hat",
"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": "variation",
"input": {
"origin_task_id": "8409f94e-dd6a-4e5d-874d-3a074e72dcd0",
"index": "1",
"prompt": "angry cat wearing a hat",
"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": "6a216a6c-f775-4318-9200-16afe2bd2584",
"model": "midjourney",
"task_type": "variation",
"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-27 07:31:22