機能 · バッチ ゴーストマネキン
バッチ ゴーストマネキン API カタログ全体向け
要約
Phottaのバッチ ゴーストマネキンエンドポイントは、衣服写真の配列を受け取り、バッチIDと画像ごとのアイテムIDを返します。バッチ全体のcreditsが事前に予約され、バッチをポーリングして集約ステータスを取得します。
- 所要時間の目安: 1.5–4 min per image
- Credits: 2Kで4 credits · 4Kで5 credits
- 処理方式: 非同期、ポーリング
- 制限: 600 リクエスト/分
- 認証: Bearerキー
このページに記載されている数値はすべて以下に基づきます: Photta APIドキュメント · 確認済み
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/ghost-mannequin/batch \
-H "Authorization: Bearer $PHOTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_images": [
{
"image": "https://cdn.yourstore.com/products/jacket-front.jpg",
"back_image": "https://cdn.yourstore.com/products/jacket-back.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/shirt-front.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/trousers-front.jpg",
"image_side": "front"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"user_instruction": "closed front, buttoned up",
"brand_label_id": "7cc9f988-068b-44cd-8004-22f486b10e67"
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')const res = await fetch("https://api.photta.app/api/v1/ghost-mannequin/batch", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"product_images": [
{
"image": "https://cdn.yourstore.com/products/jacket-front.jpg",
"back_image": "https://cdn.yourstore.com/products/jacket-back.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/shirt-front.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/trousers-front.jpg",
"image_side": "front"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"user_instruction": "closed front, buttoned up",
"brand_label_id": "7cc9f988-068b-44cd-8004-22f486b10e67"
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/ghost-mannequin/batch",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"product_images": [
{
"image": "https://cdn.yourstore.com/products/jacket-front.jpg",
"back_image": "https://cdn.yourstore.com/products/jacket-back.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/shirt-front.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/trousers-front.jpg",
"image_side": "front"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"user_instruction": "closed front, buttoned up",
"brand_label_id": "7cc9f988-068b-44cd-8004-22f486b10e67"
},
)
data = res.json()["data"] # data["id"], data["status"]
概要
概要
- エンドポイント
- POST /api/v1/ghost-mannequin/batch
- 認証
- Bearer APIキー
- 処理方式
- 非同期 — ステータスエンドポイントをポーリング
- 所要時間の目安
- 1.5–4 min per image
- Credits
- 2Kで4 credits · 4Kで5 credits
- アスペクト比
- 3:4 · 1:1 · 4:3 · 9:16 · 16:9
- 入力制限
- 1画像あたり最大10 MB、JPEG, PNG, WebP
- 冪等性
- なし
リクエストとレスポンス
リクエスト
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/ghost-mannequin/batch \
-H "Authorization: Bearer $PHOTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_images": [
{
"image": "https://cdn.yourstore.com/products/jacket-front.jpg",
"back_image": "https://cdn.yourstore.com/products/jacket-back.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/shirt-front.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/trousers-front.jpg",
"image_side": "front"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"user_instruction": "closed front, buttoned up",
"brand_label_id": "7cc9f988-068b-44cd-8004-22f486b10e67"
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')const res = await fetch("https://api.photta.app/api/v1/ghost-mannequin/batch", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"product_images": [
{
"image": "https://cdn.yourstore.com/products/jacket-front.jpg",
"back_image": "https://cdn.yourstore.com/products/jacket-back.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/shirt-front.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/trousers-front.jpg",
"image_side": "front"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"user_instruction": "closed front, buttoned up",
"brand_label_id": "7cc9f988-068b-44cd-8004-22f486b10e67"
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/ghost-mannequin/batch",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"product_images": [
{
"image": "https://cdn.yourstore.com/products/jacket-front.jpg",
"back_image": "https://cdn.yourstore.com/products/jacket-back.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/shirt-front.jpg",
"image_side": "front"
},
{
"image": "https://cdn.yourstore.com/products/trousers-front.jpg",
"image_side": "front"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"user_instruction": "closed front, buttoned up",
"brand_label_id": "7cc9f988-068b-44cd-8004-22f486b10e67"
},
)
data = res.json()["data"] # data["id"], data["status"]202 Accepted / Completed
{
"data": {
"batch_id": "gmb_x7y8z9",
"status": "processing",
"total": 3,
"completed": 0,
"failed": 0,
"items": [
{
"id": "gm_p1q2r3",
"status": "processing"
},
{
"id": "gm_s4t5u6",
"status": "processing"
},
{
"id": "gm_v7w8x9",
"status": "processing"
}
],
"style": "3d",
"background_color": "white",
"resolution": "2K",
"aspect_ratio": "3:4",
"credits_reserved": 12,
"created_at": "2026-04-10T16:05:00Z"
},
"request_id": "req_gmb001"
}{
"data": {
"batch_id": "gmb_x7y8z9",
"status": "completed",
"total": 3,
"completed": 3,
"failed": 0,
"processing": 0,
"credits_reserved": 12,
"credits_used": 12,
"credits_refunded": 0,
"items": [
{
"id": "gm_p1q2r3",
"status": "completed",
"output_url": "https://cdn.photta.app/generated/gm_p1q2r3.jpg",
"thumbnail_url": "https://cdn.photta.app/generated/gm_p1q2r3-thumb.jpg",
"credits_used": 4,
"completed_at": "2026-04-10T16:06:42Z",
"duration_ms": 102000
},
{
"id": "gm_s4t5u6",
"status": "completed",
"output_url": "https://cdn.photta.app/generated/gm_s4t5u6.jpg",
"thumbnail_url": "https://cdn.photta.app/generated/gm_s4t5u6-thumb.jpg",
"credits_used": 4,
"completed_at": "2026-04-10T16:08:18Z",
"duration_ms": 96000
},
{
"id": "gm_v7w8x9",
"status": "completed",
"output_url": "https://cdn.photta.app/generated/gm_v7w8x9.jpg",
"thumbnail_url": "https://cdn.photta.app/generated/gm_v7w8x9-thumb.jpg",
"credits_used": 4,
"completed_at": "2026-04-10T16:09:50Z",
"duration_ms": 92000
}
],
"created_at": "2026-04-10T16:05:00Z",
"completed_at": "2026-04-10T16:09:50Z"
},
"request_id": "req_gmbs002"
}リクエストパラメータ
product_images型: array[object]必須
Array of image objects. Each object contains "image" (URL or base64), optional "back_image", and optional "image_side". API batch caps (5× the dashboard limit): Free/Hobby/Hobby v2 5, Seller/Starter 10, Brand/Pro 25, Studio/Premium 50.
angle型: string
Applied to all images. "side" reconstructs the side view from each front photo (plus back_image when provided) — see the single-generate endpoint for details.
= straight
値:straightbacksidestyle型: string
Applied to all images.
= 3d
値:3dflat_laybackground_color型: string
Applied to all images.
= white
値:whitegraybeigeblackresolution型: string
Applied to all images. "2K" = 4 credits each. "4K" = 5 credits each. 4K is produced natively in a single generation per item — pick it upfront; the resolution cannot be changed after creation. Note: 4K cannot be combined with aspect_ratio 1:1 — that combination returns 400.
= 2K
値:2K4Kaspect_ratio型: string
Applied to all images. Note: 1:1 is not available at 4K resolution — 1:1 combined with 4K returns 400.
= 3:4
値:3:41:14:39:1616:9user_instruction型: string
Batch-level: one note applied to every item. Optional free-form string, max 400 characters (anything longer is silently truncated). A guarded steer for ambiguous rendering choices — e.g. "closed front", "cream interior lining", "buttoned up" — it never overrides the source garment, brand label, or structural reconstruction, and it is explicitly NOT a determinism/seed control.
brand_label_id型: string
Applied to all images. Brand label UUID returned by the Brand Labels API. API v1 request fields use snake_case; use brand_label_id.
エラー
- 400
invalid_request_error - The request is malformed or contains invalid parameters.
- 401
authentication_error - The API key is missing, invalid, or expired.
- 402
insufficient_credits_error - Your account does not have enough credits.
- 404
not_found_error - The requested resource does not exist.
- 409
conflict_error - The request conflicts with current state — e.g. your concurrent-batch cap is reached.
- 429
rate_limit_error - Too many requests. Slow down and retry.Retry-After: 30
- 500
api_error - An internal server error occurred. Retry later.
制限
- APIキーごとに毎分600リクエスト (固定ウィンドウ方式。制限値はすべてのプランで共通です)
- 429にはRetry-After: 30 secondsが含まれます
- 1画像あたり最大10 MB
- フォーマット: JPEG, PNG, WebP
- プランごとの同時実行バッチ数: Free 1 · Hobby 2 · Seller 3 · Brand 4 · Studio 6
- ポーリングのみ — APIはWebhookを送信しません。
1回のリクエストで、ラック一面の衣服を処理
配列を組み立て、1回送信し、バッチをポーリングして、各アイテムをダウンロード。
ステップ 1
APIキーを生成
バッチ ゴーストマネキンは、他のすべてのPhotta機能と同じ認証情報と同じクレジット残高を使用します。
ステップ 2
画像配列を組み立てる
`product_images` は衣服ごとに1つのオブジェクトを受け取ります: `image`、およびオプションの `back_image` と `image_side`。APIのバッチ上限は、FreeおよびHobbyで5画像、Sellerで10画像、Brandで25画像、Studioで50画像です。
ステップ 3
バッチをPOST送信
POST `/api/v1/ghost-mannequin/batch` を実行します。`angle`、`style`、`background_color`、`resolution`、`aspect_ratio` はすべてのアイテムに適用され、`user_instruction` は最大400文字の指示を全体に追加します。最初のアイテムがレンダリングされる前に、バッチ全体のcreditsが予約されます。
ステップ 4
バッチをポーリング
3秒ごとに GET `/api/v1/ghost-mannequin/batch/:id` を実行します。レスポンスボディには `total`、`completed`、`failed`、およびアイテムごとの内訳が含まれるため、最後の衣服の処理が完了する前にダウンロードを開始できます。
ステップ 5
各結果をダウンロード
完了した各アイテムには、固有の `output_url`、`credits_used`、処理時間が含まれます。失敗したアイテムは予約されたcreditsが返金され、`credits_refunded` に記録されます。
Node.js、Python、cURLでの同一エンドポイントの実装
Node.js
Node.jsでのバッチ ゴーストマネキン API
ネイティブのfetchを使用してNode.jsバックエンドからPhottaのバッチ ゴーストマネキン APIを呼び出します。SDKは不要です。キーを保存し、ジョブを送信して、結果をポーリングするだけです。
読むPython
Python での バッチ ゴーストマネキン API
requests ライブラリを使用して Python で Photta の バッチ ゴーストマネキン API を呼び出します。30行のラッパーで、httpx による非同期対応も可能であり、Django、FastAPI、Celery で動作します。
読むcURL
cURLによるバッチ ゴーストマネキン API
cURLを使用してシェルから直接Phottaのバッチ ゴーストマネキン APIを呼び出します。送信、ポーリング、ダウンロード — すべてのスニペットはスクリプトパイプライン向けにjqと連携可能です。
読む
開発者がバッチを実行する前によく尋ねる質問
バッチエンドポイントは何を提供しますか?
1回のリクエストで衣服写真の配列を受け入れ、バックグラウンドで処理します。何十もの個別ジョブを追跡する代わりに、全体像を把握するためのバッチIDと、写真ごとのアイテムIDを取得できます。
1つのバッチに何枚の画像を入れられますか?
APIのバッチ上限は、FreeおよびHobbyで5画像、Sellerで10画像、Brandで25画像、Studioで50画像です — ダッシュボードの上限の5倍です。プランの許可を超えるバッチは400を返します。
バッチのcreditsはどのように請求されますか?
バッチ全体分が事前に予約されます: 画像数に画像ごとの単価(2Kで4 credits、4Kで5 credits)を掛けた額です。残高が予約額に満たない場合、リクエストは402を返し、レンダリングは一切行われません。
1つのアイテムが失敗した場合はどうなりますか?
バッチの残りの処理は継続されます。バッチのレスポンスボディには `completed` と並んで `failed` が報告され、失敗したアイテムの予約済みcreditsは `credits_refunded` として返金されます。
同時にいくつのバッチを実行できますか?
処理中の同時実行バッチ数はプランごとに制限されています: Freeは1、Hobbyは2、Sellerは3、Brandは4、Studioは6です。上限を超えて送信すると409が返されます — 実行中のバッチが完了するまでポーリングし、その後に再送信してください。
バッチはどのようにポーリングしますか?
集約ステータスを取得するには3秒ごとに GET `/api/v1/ghost-mannequin/batch/:id` を実行し、衣服ごとの詳細が必要な場合は標準のゴーストマネキンステータスパスで個別のアイテムをポーリングします。
関連機能
機能一覧
ゴーストマネキン API ゴーストマネキン商品写真向け
AIゴーストマネキンエンドポイント。衣服写真からマネキンを除去し、内部のディテールを保持します。3Dまたは平置き、バッチ処理、2K で 4 credits。
エンドポイントを見る機能一覧
バーチャルtry-on API アパレル向け
AIマネキンにアパレルを着せるREST API。非同期処理、生成時間は1.5〜4分、2Kで5クレジット、4Kで6クレジット。cURL、Node.js、Pythonのサンプルコードあり。
エンドポイントを見る実装
カタログのゴーストマネキン抽出を自動化する
夜間カタログ自動化のレシピ: 前日の製品更新を取得し、PhottaのゴーストマネキンAPIへバッチ送信、親バッチをポーリングして、データベースに永続化します。
エンドポイントを見る比較
Photta vs Pixazo — ファーストパーティパイプラインか、モデルアグリゲーターか
Photta vs Pixazoの比較:ファーストパーティ製ファッションパイプラインとマルチモデルアグリゲーター。エンドポイント、レイテンシ、無料枠、トレードオフ。2026-04-19取得。
エンドポイントを見るクイックスタート
5 分以内に最初の Photta 画像を生成。
サインアップ、API キーの生成、最初の cURL 呼び出しの実行、完了までのポーリング、結果の保存。エンドツーエンドで文書化された 5 つのステップ。
エンドポイントを見るリファレンス
Photta APIのエラー
ステータスコード別のPhotta APIエラータイプ一覧、エラーボディの構造、およびリトライすべき障害。
エンドポイントを見るリファレンス
Photta APIのレートリミット
Photta APIのレートリミット、ウィンドウ幅、Retry-Afterヘッダー、ポーリング間隔、プラン別の同時実行上限など、APIドキュメントに記載された仕様です。
エンドポイントを見る
このページに記載されている数値はすべて以下に基づきます: Photta APIドキュメント · 確認済み
5分でAPIを試す
Photta APIキーを生成し、上記のcURLスニペットを貼り付ければ、コーヒーが淹れ終わる前に最初のモデル着用画像が手に入ります。
- 1.5–4 min per image
- 2Kで4 credits · 4Kで5 credits
- 非同期、ポーリング
- 600 リクエスト/分
- Bearerキー