API 參考
取得持久影象報價
/v1/image-quotes僅驗證輸入與權限,不鎖定圖片。報價有效 60 秒,建立時重新驗證路由/價格/請求;服務開關關閉時傳回 503。編輯依所選規格的基本費加上第一張以外的輸入圖片附加費計費,放大依倍率計費;報價會固定輸入順序、數量、規格與價格。缺少價格或參數不受支援時無法建立報價。
鑑權與許可權
使用當前 GloopAPI Key。模型、功能與許可權以當前 Key 的目錄及介面說明為準。
Authorization: Bearer $GLOOP_API_KEY鑑權方案: BearerAuth
請求
請求體 · application/json
- 型別
- object
- 必填欄位
model- 額外屬性
- false
- 說明
- 預設為生成;編輯需要 prompt 與 references,放大需要一張 references 與 scale,且不接受 prompt。編輯與放大為 n=1。具體規格必須來自 operation 對應的能力目錄。background_remove 為單圖去背,不需要提示詞,輸出透明 PNG;不接受 scale、creativity、審核選項或生成規格。使用 references 參照已上傳素材、檔案或安全的 HTTPS 圖片。
請求體必填
modelstring必填當前 Key 目錄中的公開模型 ID。
- 最長長度
191
promptstring選填生成:不可為空且最多 32000 UTF-8 位元組。編輯:不可為空,依模型 max_prompt_characters 限制,最多 32768 個 Unicode 字元。放大與去背:必須省略或留空。
sizestring選填選擇模型支援的尺寸。按寬高比生成的模型將此值作為比例選擇,不保證精確畫素尺寸。
ninteger選填省略或 0 歸一為 1。實際上限取 image-models 的 max_n,不能將全域性上限當模型能力。
- 預設值
1- 最小值
1- 最大值
6
referencesarray選填每項僅選 file_id、asset_id、url 之一;實際數量取 max_references。
- 最多項數
14
source_task_idstring選填可選的同 Key 來源任務,僅追溯來源,不代替 references。
- 最長長度
64
quote_idstring選填建立任務時必須是有效且匹配請求的報價;報價請求中忽略。
moderationstring選填支援此能力的模型預設使用
moderation=auto;low請求未模糊輸出,不繞過模型限制。不支援此引數的模型會拒絕顯式傳入。使用真實公開模型 ID;名稱字尾不會改變模型行為。- 列舉
["auto","low"]
operationstring選填- 預設值
"generate"- 列舉
["generate","edit","upscale","background_remove"]
scaleinteger選填僅放大;目標超過 16,777,216 像素時拒絕,不自動降低倍率。
- 列舉
[2,4]
creativitynumber選填- 預設值
0.01- 最小值
0- 最大值
0.02
output_formatstring選填僅編輯,預設為 png。
- 列舉
["png","jpeg","jpg","webp"]
resolutionstring選填依模型的 operation_options 選擇;有分級時必須明確指定 resolution/quality,缺少價格時不可呼叫。
qualitystring選填依模型的 operation_options 選擇;有分級時必須明確指定 resolution/quality,缺少價格時不可呼叫。
aspect_ratiostring選填依模型的 operation_options 選擇;有分級時必須明確指定 resolution/quality,缺少價格時不可呼叫。
響應與錯誤
HTTP 200
取得持久影象報價成功
application/json
- 型別
- object
- 必填欄位
pricing_noteidexpires_atreserved_quotaestimated_costcurrency
pricing_notestring必填模型計價說明;最終按確認計量結算。
idstring必填該物件的公開識別符號;用於對應詳情路徑。
expires_atinteger必填Unix 秒有效期,0 表示不按固定時間到期。
reserved_quotainteger必填以平臺 quota 單位表示的預留額度,不是美元數。
estimated_costnumber必填報價貨幣中的預估銷售費用。
currencystring必填報價/賬務幣種。
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選填