- 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
Segment With Prompt API
POST
https://api.piapi.ai/api/v1/task
Model | Price (USD) |
---|---|
Qubico/image-toolkit | $0.01 per million pixels, rounded up if less than 1 million. |
Request
Header Params
x-api-key
string
required
Body Params application/json
model
enum<string>
required
Allowed value:
Qubico/image-toolkit
task_type
enum<string>
required
Allowed value:
segment
input
object
required
image
string
required
prompt
string
required
negative_prompt
string
required
segment_factor
integer
required
Example
{
"model": "Qubico/image-toolkit",
"task_type": "segment",
"input": {
"image": "https://st.mngbcn.com/rcs/pics/static/T5/fotos/outfit/S20/57034757_56-99999999_01.jpg",
"prompt": "clothes,shoes",
"negative_prompt": "pants",
"segment_factor": -15
}
}
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": "Qubico/image-toolkit",
"task_type": "segment",
"input": {
"image": "https://st.mngbcn.com/rcs/pics/static/T5/fotos/outfit/S20/57034757_56-99999999_01.jpg",
"prompt": "clothes,shoes",
"negative_prompt": "pants",
"segment_factor": -15
}
}'
Responses
🟢200Success
application/json
Body
code
integer
required
data
object
required
task_id
string
required
task_type
string
required
status
string
required
task_info
object
required
task_result
object
required
message
string
required
Example
{
"code": 200,
"data": {
"task_id": "75a20dc9-ac3f-4869-b8d5-b9xxxxx7",
"model": "Qubico/image-toolkit",
"task_type": "segment",
"status": "",
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {
"image": "https://img.midjourneyapi.xyz/ephemeral/4xxxxxxx.jpg",
"prompt": "clothes,shoes",
"negative_prompt": "pants",
"segment_factor": -15
},
"output": null,
"meta": {
"created_at": "2024-10-23T10:31:31.012033927Z",
"started_at": "0001-01-01T00:00:00Z",
"ended_at": "0001-01-01T00:00:00Z"
},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}
Modified at 2025-03-19 03:37:40