PixMiller PixMiller
Home / API / ID Photo Maker API
Developer API Preview

ID Photo API Preview · v1

Pass a portrait and a spec; get back a compliant ID photo — automatic background removal, standard background color and exact crop. Built for government, HR and photo-studio systems.

Endpoint
POST api.pixmiller.com/v1/id-photo
curl -X POST \
  api.pixmiller.com/v1/id-photo \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "[email protected]"
ID Photo Maker API
PixMiller REST API · v1
planned: 1 credit per image

Send a portrait; the API removes the portrait background, swaps to a standard ID background color and crops to the requested spec.

This endpoint is in preview — the route and parameters are being finalised and may change before launch. Conventions (X-Api-Key auth, JSON response) match the live background removal API.
POST https://api.pixmiller.com/v1/id-photo
1

Authentication & request

Send your secret key in the 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 — front-facing, evenly lit
spec string required Spec: 1inch / 2inch / us_passport / cn_visa …
bg_color string optional Background: white (default) / blue / red
2

Code samples

Pick a language and copy — runs as-is.
1curl -X POST "https://api.pixmiller.com/v1/id-photo" \2  -H "X-Api-Key: YOUR_API_KEY" \3  -F "[email protected]" \4  -F "spec=1inch" \5  -F "bg_color=blue"
3

Response

201 Created · JSON
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).
4

Errors

Errors return the matching status code and a JSON body shaped like {"errors":{"code":"…","message":"…"}}.

400 validation error Missing or invalid image_file, file too large, or conflicting image sources.
401 authentication_failed The X-Api-Key header is missing or invalid.
402 not_enough_credit size=full was requested but the account has no HD credits left.
422 invalid_image The image could not be processed — too small, unsupported, or failed to decode.
429 throttled Rate limit exceeded. Slow down and retry after the Retry-After header.

Why build on the ID Photo Maker API

10+ ID specs
~4s Per image
100+/min Batch throughput
white/blue/red Backgrounds
Every spec built in
Standard backgrounds
Fast and stable
Minutes to integrate

Where developers use the ID Photo Maker API

Government / registration

Users upload a selfie and get a compliant ID photo, no studio visit.

HR / OA platforms

Standardize onboarding and badge photos in bulk.

Studio / print apps

Embed ID-photo output, multiple specs from a single shot.

1 Create an API key Create a key on the API keys page. New accounts get a free HD credit for testing.
2 Make a request Copy any sample above, swap in your key and image, and run your first call.
3 Go to production Tune concurrency and retries, then ship — billed per image, volume pricing available.

Developer FAQ

Which specs are supported?

1-inch, 2-inch, passport, visa and more — pass the matching spec id.

Can I change the background?

Yes. Pass bg_color as white / blue / red.

Other tools' APIs

Build with the PixMiller API Get early access