Upload
Host a local image and get back a public URL to use as input for any endpoint. Most
endpoints take a public image URL (for example input_image, person_image,
source, clothing_image); use Upload when your image is on disk rather than already
hosted somewhere public.
POST /upload/image/v1 is a multipart request (not JSON). Send the file in a
file field, and set the part's content type so the server can validate it.
- cURL
- JavaScript
- Python
- Java
curl -X POST https://api.imagepipeline.io/upload/image/v1 \
-H "X-API-Key: $IMAGEPIPELINE_API_KEY" \
-F "file=@/path/to/image.png"
const form = new FormData();
form.append("file", fileInput.files[0]);
const res = await fetch("https://api.imagepipeline.io/upload/image/v1", {
method: "POST",
headers: { "X-API-Key": process.env.IMAGEPIPELINE_API_KEY },
body: form,
});
const { url } = await res.json();
import requests
with open("image.png", "rb") as f:
res = requests.post(
"https://api.imagepipeline.io/upload/image/v1",
headers={"X-API-Key": API_KEY},
files={"file": f},
)
url = res.json()["url"]
// Multipart upload; use your HTTP client's multipart builder to attach
// the "file" part, then POST to /upload/image/v1 with the X-API-Key header.
| Field | Type | Notes |
|---|---|---|
file | file | Required. The image to host. Allowed types: PNG, JPEG, WebP, GIF. Set the part content type (e.g. ;type=image/png); a missing or generic application/octet-stream type is rejected. |
Unlike the generation endpoints, upload is synchronous: it returns the hosted image
url directly, with no job_id to poll. Pass that URL straight into any endpoint's
image field.
Response — returns the hosted URL immediately (synchronous, no job to poll):
{
"url": "https://cdn.imagepipeline.io/u/3e9b71c0.png",
"filename": "product.png",
"size_bytes": 184320
}
# then use it as input, e.g. virtual try-on
curl -X POST https://api.imagepipeline.io/creator/tryon/image/v1 \
-H "X-API-Key: $IMAGEPIPELINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "person_image": "https://cdn.imagepipeline.io/u/abc123.png", "clothing_image": "...", "gender": "woman", "clothing_type": "denim jacket" }'