FocalAPI Docs
API 参考图像创作

编辑图像

POST
/v1/images/edits

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

Authorization

BearerAuth
AuthorizationBearer <token>

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

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response 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"    }  ]}