- 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
Upscale
POST
https://api.piapi.ai/api/v1/task
upscale
command from the official 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:
upscale
input
object
required
origin_task_id
string
required
index
enum<string>
required
Light/beta are available for V4 model UPSCALED tasks only; 2x/4x for V5 model UPSCALED tasks only; subtle/creative for V6 UPSCALED tasks models only.
Allowed values:
1234lightbeta2x4xsubtlecreative
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": "upscale",
"input": {
"origin_task_id": "ee6f1989-5de2-4e4a-b860-b059ad57a023",
"index": "3"
},
"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": "upscale",
"input": {
"origin_task_id": "ee6f1989-5de2-4e4a-b860-b059ad57a023",
"index": "3"
},
"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": "f82d8ace-xxxx-xxxx-xxxx-xxxxxx72038d",
"model": "midjourney",
"task_type": "upscale",
"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 06:47:22