PixMiller PixMiller
ホーム / API / 背景透過・削除 API
開発者API

背景削除 API REST API · v1

PixMillerの背景リムーバーを自社のスタックに組み込めます。1回のPOSTリクエストで約5秒で背景を除去し、透明PNGを返します。高いエッジ精度、画像ごとの従量課金です。

エンドポイント
POST api.pixmiller.com/v1/remove
curl -X POST \
  api.pixmiller.com/v1/remove \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "[email protected]"
背景透過・削除 API
PixMiller REST API · v1
full = 1クレジット · プレビュー無料

画像をアップロードすると、AIが背景を除去し透明PNGを返します。同期処理 — 通常数秒。

POST https://api.pixmiller.com/v1/remove
1

認証とリクエスト

リクエストヘッダーのX-Api-Key: YOUR_API_KEYにシークレットキーを送信。アカウントページでキーを作成・管理。
パラメータ タイプ 必須 説明
image_file file 必須* 処理対象画像、マルチパートアップロード。JPG / PNG / WebP、最大20MB
image_url string 必須* または公開画像URL(image_file / image_urlのいずれかを指定)
size string 任意 preview(無料、透かし付き)/ full(HD、1クレジット)/ auto。デフォルトpreview
format string 任意 auto(透過ありならPNG、それ以外JPG——デフォルト)/ png / jpg
bg_color string 任意 結果背景:transparent(デフォルト)/ white / 任意の #RRGGBB
* image_file または image_url の少なくとも一方を指定してください。
2

コードサンプル

言語を選んでコピー — そのまま実行可能。
1curl -X POST "https://api.pixmiller.com/v1/remove" \2  -H "X-Api-Key: YOUR_API_KEY" \3  -F "[email protected]" \4  -F "size=full"
3

レスポンス

201 Created · JSON
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ヘッダー後にリトライしてください。
5

Migrating from remove.bg

Change the base URL — your existing request keeps working.
remove.bg stops accepting self-serve API requests on 2026-12-01. PixMiller mirrors its main path at POST /v1.0/removebg — same X-Api-Key header, same parameter names, HTTP 200 with the image bytes in the body. A matching GET /v1.0/account returns your credit balance.
Before · remove.bg
1curl -H "X-Api-Key: REMOVEBG_KEY" \2  -F "[email protected]" \3  -F "size=auto" \4  -o out.png \5  https://api.remove.bg/v1.0/removebg
After · PixMiller
1curl -H "X-Api-Key: PIXMILLER_KEY" \2  -F "[email protected]" \3  -F "size=auto" \4  -o out.png \5  https://api.pixmiller.com/v1.0/removebg
size mapping
remove.bg value PixMiller tier 説明
preview / small / regular preview Watermarked preview, up to 640 px. Free — no credit charged. This is the default, as on remove.bg.
medium / hd / 4k / full / 50MP full Full-resolution, watermark-free result, downscaled to the tier's megapixel cap (1.5 / 4 / 25 / 25 / 50 MP; PNG output is capped at 10 MP). 1 credit per image.
auto auto Full resolution when credits are available, free watermarked preview otherwise.
Response headers
X-Credits-Charged Credits actually deducted by this call (0 for the free preview tier).
X-Width / X-Height Pixel dimensions of the returned image.
X-Type Detected foreground class: person, product, animal, car or other (omitted with type_level=none).
X-Foreground-Top / -Left / -Width / -Height Bounding box of the subject in the returned image.
X-RateLimit-Limit / -Remaining / -Reset Rate limit state for your key, counted per image — one call uses one unit; Retry-After is added on 429.
Parameters without effect

Every remove.bg parameter is accepted and validated — size, type, type_level, format, roi, crop, crop_margin, scale, position, channels, bg_color, bg_image_url and bg_image_file behave as documented by remove.bg. These are accepted but never change the output, as on remove.bg for non-car subjects: shadow_type, shadow_opacity, add_shadow, semitransparency

Known differences
  • size=preview (and its aliases small / regular — the default, as on remove.bg) returns our free, watermarked preview at up to 640 px and costs no credit; remove.bg returns a 0.25-megapixel image without watermark for 0.25 credits.
  • medium, hd, 4k, full and 50MP all cost 1 credit, as on remove.bg. There is no free monthly preview quota, so /v1.0/account always reports free_calls = 0.
  • X-Type is a coarse class (person / product / animal / car / other) derived from the segmentation model that was used; type_level = 2 and latest return the same coarse classes.
  • Shadows (shadow_type / shadow_opacity / add_shadow) and car-window semitransparency are accepted but never rendered — as on remove.bg for non-car subjects.
  • Input files are limited to 20 MB (remove.bg: 22 MB).

Errors on this endpoint use the remove.bg JSON:API envelope {"errors":[{"title":"…","code":"…"}]} with 400 invalid_parameter / 402 insufficient_credits / 403 auth_failed / 429 rate_limit_exceeded.

This is a compatibility layer for the main HTTP path, not a certified drop-in for the official SDKs or CLI.

なぜ背景透過・削除 APIで構築するのか

PNG/JPG 出力
~5s 画像あたり
40/min バッチ処理能力
3d 自動削除
髪の毛レベルのエッジ 毛皮、毛、半透明のエッジはクリーンなアルファチャンネルで自動処理されます — ハローなし、ハードカットなし。
5秒以内のレスポンス 単一の画像は通常5秒以内に結果URLを同期的に返します。
バッチ処理向け設計 大量処理向けの安定したスループット。並行処理とリトライを組み合わせてパイプラインに組み込み。
数分で統合 コピペ可能なサンプル付きシンプルREST。新規アカウントにはテスト用無料HDクレジット付き。

開発者が背景透過・削除 APIを使う場面

EC一括出品

出品者がアップロードした商品写真を、マーケットプレイス準拠の白または透明なメイン画像に変換。手動編集不要。

アプリ内背景除去

ワンクリック背景除去をデザイン、ギャラリー、サイトビルダー製品に組み込み — APIを呼ぶだけで結果を取得。

自動化ワークフロー

ERP / DAM / スクリプトに接続し、取り込み時に新しい画像を自動的に切り抜き・整理。

1 APIキーを作成 APIキーページでキーを作成。新規アカウントにはテスト用無料HDクレジット付き。
2 リクエストを送信 上のサンプルをコピーし、キーと画像を入れ替えて、最初のリクエストを実行。
3 本番環境へ 並行数とリトライを調整してデプロイ — 画像ごとに課金、大量割引あり。

開発者FAQ

対応画像形式は?

JPG / PNG / WebP / BMP 最大20MB、50メガピクセル未満(最長辺32–10000px)。出力はソース解像度の透明PNG、最大4096×4096。

請求の仕組みは?

処理成功した画像ごとに — full サイズ = 1クレジット; プレビューサイズ(透かし付き)はテスト無料。新規アカウントには無料HDクレジット付き。

sizeパラメータの役割は?

preview と auto は透かし付きプレビューを返却;full は Full HD 結果を返し、1クレジット使用。

レート制限は?

デフォルトでキーごと1分あたり最大40枚。増やすにはお問い合わせください。

他のツールのAPI

インタラクティブリファレンス

完全なOpenAPIスキーマ — 以下のアカウントに対してリクエストをテスト。

PixMiller APIで構築 APIキーを取得