AI 任務是非同步的。當功能支援 webhook 時,請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章,並在收到 success 或 error 通知後,使用收到的 task_id 查詢任務結果。設定與驗證細節請見 webhook 整合指南。
若您的整合不支援 webhook 或無法使用 webhook,請實作輪詢。送出 AI 任務後,以固定間隔(例如每 10 秒)輪詢狀態端點,直到任務狀態為 success 或 error。
安全
BearerAuthenticationV2
Any of:
背景如何生成。使用 prompt(預設)時,背景由 prompt 生成。使用 template 時,背景由 template_id 指定的預先定義範本生成,並忽略 prompt。
注意: 若 type 設為 prompt,但未提供提示而提供了 template_id,則 template_id 會被忽略,系統將套用預設設定。同樣地,若 type 設為 template 但未提供 template_id,無論是否提供提示,都會使用預設範本。
默认值:"prompt"
Enum:"prompt""template"
- https://yce-api-01.makeupar.comhttps://yce-api-01.makeupar.com/s2s/v2.0/task/bg-replace
curl -i -X POST \
https://yce-api-01.makeupar.com/s2s/v2.0/task/bg-replace \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"src_file_url": "https://example.com/selfie.jpg",
"type": "prompt",
"prompt": "A sunny beach with palm trees.",
"template_id": "nature_cherryblossom"
}'响应
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }