API 參考
取得工具報價
/v1/tools/{id}/quote統一支援 flat 常量按次、input 按輸入預計算和 usage 按最終用量。pricing.quote_required 決定是否必須報價,requires_usage 決定是否必須提供費用上限並等待權威最終用量;二者不由 schema_version 推斷。metered_pricing 關閉時僅限制需要最終用量的新呼叫,常量/輸入規則若不需要最終用量仍可使用。當前 Key 需具備工具授權,執行身份和結果以原 Key 為界。工具總開關關閉時目錄為空;匿名目錄不能作為可執行授權。 路徑 id 提供工具身份;公開報價體僅接受必填非空 version 和符合 input_schema 的 input,拒絕 tool_id、quote_id、max_cost_usd 等額外欄位。報價有效 300 秒,繫結同 Key、精確版本、規範輸入及價格配置;回顯 tool_id/version/maximum_usd,不執行任務。
鑑權與許可權
使用當前 GloopAPI Key。模型、功能與許可權以當前 Key 的目錄及介面說明為準。
Authorization: Bearer $GLOOP_API_KEY鑑權方案: BearerAuth
請求
路徑引數
idstring必填目錄工具 ID 或原工具執行 ID,取當前操作物件。
請求體 · application/json
- 型別
- object
- 必填欄位
versioninput- 額外屬性
- false
請求體必填
響應與錯誤
HTTP 200
取得工具報價成功
application/json
- 型別
- object
- 必填欄位
quote_idmaximum_usdprice_versionexpires_atcomponentstool_idversion
quote_idstring必填報價公開 ID,建立時必須符合價格與請求繫結。
maximum_usdstring必填本次規範輸入的最大美元預留金額。
price_versioninteger必填銷售價格修訂版本。
expires_atinteger必填Unix 秒有效期;工具報價有效 300 秒,以實際 expires_at 為準。
componentsunknown必填由所選工具的 schema 或協議定義的 JSON 值;不假定固定欄位。
tool_idstring必填本次報價繫結的工具 ID。
versionstring必填本次報價繫結的精確工具契約版本。
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選填