API 參考
查詢影象任務
/v1/image-tasks/{task_id}依相同 Key 與目前模型授權查詢。編輯/放大結果在結算成功後提供需 Bearer 驗證的 result URL,詳細資訊與列表不內嵌 Base64。結果未知時請查詢原任務,禁止自動重新生成。
鑑權與許可權
使用當前 GloopAPI Key。模型、功能與許可權以當前 Key 的目錄及介面說明為準。
Authorization: Bearer $GLOOP_API_KEY鑑權方案: BearerAuth
請求
路徑引數
task_idstring必填同 Key 建立的任務公開 ID。
響應與錯誤
HTTP 200
查詢影象任務成功
application/json
- 型別
- object
- 必填欄位
modelpromptsizenreferencesidstatuscreated_atupdated_atreserved_quotafinal_quotabilling_statusresults
modelstring必填當前 Key 目錄中的公開模型 ID。
promptstring必填生成提示詞。
sizestring必填選擇模型支援的尺寸。按寬高比生成的模型將此值作為比例選擇,不保證精確畫素尺寸。
ninteger必填請求輸出張數,仍受所選模型上限約束。
referencesarray必填生成引用圖片列表。
source_task_idstring選填來源任務公開 ID,僅用於追溯。
quote_idstring選填報價公開 ID,建立時必須符合價格與請求繫結。
idstring必填該物件的公開識別符號;用於對應詳情路徑。
statusstring必填unknown 不自動重發,預扣賬務可能仍 pending。
- 列舉
["queued","dispatching","running","succeeded","partial_succeeded","failed","unknown","deleted"]
created_atinteger必填Unix 秒建立時間。
updated_atinteger必填Unix 秒最後更新時間。
reserved_quotainteger必填以平臺 quota 單位表示的預留額度,不是美元數。
final_quotainteger必填以平臺 quota 單位表示的最終費用;null 表示尚未確定。
billing_statusstring必填預留/結算/退回狀態,與任務及歸檔狀態分別檢查。
error_codestring選填可用於分支處理的公開錯誤碼。
error_messagestring選填經過公開錯誤分類的使用者說明。
resultsarray必填生成輸出項目;新結果不自動轉存,歷史檔案各項儲存狀態獨立。
results 子欄位(1)
[]object選填[] 子欄位(7)
file_idstring選填同賬戶同 Key 的託管檔案公開 ID。
storage_statusstring選填歷史檔案封存狀態;新生成的結果不自動轉存,直接使用供應商結果。
storage_errorstring選填檔案歸檔失敗的公開分類。
expires_atinteger選填Unix 秒有效期,0 表示不按固定時間到期。
urlstring選填結果或引用的訪問 URL;簽名 URL 僅短時有效。
b64_jsonstring選填圖片 Base64 字串;不要當成 URL 請求。
revised_promptstring選填返回的修訂提示詞(若有)。
billingobject選填按任务冻结的额度换算比例折算的调用者美元费用;仅最终结算或退款时提供 final_amount,缺失不代表零费用。
billing 子欄位(4)
currencystring必填- 列舉
["USD"]
reserved_amountstring必填美元预留金额,十进制字符串。
final_amountstring選填已结算或已退款的最终美元费用。待结算时省略。
maximum_amountstring選填冻结图片报价认证的最高 USD 钱包费用;缺失表示未认证上限,reserved_amount 本身不表示上限。
HTTP 400
請求欄位或引數無效。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 401
Key 缺失、無效、過期或已撤銷。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 403
IP、賬戶、模型或工具許可權不足。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 404
物件/能力不可用,或功能開關關閉。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 409
冪等/報價衝突、物件未準備或仍被引用。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 429
請求/佇列限流。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 500
鑑權或資料儲存內部失敗。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填
HTTP 503
服務、定價或儲存不可用。
application/json
- 型別
- object
- 必填欄位
error
errorobject必填error 子欄位(4)
codestring選填messagestring選填typestring選填request_idstring選填