API 參考
上傳參考圖
POST
/v1/image-assetsmultipart 第一且唯一部分為 file,需檔名;非動畫 JPEG/PNG/WebP,上傳和重新編碼後各不超過 10 MiB。
鑑權與許可權
使用當前 GloopAPI Key。模型、功能與許可權以當前 Key 的目錄及介面說明為準。
Authorization: Bearer $GLOOP_API_KEY鑑權方案: BearerAuth
請求
請求頭
Idempotency-Keystring必填同 Key 儲存原請求意圖;網路中斷先恢復查詢,未知狀態禁止盲重發。
- 最短長度
1- 最長長度
191
請求體 · multipart/form-data
- 型別
- object
- 必填欄位
file- 額外屬性
- false
請求體必填
filestring必填唯一圖片部分,帶 filename;JPEG/PNG/WebP <=10MiB,非動畫。
- 格式
"binary"
響應與錯誤
HTTP 200
上傳參考圖成功
application/json
- 型別
- object
- 必填欄位
idmime_typesize_byteswidthheightexpires_at
file_idstring選填同賬戶同 Key 的託管檔案公開 ID。
idstring必填該物件的公開識別符號;用於對應詳情路徑。
mime_typestring必填已核驗檔案 MIME 型別。
size_bytesinteger必填檔案位元組數。
widthinteger必填圖片畫素寬度。
heightinteger必填圖片畫素高度。
expires_atinteger必填Unix 秒;0 表示無固定過期時間。上傳關聯託管檔案;讀取必須使用同賬戶同 Key。
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選填