Ae · Openai · Gpt · Image · 2
22.00积分/次
ae_openai_gpt_image_2
使用 GPT Image 2 根据文字描述生成图片,支持通过图片 URL 提供参考图,并设置输出尺寸和质量档位。
22.00积分/次
价格说明
22.00积分/次
API 调用
通过统一工具网关发起同步请求,鉴权和计费由 AgentEarth 处理。
cURL
curl --request POST \
--url 'https://api.agentearth.ai/v1/tools/run' \
--header 'Authorization: Bearer $AGENTEARTH_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"tool": "ae_openai_gpt_image_2",
"input": {
"size": "auto",
"image": "xxx",
"prompt": "xxx",
"quality": "auto"
}
}'- 请求方式
- POST
- 接口地址
- /v1/tools/run
- 鉴权方式
- Bearer Token
- 超时时间
- 60 秒
- 当前版本
- —
响应示例
{
"error_no": 0,
"error_msg": "",
"result": [
{
"type": "text",
"text": "xxx"
}
],
"platform_annotations": {
"source": "AgentEarth",
"platform_note": "xxx",
"platform_suggestion": "xxx"
}
}工具参数
未传入的可选参数将使用平台默认值。
| 参数 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
size | string | 否 | 输出图片尺寸。可传 auto(自动选择),或使用宽x高的像素格式,例如 1024x1024、1536x1024、1024x1536。具体尺寸需满足上游模型约束,默认为 auto。 | auto |
image | array | 否 | 可选参考图 URL 列表。传入可公开访问的图片链接,并在 prompt 中描述生成或修改要求;不传时根据文字描述生成图片。 | — |
prompt | string | 是 | 图片生成或修改的文本提示词。建议写清主体、场景、材质、光线、构图、风格和需要渲染的文字。提供参考图时,请明确需要修改和保留的内容。 | — |
quality | enum (auto | low | medium | high) | 否 | 请求的图片质量档位,可选 auto、low、medium 或 high,默认为 auto。实际渲染效果由上游服务决定。 | auto |
