증명사진 메이커 API
PixMiller REST API · v1
인물 사진을 보내면 API가 배경을 제거하고, 표준 증명사진 배경색으로 변경한 뒤 요청한 규격으로 크롭합니다.
이 엔드포인트는 프리뷰 중입니다 — 경로와 매개변수가 확정되고 있으며 출시 전에 변경될 수 있습니다. 규칙(X-Api-Key 인증, JSON 응답)은 라이브 배경 제거 API와 일치합니다.
POST
https://api.pixmiller.com/v1/id-photo
1
인증 및 요청
요청 헤더의
X-Api-Key: YOUR_API_KEY에 시크릿 키를 보내세요. 계정 페이지에서 키를 생성하고 관리하세요.
| 파라미터 | 유형 | 필수 | 설명 |
|---|---|---|---|
image_file
|
file | 필수 | 인물 사진 — 정면, 균일한 조명 |
spec
|
string | 필수 | 규격: 1inch / 2inch / us_passport / cn_visa … |
bg_color
|
string | 선택 | 배경: white (기본값) / blue / red |
2
코드 샘플
언어를 선택하고 복사하세요 — 바로 실행 가능합니다.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"
1import requests23resp = requests.post(4 "https://api.pixmiller.com/v1/id-photo",5 headers={"X-Api-Key": "YOUR_API_KEY"},6 files={"image_file": open("face.jpg", "rb")},7 data={"spec": "1inch", "bg_color": "blue"},8)9print(resp.json()["url"])
1import fs from "node:fs";23const form = new FormData();4form.append("image_file", new Blob([fs.readFileSync("face.jpg")]), "face.jpg");5form.append("spec", "1inch");6form.append("bg_color", "blue");7const resp = await fetch("https://api.pixmiller.com/v1/id-photo", {8 method: "POST",9 headers: { "X-Api-Key": "YOUR_API_KEY" },10 body: form,11});12console.log((await resp.json()).url);
3
응답
1{2 "url": "https://cdn.pixmiller.com/result/8Kd2pQ.png"3}
url
처리된 이미지의 임시 URL (원본 이미지는 3일 후 자동 삭제됩니다).
4
오류
오류는 일치하는 상태 코드와 다음과 같은 형태의 JSON 본문을 반환합니다 {"errors":{"code":"…","message":"…"}}.
400
validation error
image_file이 누락되었거나 유효하지 않음, 파일이 너무 크거나 이미지 소스가 충돌합니다.
401
authentication_failed
X-Api-Key 헤더가 누락되었거나 유효하지 않습니다.
402
not_enough_credit
size=full이 요청되었지만 계정에 HD 크레딧이 남아있지 않습니다.
422
invalid_image
이미지를 처리할 수 없습니다 — 너무 작거나, 지원되지 않거나, 디코딩에 실패했습니다.
429
throttled
속도 제한을 초과했습니다. Retry-After 헤더 후에 다시 시도해 주세요.