{"items":[{"type":"link","label":"AI 模糊背景","link":"/zh-tw/reference/ai_photo_background_blur","routeSlug":"/zh-tw/reference/ai_photo_background_blur","content":{"contentType":"overview","meta":{"name":"AI 模糊背景"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"ai_photo_background_blur.json","url":"/_bundle/@l10n/zh-TW/reference/ai_photo_background_blur.json?download"},{"kind":"download","label":"ai_photo_background_blur.yaml","url":"/_bundle/@l10n/zh-TW/reference/ai_photo_background_blur.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[{"kind":"email","title":"E-mail","titleTranslationKey":"info.contact.name","email":"YouCamOnlineEditor_API@perfectcorp.com","label":"YouCamOnlineEditor_API@perfectcorp.com","withCopyButton":true,"copyContent":"YouCamOnlineEditor_API@perfectcorp.com"},{"kind":"externallink","title":"License","titleTranslationKey":"info.license","label":"Privacy policy","url":"https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"},{"kind":"externallink","label":"Terms of Service","labelTranslationKey":"info.termsOfService","url":"https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api"}]},{"title":"Languages","titleTranslationKey":"languages.title","children":[{"kind":"languages","options":[{"key":"curl","title":"curl","lang":"curl"},{"key":"javascript","title":"JavaScript","lang":"JavaScript"},{"key":"node","title":"Node.js","lang":"Node.js"},{"key":"python","title":"Python","lang":"Python"},{"key":"java","title":"Java","lang":"Java"},{"key":"csharp","title":"C#","lang":"C#"},{"key":"php","title":"PHP","lang":"PHP"},{"key":"go","title":"Go","lang":"Go"},{"key":"ruby","title":"Ruby","lang":"Ruby"},{"key":"r","title":"R","lang":"R"},{"key":"payload","title":"Payload","lang":"Payload"}]}]},{"title":"Servers","titleTranslationKey":"servers.title","children":[{"kind":"servers","servers":[{"url":"https://yce-api-01.makeupar.com"}],"mode":"default"}]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","level":1,"label":"AI 模糊背景","showPageActions":true},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[]}],"sectionId":"/"}],"sectionId":"/"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":1,"id":"section/概述"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"概述"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"淺景深（bokeh）效果是一種受歡迎的攝影技術，用於模糊照片背景並讓主體對焦。它為照片增添藝術氣息，使其看起來更專業且吸睛。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"用 AI 模糊背景 API 創造專業外觀的照片，它自動隔離主體並套用自然的背景模糊，將注意力引導到最重要的地方。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用情境範例："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"人像增強"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"套用自然的淺景深效果，讓主體突出，並提升個人頭像或人像照片的視覺品質。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"之前："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://yce.makeupar.com/assets/images/sod/banner/blur/yce-topbanner-dt-before.jpg"},"children":[],"type":"image"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"之後："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://yce.makeupar.com/assets/images/sod/banner/blur/yce-topbanner-dt-after.jpg"},"children":[],"type":"image"}],"type":"paragraph"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"專業形象照"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"從一般照片創造類攝影棚的背景模糊效果，用於商務個人檔案與企業目錄。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"之前："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_blur_bg_s3_poster_1_50a314e3f9.jpg"},"children":[],"type":"image"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"之後："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_blur_bg_s3_poster_2_afb0548cb7.jpg"},"children":[],"type":"image"}],"type":"paragraph"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/整合指南"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"整合指南"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輸入需求與處理標準："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳包含清晰、顯著前景主體的圖片。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"圖片最長邊不得超過 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"4,096 px"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源檔案大小必須低於 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"10 MB"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"至少需要一位清晰可見的前景主體。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"僅支援單主體分析。若出現多人，API 會自動選擇可見面積最大的主體。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"工作流程："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"呼叫 File API。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"從回應中取得簽名的上傳網址。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"將實際圖片上傳到回傳的網址。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"建立 AI 任務。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"設定 Webhook 或輪詢任務狀態直到完成。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"處理成功後下載生成的結果圖片。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 1 — 使用 File API 上傳檔案 metadata"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /s2s/v2.0/file"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 建立檔案記錄，並取得來源圖片的上傳細節。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/file \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"files\": [\n      {\n        \"content_type\": \"image/jpg\",\n        \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n        \"file_size\": 547541\n      }\n    ]\n  }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/file \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"files\": [\n      {\n        \"content_type\": \"image/jpg\",\n        \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n        \"file_size\": 547541\n      }\n    ]\n  }'\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"File API 回應範例："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 200,\n  \"data\": {\n    \"files\": [\n      {\n        \"content_type\": \"image/jpg\",\n        \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n        \"file_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\",\n        \"requests\": [\n          {\n            \"method\": \"PUT\",\n            \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\",\n            \"headers\": {\n              \"Content-Length\": \"547541\",\n              \"Content-Type\": \"image/jpg\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 200,\n  \"data\": {\n    \"files\": [\n      {\n        \"content_type\": \"image/jpg\",\n        \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n        \"file_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\",\n        \"requests\": [\n          {\n            \"method\": \"PUT\",\n            \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\",\n            \"headers\": {\n              \"Content-Length\": \"547541\",\n              \"Content-Type\": \"image/jpg\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 2 — 取得 File API 回應細節"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應包含："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"欄位"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"說明"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"file_id"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"用於建立 AI 任務的識別碼。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"requests.url"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"用於上傳實際圖片檔案的簽名網址。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"requests.method"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳方法，通常為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PUT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"requests.headers"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳請求所需的標頭。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 3 — 上傳圖片到提供的網址"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用 File API 回應中的 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"requests.url"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 上傳來源圖片。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --location --request PUT 'https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...' \\\n  --header 'Content-Type: image/jpg' \\\n  --header 'Content-Length: 547541' \\\n  --data-binary @'./full_body_photo_01_3dbd1b6683.jpg'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --location --request PUT 'https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...' \\\n  --header 'Content-Type: image/jpg' \\\n  --header 'Content-Length: 547541' \\\n  --data-binary @'./full_body_photo_01_3dbd1b6683.jpg'\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 4 — 建立 AI 任務"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /s2s/v2.0/task/bg-blur"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 建立 AI 任務。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參數"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"說明"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"範例"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"src_file_id"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"從 File API 上傳流程回傳的檔案 ID。使用上傳檔案工作流程時為必要。"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\""},"children":[],"type":"code"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"src_file_url"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片的直接網址。作為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"src_file_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 的替代方案。"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"https://example.com/selfie.jpg\""},"children":[],"type":"code"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"intensity"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"模糊強度。0 代表不模糊，100 代表最大模糊。"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"50"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"請求範例："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"const resp = await fetch(\n  'https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-blur',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: 'Bearer <YOUR_TOKEN_HERE>'\n    },\n    body: JSON.stringify({\n      src_file_url: 'https://example.com/selfie.jpg',\n      intensity: 50\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);\n","language":"javascript"},"children":[{"$$mdtype":"Node","attributes":{"content":"const resp = await fetch(\n  'https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-blur',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: 'Bearer <YOUR_TOKEN_HERE>'\n    },\n    body: JSON.stringify({\n      src_file_url: 'https://example.com/selfie.jpg',\n      intensity: 50\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 任務 API 回應："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 200,\n  \"data\": {\n    \"task_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9_13W5TOD8_u_GPi6NqQ3dhlmN-6ntFwhzT\"\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 200,\n  \"data\": {\n    \"task_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9_13W5TOD8_u_GPi6NqQ3dhlmN-6ntFwhzT\"\n  }\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 5 — 設定ebhook 或輪詢任務結果"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"設定與驗證細節請參考 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/develop/webhook"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"webhook 整合指南"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輪詢時，使用回傳的 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 查詢任務狀態。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request GET \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-blur/<YOUR_TASK_ID> \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request GET \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-blur/<YOUR_TASK_ID> \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json'\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 6 — 取得結果圖片"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"處理成功時，回應會在 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.results.url"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 中包含下載網址。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 200,\n  \"data\": {\n    \"error\": null,\n    \"results\": {\n      \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\"\n    },\n    \"task_status\": \"success\"\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 200,\n  \"data\": {\n    \"error\": null,\n    \"results\": {\n      \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\"\n    },\n    \"task_status\": \"success\"\n  }\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API Key 無效的回應："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"若 access token 無效，API 會回傳 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 回應。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 401,\n  \"error\": \"Unauthorized\",\n  \"error_code\": \"InvalidAccessToken\"\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"status\": 401,\n  \"error\": \"Unauthorized\",\n  \"error_code\": \"InvalidAccessToken\"\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述/整合指南"}],"sectionId":"/section/概述/整合指南"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/檔案規格與錯誤"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"檔案規格與錯誤"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"檔案規格："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"規格"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"需求"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"圖片類型"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"圖片必須包含一位清晰且顯著的前景主體或人物。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"長邊解析度上限"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"長邊不得超過 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"4096 px"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"檔案大小限制"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"必須低於 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"10 MB"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"支援的格式"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jpg"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"、"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"png"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤代碼："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤代碼"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"說明"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"exceed_max_filesize"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片超過允許的最大尺寸或檔案大小。長邊不得超過 4096 px，檔案大小必須低於 10 MB。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_nsfw_content_detected"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在來源圖片或生成的結果圖片中偵測到潛在的 NSFW 內容。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"invalid_parameter"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源鍵、目標鍵、動作、模式值、強度等級或任務設定提供了無效的參數。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_download_image"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"無法成功下載來源圖片。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_decode_image"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"無法成功解碼來源圖片。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"環境與相依性："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"工具 / 語言"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"建議的執行環境版本"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"cURL"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bash ≥ 3.2；curl ≥ 7.58（具現代 TLS/HTTP 支援）；jq ≥ 1.6（穩健的 JSON 解析）。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Node.js"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Node ≥ 18（支援全域 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fetch"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"）。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"JavaScript 瀏覽器支援"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Chrome / Edge ≥ 80、Firefox ≥ 74、Safari ≥ 13.1。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PHP"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PHP ≥ 7.4（具現代 TLS 相容性）；建議 ext-curl，或 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"allow_url_fopen=On"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 並具備 OpenSSL 與 JSON 支援。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Python"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Python ≥ 3.10（支援 f-strings）；requests ≥ 2.20.0。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Java"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Java 11+（支援 HttpClient）；Jackson Databind ≥ 2.12.0。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述/檔案規格與錯誤"}],"sectionId":"/section/概述/檔案規格與錯誤"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/點數消耗"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"點數消耗"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 功能"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"消耗的點數"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 模糊背景 V2.0"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述/點數消耗"}],"sectionId":"/section/概述/點數消耗"}]}]}},{"type":"group","label":"概述","link":"/zh-tw/reference/ai_photo_background_blur/section/概述","routeSlug":"/zh-tw/reference/ai_photo_background_blur/section/概述","items":[{"type":"link","label":"整合指南","link":"/zh-tw/reference/ai_photo_background_blur/section/概述/整合指南","routeSlug":"/zh-tw/reference/ai_photo_background_blur/section/概述/整合指南","content":null},{"type":"link","label":"檔案規格與錯誤","link":"/zh-tw/reference/ai_photo_background_blur/section/概述/檔案規格與錯誤","routeSlug":"/zh-tw/reference/ai_photo_background_blur/section/概述/檔案規格與錯誤","content":null},{"type":"link","label":"點數消耗","link":"/zh-tw/reference/ai_photo_background_blur/section/概述/點數消耗","routeSlug":"/zh-tw/reference/ai_photo_background_blur/section/概述/點數消耗","content":null}],"content":null},{"type":"group","label":"V2.0","link":"/zh-tw/reference/ai_photo_background_blur/v2.0","routeSlug":"/zh-tw/reference/ai_photo_background_blur/v2.0","items":[{"label":"執行 AI 模糊背景任務。","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-tw/reference/ai_photo_background_blur/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur/post","routeSlug":"/zh-tw/reference/ai_photo_background_blur/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur/post","metadata":{"seo":{"title":"執行 AI 模糊背景任務。","description":"AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 success 或 error 通知後，使用收到的 task_id 查詢任務結果。設定與驗證細節請見 webhook 整合指南。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"執行 AI 模糊背景任務。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1bg-blur/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"執行 AI 模糊背景任務。","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 或 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 通知後，使用收到的 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 查詢任務結果。設定與驗證細節請見 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/develop/webhook"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"webhook 整合指南"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"若您的整合不支援 webhook 或無法使用 webhook，請實作輪詢。送出 AI 任務後，以固定間隔（例如每 10 秒）輪詢狀態端點，直到任務狀態為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 或 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuthenticationV2","scopes":[],"type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_0"}},"schemaId":"schema_0","pointer":"/paths/~1s2s~1v2.0~1task~1bg-blur/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/s2s/v2.0/task/bg-blur","servers":[{"url":"https://yce-api-01.makeupar.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_0"}},"responseCodes":["200","400","401","429"],"pointer":"/s2s/v2.0/task/bg-blur","href":"v2.0/paths/~1s2s~1v2.0~1task~1bg-blur/post","summary":"執行 AI 模糊背景任務。"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://yce-api-01.makeupar.com"}],"schemaId":"schema_0","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_0"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行成功"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/BasicRunTaskResponseV2"}},"schemaId":"components/schemas/BasicRunTaskResponseV2"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行失敗"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}},"schemaId":"schema_1"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 金鑰無效或缺失"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"429","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"請求過多"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}},"schemaId":"schema_3"}],"pointer":"/paths/~1s2s~1v2.0~1task~1bg-blur/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/BasicRunTaskResponseV2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/BasicRunTaskResponseV2"}}},{"code":"400","schemaId":"schema_1","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}}},{"code":"401","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"429","schemaId":"schema_3","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur/post"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/bg-blur"},{"label":"查詢 AI 模糊背景任務的狀態。","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-tw/reference/ai_photo_background_blur/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get","routeSlug":"/zh-tw/reference/ai_photo_background_blur/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get","metadata":{"seo":{"title":"查詢 AI 模糊背景任務的狀態。","description":"查詢 AI 模糊背景任務的狀態。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"查詢 AI 模糊背景任務的狀態。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"查詢 AI 模糊背景任務的狀態。","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuthenticationV2","scopes":[],"type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"task_id","in":"path","schemaId":"schema_4","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要查詢的任務 ID"},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/s2s/v2.0/task/bg-blur/{task_id}","servers":[{"url":"https://yce-api-01.makeupar.com"}],"parameters":{"path":[{"name":"task_id","in":"path","required":true,"example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe","schemaId":"schema_4"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer"}],"scopes":[]}],"responseCodes":["200","400","401","500"],"pointer":"/s2s/v2.0/task/bg-blur/{task_id}","href":"v2.0/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get","summary":"查詢 AI 模糊背景任務的狀態。"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://yce-api-01.makeupar.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"成功查詢任務狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_5"}},"schemaId":"schema_5"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務 ID 無效"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6"}},"schemaId":"schema_6"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 金鑰無效或缺失"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"500","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行逾時"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7"}},"schemaId":"schema_7"}],"pointer":"/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_5","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_5"}}},{"code":"400","schemaId":"schema_6","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6"}}},{"code":"401","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"500","schemaId":"schema_7","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/bg-blur/{task_id}"}],"content":{"contentType":"group","meta":{"name":"V2.0"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"V2.0","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 模糊背景 API 可讓您使用 AI 技術模糊圖片的背景。"},"children":[],"type":"text"}],"type":"paragraph"}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/s2s/v2.0/task/bg-blur","summary":"執行 AI 模糊背景任務。","prefix":{"name":"post","color":"post"},"badges":[],"link":"/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur/post","deprecated":false},{"title":"/s2s/v2.0/task/bg-blur/{task_id}","summary":"查詢 AI 模糊背景任務的狀態。","prefix":{"name":"get","color":"get"},"badges":[],"link":"/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur~1{task_id}/get","deprecated":false}]}]}]}]}}],"store":{"schemaStore":{"components/schemas/BasicRunTaskV2SrcFileUrl":{"id":"components/schemas/BasicRunTaskV2SrcFileUrl","kind":"json-schema","title":"BasicRunTaskV2SrcFileUrl","data":{"type":"object","required":["src_file_url"],"properties":{"src_file_url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要執行任務的檔案網址。該網址應可公開存取。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/selfie.jpg"}}}},"components/schemas/BasicRunTaskV2SrcFileId":{"id":"components/schemas/BasicRunTaskV2SrcFileId","kind":"json-schema","title":"BasicRunTaskV2SrcFileId","data":{"type":"object","required":["src_file_id"],"properties":{"src_file_id":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要執行任務的檔案 ID。檔案 ID 來自上傳檔案 API。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="}}}},"components/schemas/BasicRunTaskV2":{"id":"components/schemas/BasicRunTaskV2","kind":"json-schema","title":"BasicRunTaskV2","data":{"title":"BasicRunTaskV2","anyOf":[{"title":"Run task with src file url","allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"}]},{"title":"Run task with src file ID","allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileId"}]}]}},"components/schemas/BasicRunTaskResponseV2":{"id":"components/schemas/BasicRunTaskResponseV2","kind":"json-schema","title":"BasicRunTaskResponseV2","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":200},"data":{"type":"object","properties":{"task_id":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"這個任務的 ID。任務結果可以此 ID 查詢，有效期限 24 小時。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"}}}}}},"components/schemas/RunError":{"id":"components/schemas/RunError","kind":"json-schema","title":"RunError","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":400},"error":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤訊息"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"The operation could not be completed"},"error_code":{"type":"string","enum":["InvalidParameters","CreditInsufficiency","InvalidStyleGroup","InvalidStyle","BadRequest"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤代碼："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"InvalidParameters - 請求參數無效"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"CreditInsufficiency - 點數不足，無法執行"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"BadRequest - 非預期的請求參數"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"InvalidStyleGroup - 風格群組 id 無效"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"InvalidStyle - 風格 id 無效"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]}}}},"components/schemas/EngineErrorCode":{"id":"components/schemas/EngineErrorCode","kind":"json-schema","title":"EngineErrorCode","data":{"type":"string","nullable":true,"enum":["error_exceed_max_image_size","exceed_max_filesize","invalid_parameter","error_download_image","error_download_mask","error_decode_image","error_decode_mask","error_nsfw_content_detected","error_no_face","error_pose","error_face_parsing","error_inference","exceed_nsfw_retry_limits","error_upload","unknown_internal_error"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_exceed_max_image_size`  - 輸入圖片尺寸超過上限"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`exceed_max_filesize` - 輸入檔案大小超過上限"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`invalid_parameter` - 參數值無效"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_download_image` - 下載來源圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_download_mask` - 下載遮罩圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_decode_image` - 解析來源圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_decode_mask` - 解析遮罩圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_nsfw_content_detected` - 在來源圖片中偵測到 NSFW 內容"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_no_face` - 來源圖片未偵測到臉部"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_pose` - 無法偵測來源圖片的姿势"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_face_parsing` - 無法對來源圖片進行臉部分割"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_inference` - 推論流程錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`exceed_nsfw_retry_limits` - 超過重試上限以避免產生 NSFW 圖片"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_upload` - 上傳結果圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`unknown_internal_error` - 其他"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]}},"components/schemas/TaskStatusResponseBodySingleUrlResultsV2":{"id":"components/schemas/TaskStatusResponseBodySingleUrlResultsV2","kind":"json-schema","title":"TaskStatusResponseBodySingleUrlResultsV2","data":{"type":"object","properties":{"url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載這個結果的網址。有效期限 2 小時"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/sample-result-url"}}}},"components/schemas/TaskStatusResponseV2":{"id":"components/schemas/TaskStatusResponseV2","kind":"json-schema","title":"TaskStatusResponseV2","data":{"type":"object","properties":{"url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載這個結果的網址。有效期限 2 小時"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/sample-result-url"}}}},"schema_0":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2"},{"type":"object","properties":{"intensity":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"背景模糊的強度。0 代表不模糊，100 代表最大模糊。"},"children":[],"type":"text"}],"type":"paragraph"}],"minimum":0,"maximum":100,"default":50,"example":50}}}]},"id":"schema_0"},"schema_1":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/RunError"}]},"id":"schema_1"},"schema_2":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":401,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Invalid API key"}}},"id":"schema_2"},"schema_3":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":429,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Too many requests"}}},"id":"schema_3"},"schema_4":{"kind":"json-schema","data":{"type":"string","example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"},"id":"schema_4"},"schema_5":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":200},"data":{"type":"object","properties":{"task_status":{"type":"string","enum":["running","success","error"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"這個任務的狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"$ref":"#/components/schemas/EngineErrorCode"},"error_message":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤的詳細說明"},"children":[],"type":"text"}],"type":"paragraph"}]},"results":null}}},"$ref":"#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"},"id":"schema_5"},"schema_6":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":400,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Invalid task ID"}}},"id":"schema_6"},"schema_7":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":500,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Task execution timed out"}}},"id":"schema_7"}},"exampleStore":{},"securitySchemeStore":{"BearerAuthenticationV2":{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}},"specVersion":"3.0.0","servers":[{"url":"https://yce-api-01.makeupar.com"}],"specType":"openapi"},"options":{"layout":"stacked","mockServer":{"off":true,"position":"off"},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/@l10n/zh-TW/reference/ai_photo_background_blur.json?download"},{"url":"/_bundle/@l10n/zh-TW/reference/ai_photo_background_blur.yaml?download"}],"excludeFromSearch":false,"replayFeatures":{"graphql":false,"asyncapi":false},"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"AI 模糊背景","description":"# 概述\n淺景深（bokeh）效果是一種受歡迎的攝影技術，用於模糊照片背景並讓主體對焦。它為照片增添藝術氣息，使其看起來更專業且吸睛。\n\n用 AI 模糊背景 API 創造專業外觀的照片，它自動隔離主體並套用自然的背景模糊，將注意力引導到最重要的地方。\n\n\n**使用情境範例：**\n\n* 人像增強\n套用自然的淺景深效果，讓主體突出，並提升個人頭像或人像照片的視覺品質。\n\n    之前：\n    ![](https://yce.makeupar.com/assets/images/sod/banner/blur/yce-topbanner-dt-before.jpg)\n\n    之後：\n    ![](https://yce.makeupar.com/assets/images/sod/banner/blur/yce-topbanner-dt-after.jpg)\n\n* 專業形象照\n從一般照片創造類攝影棚的背景模糊效果，用於商務個人檔案與企業目錄。\n\n    之前：\n    ![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_blur_bg_s3_poster_1_50a314e3f9.jpg)\n\n    之後：\n    ![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_blur_bg_s3_poster_2_afb0548cb7.jpg)\n\n---\n\n## 整合指南\n\n**輸入需求與處理標準：**\n\n- 上傳包含清晰、顯著前景主體的圖片。\n- 圖片最長邊不得超過 **4,096 px**。\n- 來源檔案大小必須低於 **10 MB**。\n- 至少需要一位清晰可見的前景主體。\n- 僅支援單主體分析。若出現多人，API 會自動選擇可見面積最大的主體。\n\n\n**工作流程：**\n\n1. 呼叫 File API。\n2. 從回應中取得簽名的上傳網址。\n3. 將實際圖片上傳到回傳的網址。\n4. 建立 AI 任務。\n5. 設定 Webhook 或輪詢任務狀態直到完成。\n6. 處理成功後下載生成的結果圖片。\n\n---\n\n**步驟 1 — 使用 File API 上傳檔案 metadata**\n\n使用 `POST /s2s/v2.0/file` 建立檔案記錄，並取得來源圖片的上傳細節。\n\n```bash\ncurl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/file \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"files\": [\n      {\n        \"content_type\": \"image/jpg\",\n        \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n        \"file_size\": 547541\n      }\n    ]\n  }'\n```\n\n**File API 回應範例：**\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"files\": [\n      {\n        \"content_type\": \"image/jpg\",\n        \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n        \"file_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\",\n        \"requests\": [\n          {\n            \"method\": \"PUT\",\n            \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\",\n            \"headers\": {\n              \"Content-Length\": \"547541\",\n              \"Content-Type\": \"image/jpg\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n---\n\n**步驟 2 — 取得 File API 回應細節**\n\n回應包含：\n\n| 欄位 | 說明 |\n| --- | --- |\n| `file_id` | 用於建立 AI 任務的識別碼。 |\n| `requests.url` | 用於上傳實際圖片檔案的簽名網址。 |\n| `requests.method` | 上傳方法，通常為 `PUT`。 |\n| `requests.headers` | 上傳請求所需的標頭。 |\n\n---\n\n**步驟 3 — 上傳圖片到提供的網址**\n\n使用 File API 回應中的 `requests.url` 上傳來源圖片。\n\n```bash\ncurl --location --request PUT 'https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...' \\\n  --header 'Content-Type: image/jpg' \\\n  --header 'Content-Length: 547541' \\\n  --data-binary @'./full_body_photo_01_3dbd1b6683.jpg'\n```\n\n---\n\n**步驟 4 — 建立 AI 任務**\n\n使用 `POST /s2s/v2.0/task/bg-blur` 建立 AI 任務。\n\n| 參數 | 說明 | 範例 |\n| --- | --- | --- |\n| `src_file_id` | 從 File API 上傳流程回傳的檔案 ID。使用上傳檔案工作流程時為必要。 | `\"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\"` |\n| `src_file_url` | 來源圖片的直接網址。作為 `src_file_id` 的替代方案。 | `\"https://example.com/selfie.jpg\"` |\n| `intensity` | 模糊強度。0 代表不模糊，100 代表最大模糊。 | 50 |\n\n**請求範例：**\n\n```javascript\nconst resp = await fetch(\n  'https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-blur',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: 'Bearer <YOUR_TOKEN_HERE>'\n    },\n    body: JSON.stringify({\n      src_file_url: 'https://example.com/selfie.jpg',\n      intensity: 50\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);\n```\n\n**AI 任務 API 回應：**\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"task_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9_13W5TOD8_u_GPi6NqQ3dhlmN-6ntFwhzT\"\n  }\n}\n```\n\n---\n\n**步驟 5 — 設定ebhook 或輪詢任務結果**\n\n設定與驗證細節請參考 [webhook 整合指南](/develop/webhook.md)。\n\n輪詢時，使用回傳的 `task_id` 查詢任務狀態。\n\n```bash\ncurl --request GET \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-blur/<YOUR_TASK_ID> \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json'\n```\n\n---\n\n**步驟 6 — 取得結果圖片**\n\n處理成功時，回應會在 `data.results.url` 中包含下載網址。\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"error\": null,\n    \"results\": {\n      \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\"\n    },\n    \"task_status\": \"success\"\n  }\n}\n```\n\n**API Key 無效的回應：**\n\n若 access token 無效，API 會回傳 `401` 回應。\n\n```json\n{\n  \"status\": 401,\n  \"error\": \"Unauthorized\",\n  \"error_code\": \"InvalidAccessToken\"\n}\n```\n\n---\n\n## 檔案規格與錯誤\n\n**檔案規格：**\n\n| 規格 | 需求 |\n| --- | --- |\n| 圖片類型 | 圖片必須包含一位清晰且顯著的前景主體或人物。 |\n| 長邊解析度上限 | 長邊不得超過 **4096 px**。 |\n| 檔案大小限制 | 必須低於 **10 MB**。 |\n| 支援的格式 | `jpg`、`png`。 |\n\n**錯誤代碼：**\n\n| 錯誤代碼 | 說明 |\n| --- | --- |\n| `exceed_max_filesize` | 來源圖片超過允許的最大尺寸或檔案大小。長邊不得超過 4096 px，檔案大小必須低於 10 MB。 |\n| `error_nsfw_content_detected` | 在來源圖片或生成的結果圖片中偵測到潛在的 NSFW 內容。 |\n| `invalid_parameter` | 來源鍵、目標鍵、動作、模式值、強度等級或任務設定提供了無效的參數。 |\n| `error_download_image` | 無法成功下載來源圖片。 |\n| `error_decode_image` | 無法成功解碼來源圖片。 |\n\n**環境與相依性：**\n\n| 工具 / 語言 | 建議的執行環境版本 |\n| --- | --- |\n| cURL | Bash ≥ 3.2；curl ≥ 7.58（具現代 TLS/HTTP 支援）；jq ≥ 1.6（穩健的 JSON 解析）。 |\n| Node.js | Node ≥ 18（支援全域 `fetch`）。 |\n| JavaScript 瀏覽器支援 | Chrome / Edge ≥ 80、Firefox ≥ 74、Safari ≥ 13.1。 |\n| PHP | PHP ≥ 7.4（具現代 TLS 相容性）；建議 ext-curl，或 `allow_url_fopen=On` 並具備 OpenSSL 與 JSON 支援。 |\n| Python | Python ≥ 3.10（支援 f-strings）；requests ≥ 2.20.0。 |\n| Java | Java 11+（支援 HttpClient）；Jackson Databind ≥ 2.12.0。 |\n\n---\n\n## 點數消耗\n\n| AI 功能 | 消耗的點數 |\n|---|---|\n| AI 模糊背景 V2.0 | 1 |\n\n---\n"}},"baseSlug":"/zh-tw/reference/ai_photo_background_blur","routesMapping":{}}