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选填