FocalAPI 文档
API 参考图像创作

编辑图像

POST
/v1/images/edits

基于输入图片编辑图像(如 GPT Image 的背景替换与蒙版编辑)。

授权

BearerAuth
授权Bearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

位置: header

请求主体

application/json

TypeScript 定义

在 TypeScript 中使用 request body 类型。

响应主体

application/json

curl -X POST "https://example.com/v1/images/edits" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-image-2",    "prompt": "将背景替换为日落时分的海滩",    "image": "https://example.com/input.png",    "background": "transparent",    "quality": "high"  }'
{  "created": 0,  "data": [    {      "url": "string",      "b64_json": "string",      "revised_prompt": "string"    }  ]}