機能 · アパレル
バーチャルtry-on API アパレル向け
要約
Phottaのバーチャルtry-on APIは、平置きのアパレル画像とマネキンIDを受け取り、2Kまたは4Kのモデル着用写真を返します。ジョブをPOSTし、3〜5秒ごとにポーリングし、ステータスがcompletedになったらダウンロードします。
- 所要時間の目安: 1–1.5 min
- Credits: 2Kで5 credits · 4Kで6 credits
- 処理方式: 非同期、ポーリング
- 制限: 600 リクエスト/分
- 認証: Bearerキー
このページに記載されている数値はすべて以下に基づきます: Photta APIドキュメント · 確認済み
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/tryon/apparel \
-H "Authorization: Bearer $PHOTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')const res = await fetch("https://api.photta.app/api/v1/tryon/apparel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/tryon/apparel",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
},
)
data = res.json()["data"] # data["id"], data["status"]
概要
概要
- エンドポイント
- POST /api/v1/tryon/apparel
- 認証
- Bearer APIキー
- 処理方式
- 非同期 — ステータスエンドポイントをポーリング
- 所要時間の目安
- 1–1.5 min
- Credits
- 2Kで5 credits · 4Kで6 credits
- アスペクト比
- 3:4 · 1:1 · 4:3 · 2:3 · 3:2 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9
- 入力制限
- 1画像あたり最大10 MB、JPEG, PNG, WebP
- 冪等性
- あり
リクエストとレスポンス
リクエスト
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/tryon/apparel \
-H "Authorization: Bearer $PHOTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')const res = await fetch("https://api.photta.app/api/v1/tryon/apparel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/tryon/apparel",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
},
)
data = res.json()["data"] # data["id"], data["status"]202 Accepted / Completed
{
"data": {
"id": "try_abc123",
"status": "processing",
"product_type": "top",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"lock_background": false,
"resolution": "2K",
"aspect_ratio": "3:4",
"credits_used": 5,
"created_at": "2026-04-10T12:00:00Z"
},
"request_id": "req_xyz789"
}{
"data": {
"id": "try_abc123",
"status": "completed",
"product_type": "top",
"mannequin_id": "mnk_f3a9b1",
"resolution": "2K",
"aspect_ratio": "3:4",
"output_url": "https://cdn.photta.app/generated/try_abc123.jpg",
"thumbnail_url": "https://cdn.photta.app/generated/try_abc123-thumb.jpg",
"credits_used": 5,
"created_at": "2026-04-10T12:00:00Z",
"completed_at": "2026-04-10T12:01:15Z",
"duration_ms": 75000
},
"request_id": "req_abc001"
}リクエストパラメータ
product_type型: string必須
Type of garment.
値:topbottomtop_and_bottomone_pieceproduct_images型: array[string]必須
Array of image URLs or base64 data URIs. The first entry is the FRONT image and is required. Not used when product_type is "top_and_bottom".
product_back_image型: string
Optional URL or base64 data URI for the BACK of the garment. Sending one IS the request for a back shot: the model is photographed from behind and this image is the reference. Omit it and you get the front. There is deliberately no separate "view" field — two fields that can contradict each other. Not used when product_type is "top_and_bottom".
top_image型: string
Front image of the top garment. Required when product_type is "top_and_bottom".
top_back_image型: string
Optional back image of the top garment. Sending one asks for a back shot, exactly as product_back_image does.
bottom_image型: string
Front image of the bottom garment. Required when product_type is "top_and_bottom".
bottom_back_image型: string
Optional back image of the bottom garment. Sending one asks for a back shot, exactly as product_back_image does.
mannequin_id型: string必須
ID of the mannequin to wear the garment, from GET /api/v1/mannequins: one of Photta's, or one of your workspace's own while it is active. Another account's model, or one that was removed, is a 404; a jewellery or eyewear model is a 400.
background_color型: string
The backdrop, as a colour. One of white, light_gray, gray, charcoal, black, beige, cream, sand — or any hex value (#F5F0E8, F5F0E8, #fff). It travels to the engine as TEXT; nothing is uploaded, and the same value reproduces exactly on every run. Omit it for the engine's clean studio default. An unrecognised value returns 400 rather than quietly falling back. Echoed back on the response.
値:whitelight_graygraycharcoalblackbeigecreamsandpose_id型: string
RETIRED 2026-08-10 — accepted and ignored. Poses were removed from apparel try-on; every generation is now a straight, relaxed, camera-facing shot (full length; a `top` is framed three-quarter). Sending it returns Deprecation and Sunset headers. Deleted 2027-02-10 — stop sending it.
background型: string
RETIRED 2026-08-11 — accepted and ignored, never downloaded. Backdrop photographs were removed: recreating a room competed with the garment for the engine's attention. Use background_color instead. Sending it returns Deprecation and Sunset headers. Deleted 2027-02-10.
lock_background型: boolean
RETIRED 2026-08-11 — accepted and ignored, and always false on responses. It never worked as previously documented: the prompt engine has always discarded the flag, so the "faithful reproduction" this page used to promise was never delivered. background_color is the first backdrop control that actually holds still. Deleted 2027-02-10.
= false
resolution型: string
Output resolution.
= 2K
値:2K4Kaspect_ratio型: string
Output aspect ratio.
= 3:4
値:3:41:14:32:33:24:55:49:1616:921:9body_size型: string
Build of the model. The letter sizes map onto builds: XS → petite, S → slim, M → regular, L → curvy, XL and XXL → plus size. The build names (`petite`, `slim`, `regular`, `athletic`, `curvy`, `plus_size`) are accepted too. An unknown value adds no build to the prompt. A child model is always drawn with a child's build, whatever is sent.
= M
値:XSSMLXLXXLpetiteslimregularathleticcurvyplus_sizeexpression型: string
Facial expression. `happy` and `smiling` are both a soft smile. An unknown value adds no expression to the prompt.
= neutral
値:neutralsoft_smileconfidentseriousrelaxedhappysmilingfootwear_url型: string
URL or base64 of a custom footwear image. It is worn when the feet are in frame (full-length shots; a `top` is framed three-quarter).
user_instruction型: string
Free-form refinement, e.g. "preserve the seam pattern across the shoulder", "keep the collar contrast strong". Capped at 500 characters server-side; longer strings are silently truncated. Useful for brand-specific details that need an extra nudge.
product_category型: string
The kind of garment, as a category key (e.g. "tshirt", "jeans", "blazer", "mididress"; lower-case, no separators). It names the garment in the prompt's length sentence; an unknown key reads as "garment". Used for product_type "top", "bottom", and "one_piece". REQUIRED when `mannequin_id` is a child model: without it the request is a 400 (`param: "product_category"`), and swimwear or underwear on a child model is a 400 `content_policy_violation`, both before anything is charged.
top_category型: string
Silhouette anchor for the top half. Only valid when product_type is "top_and_bottom".
bottom_category型: string
Silhouette anchor for the bottom half. Only valid when product_type is "top_and_bottom".
length型: string
Garment length key for product_type "top", "bottom", or "one_piece". List available values with GET /api/v1/garment-attributes?type=length&garment_type={product_type}.
fit型: string
Garment fit key for product_type "top", "bottom", or "one_piece". List available values with GET /api/v1/garment-attributes?type=fit&garment_type={product_type}.
top_length型: string
Top length key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=length&garment_type=top.
top_fit型: string
Top fit key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=fit&garment_type=top.
bottom_length型: string
Bottom length key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=length&garment_type=bottom.
bottom_fit型: string
Bottom fit key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=fit&garment_type=bottom.
エラー
- 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, or (background removal) a free account has used its three cut-outs. Branch on the code.
- 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 (500), or a check your request needs could not run right now (503, e.g. moderation_unavailable or background_removal_unavailable). Retry later with backoff.
制限
- アカウントごとに毎分600リクエスト (固定ウィンドウ方式。制限値はすべてのプランで共通です)
- 429にはRetry-After: 30 secondsが含まれます
- 1画像あたり最大10 MB
- フォーマット: JPEG, PNG, WebP
- プランごとの同時実行バッチ数: Free 1 · Hobby 2 · Seller 3 · Brand 4 · Studio 6
- ポーリングのみ — APIはWebhookを送信しません。
5つのステップ、1枚の商品写真
マネキンを選択し、ジョブを送信、完了までポーリングして、結果をダウンロードします。
ステップ 1
APIキーの生成
ai.photta.app でサインアップし、Developers タブを開いて Generate API key をクリックします。本番キーは `photta_live_` で始まります。キーは `PHOTTA_API_KEY` に設定し、決してコミットしないでください。
ステップ 2
マネキンの選択
利用可能なモデルの一覧を取得して希望するIDを取得するには GET `/api/v1/mannequins` を実行します。ポーズは2026-08-10に廃止されました。すべてのショットは正面を向いた直立の全身となるため、他に選択するものはありません。
ステップ 3
try-on ジョブの POST 送信
`/api/v1/tryon/apparel` に `product_type`、`product_images`、`mannequin_id`、および任意の `resolution` と `aspect_ratio` を含めて POST リクエストを送信します。API は生成IDとともに 202 Accepted を返します。
ステップ 4
ジョブが完了するまでポーリング
3秒ごとに GET `/api/v1/tryon/apparel/:id` を実行します。`data.status` が `completed` に切り替わると、ペイロードに `output_url` と `thumbnail_url` が含まれます。ジョブのハングによってリクエストが停止しないよう、上限回数を設けてください。
ステップ 5
ダウンロードと永続化
`output_url` からバイトデータを取得し、自前のオブジェクトストレージに保存します。CDN の URL は安定していますが、プロダクトのレンダリングをこれに直接依存させるべきではありません。
Node.js、Python、cURL で同一のエンドポイントを使用
Node.js
Node.jsでのバーチャルtry-on API
ネイティブのfetchを使用してNode.jsバックエンドからPhottaのバーチャルtry-on APIを呼び出します。SDKは不要です。キーを保存し、ジョブを送信して、結果をポーリングするだけです。
読むPython
Python での バーチャルtry-on API
requests ライブラリを使用して Python で Photta の バーチャルtry-on API を呼び出します。30行のラッパーで、httpx による非同期対応も可能であり、Django、FastAPI、Celery で動作します。
読むcURL
cURLによるバーチャルtry-on API
cURLを使用してシェルから直接Phottaのバーチャルtry-on APIを呼び出します。送信、ポーリング、ダウンロード — すべてのスニペットはスクリプトパイプライン向けにjqと連携可能です。
読む
アパレル try-on のリリース前に開発者からよくある質問
Photta のバーチャル try-on API とは?
商品の平置き写真とマネキンIDを受け取り、モデルが着用した写実的な画像を返す REST エンドポイントです。Photta のコンシューマー向けアプリと同じパイプラインを採用しています。top、bottom、top+bottom、one-piece の4つの商品タイプに対応しています。
1回のリクエストあたりのコストは?
2K の結果は 5 credits、4K は 6 credits です。credits はサブスクリプションに含まれており、追加購入も可能です。生成に失敗した場合は credits は消費されず、返金されます。
生成にはどのくらい時間がかかりますか?
エンドツーエンドの計測で、通常完了まで 1.5 〜 4分です。POST リクエストは1秒未満で生成IDを返し、GPU による処理はポーリング中にバックグラウンドで実行されます。
サポートされている商品タイプは?
`top`、`bottom`、`top_and_bottom`、`one_piece` の4種類です。それぞれ想定される `product_images` の形式が異なります。たとえば `top_and_bottom` では `top_image` と `bottom_image` の両方の URL が必要です。
独自のマネキンを使用できますか?
はい。`POST /api/v1/mannequins` でマネキン写真をアップロードするか、`POST /api/v1/mannequins/generate` で新しい AI マネキンを生成できます。返されたIDは、そのまま try-on リクエストに指定できます。
結果のポーリングはどのように行いますか?
`data.status` が `completed` または `failed` になるまで、3〜5秒ごとに GET `/api/v1/tryon/apparel/:id` を実行します。試行回数には上限を設定してください — 120回 × 3秒 に設定すれば、ドキュメントに記載された処理時間を十分にカバーできます。
関連機能
機能一覧
ジュエリー try-on API ネックレス、リング、ブレスレット、イヤリングに対応
REST 経由でネックレス、指輪、ブレスレット、イヤリングを AI モデルに配置。2K で 5 credits、クローズアップマネキンを内蔵、Photta のドキュメントに基づく反射を考慮したレンダリング。
エンドポイントを見る機能一覧
ゴーストマネキン API ゴーストマネキン商品写真向け
AIゴーストマネキンエンドポイント。衣服写真からマネキンを除去し、内部のディテールを保持します。3Dまたは平置き、バッチ処理、2K で 4 credits。
エンドポイントを見る実装
アプリ向けのバーチャル try-on 機能を構築する
Photta API を使ったバーチャル try-on 機能リリースのためのエンドツーエンド実装レシピ:アップロード、ジョブ送信、ワーカーからのポーリング、結果のレンダリング。TypeScript + サーバー専用パターン。
エンドポイントを見る実装
iOSまたはAndroidアプリにバーチャルtry-onを追加する
Photta APIを使用してネイティブのiOSまたはAndroidアプリにAIバーチャルtry-onを追加する方法:キーをデバイスに絶対に含めず、バックエンド経由でプロキシし、ジョブステータスをミラーリングします。
エンドポイントを見る比較
Photta vs FASHN — ファッションAI APIの徹底比較
PhottaとFASHNの比較:エンドポイント、クレジット料金、プラン階層、同時実行数上限。2026-04-19時点の各社公式価格設定ページから取得。加工された数値はありません。
エンドポイントを見る比較
Photta vs Fitroom — ファッションAPIを用途に合わせて選定
PhottaとFitroomのエンドポイント、呼び出しごとのcreditsコスト、料金体系、統合性を比較。各サイトから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–1.5 min
- 2Kで5 credits · 4Kで6 credits
- 非同期、ポーリング
- 600 リクエスト/分
- Bearerキー