Send a portrait and a style; the AI restyles it into anime, oil painting, 3D and more, returning a stylized image.
Authentication & request
X-Api-Key: YOUR_API_KEY request header. Create and manage keys on your account page.
| Parameter | Type | Required | Description |
|---|---|---|---|
image_file
|
file | required | Portrait photo — clear face recommended |
style
|
string | required | Style preset id (full list via GET /v1/styles) |
prompt
|
string | optional | Custom style description, overrides the style preset |
Code samples
Pick a language and copy — runs as-is.1curl -X POST "https://api.pixmiller.com/v1/portrait-style" \2 -H "X-Api-Key: YOUR_API_KEY" \3 -F "[email protected]" \4 -F "style=anime"
1import requests23resp = requests.post(4 "https://api.pixmiller.com/v1/portrait-style",5 headers={"X-Api-Key": "YOUR_API_KEY"},6 files={"image_file": open("portrait.jpg", "rb")},7 data={"style": "anime"},8)9print(resp.json()["url"])
1import fs from "node:fs";23const form = new FormData();4form.append("image_file", new Blob([fs.readFileSync("portrait.jpg")]), "portrait.jpg");5form.append("style", "anime");6const resp = await fetch("https://api.pixmiller.com/v1/portrait-style", {7 method: "POST",8 headers: { "X-Api-Key": "YOUR_API_KEY" },9 body: form,10});11console.log((await resp.json()).url);
Response
1{2 "url": "https://cdn.pixmiller.com/result/8Kd2pQ.png"3}
url
Temporary URL of the processed image (the underlying image is auto-deleted after 3 days).
Errors
Errors return the matching status code and a JSON body shaped like {"errors":{"code":"…","message":"…"}}.
validation error
Missing or invalid image_file, file too large, or conflicting image sources.
authentication_failed
The X-Api-Key header is missing or invalid.
not_enough_credit
size=full was requested but the account has no HD credits left.
invalid_image
The image could not be processed — too small, unsupported, or failed to decode.
throttled
Rate limit exceeded. Slow down and retry after the Retry-After header.