Files
yingqing/image调用参考.md
seaislee1209andClaude Opus 4.8 6464001f84 feat(core): AI 生成 Agent 化 — 多模型流式脚本 agent + 可插拔 Provider + gpt-image-2 参考图 + 模特库
- 后端·可插拔 Provider 层:通用 OpenAICompatibleProvider(tokenssr 等中转站,base_url+api_key,零改代码换站)+ ModelProvider.api_key
- 后端·脚本 agent:结构化 ScriptDraft 契约 + 加载电商 skill + 出稿/改稿一体对话 agent(3模式/多模型)+ 流式 SSE 端点(DRF SSE renderer)
- 后端·图像:gpt-image-2 参考图出图 + 故事板 @图1@图2@图3 多锚点合成(锁脸锁商品);Seedance 打开 generate_audio
- 后端·模特库:gpt-image-2 生成器(9:16氛围图→16:9白底三视图)+ seed_demo_models 管理命令
- DB·迁移:tokenssr 中转站 + 多模型 seed(豆包/GPT-5.5/Gemini + gpt-image-2);ScriptSegment 结构化字段
- 前端·脚本趴:接真 SSE(工具卡 + 思考流)+ 模型下拉 + 3模式 + 改稿;agentScriptStream
- skills/ecommerce-video-script 电商脚本技能(运行时依赖)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 03:12:03 +08:00

117 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
图像(Images/原生OpenAI格式
编辑图像
在给定原始图像和提示的情况下创建编辑或扩展图像。
接口
POST /v1/images/edits/
用途
用于 GPT Image / Image2 相关的图片生成或编辑。
前提
密钥需加入 GPT 生图分组;普通 default 分组不可直接调用。
建议
图片接口会产生生成成本,联调用例应控制尺寸、数量和重试次数。
POST
/
v1
/
images
/
edits
Try it
Authorizations
Authorization
stringheaderrequired
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
image
filerequired
要编辑的图像。必须是有效的 PNG 文件,小于 4MB,并且是方形的。如果未提供遮罩,图像必须具有透明度,将用作遮罩。
prompt
stringrequired
所需图像的文本描述。最大长度为 1000 个字符。
Example:
"A cute baby sea otter wearing a beret."
mask
file
附加图像,其完全透明区域(例如,alpha 为零的区域)指示image应编辑的位置。必须是有效的 PNG 文件,小于 4MB,并且尺寸与原始image相同。
n
string
要生成的图像数。必须介于 1 和 10 之间。
Example:
"1"
size
string
生成图像的大小。必须是256x256、512x512或 1024x1024之一。
Example:
"1024x1024"
response_format
string
生成的图像返回的格式。必须是url或b64_json。
Example:
"url"
user
string
代表您的最终用户的唯一标识符,可以帮助 OpenAI 监控和检测滥用行为。了解更多。
Example:
""
model
string
Example:
"dall-e-2"
Response
200 - application/json
The response is of type object.
curl --request POST \
--url https://www.yunqiai.chat/v1/images/edits/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form image='@example-file' \
--form 'prompt=A cute baby sea otter wearing a beret.' \
--form n=1 \
--form size=1024x1024 \
--form response_format=url \
--form user= \
--form model=dall-e-2
curl --request POST \
--url https://www.yunqiai.chat/v1/images/edits/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form image='@example-file' \
--form 'prompt=A cute baby sea otter wearing a beret.' \
--form n=1 \
--form size=1024x1024 \
--form response_format=url \
--form user= \
--form model=dall-e-2