Skip to main content
POST
/
api
/
open-api
/
v1
/
images
/
edits
Edit Image (Sync)
curl --request POST \
  --url https://www.jimmyai.cn/api/open-api/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'image=<string>' \
  --form 'prompt=<string>' \
  --form model=gpt-image-2 \
  --form size=1024x1024 \
  --form n=1 \
  --form quality=low \
  --form image.items='@example-file'
{
  "code": 20000,
  "msg": "ok",
  "data": {
    "created": 123,
    "data": [
      {
        "b64_json": "<string>",
        "revised_prompt": "<string>"
      }
    ],
    "model": "gpt-image-2",
    "usage": {
      "input_tokens": 123,
      "output_tokens": 123,
      "total_tokens": 123,
      "input_tokens_details": {
        "image_tokens": 123,
        "text_tokens": 123
      },
      "output_tokens_details": {
        "image_tokens": 123,
        "text_tokens": 123
      }
    }
  }
}
This is a synchronous endpoint compatible with OpenAI POST /v1/images/edits. Upload the source image via multipart/form-data. On success, billing is applied immediately and the edited image is returned in data (b64_json or url).
Editing often takes 30–120 seconds. Set client timeout to ≥ 180 seconds. Each file (image / mask) must be ≤ 20MB.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
image
file[]
required

Source image files (required, max 20MB each, up to 16 files; single-file upload also supported, field name image)

prompt
string
required

Edit prompt

model
string
default:gpt-image-2
size
string
default:1024x1024
n
integer
default:1
quality
enum<string>
default:low
Available options:
low,
medium,
high,
auto
background
enum<string>
Available options:
transparent,
opaque,
auto
output_format
enum<string>
Available options:
png,
jpeg,
webp

Response

200 - application/json

Edit successful

code
integer
Example:

20000

msg
string
Example:

"ok"

data
object

OpenAI-compatible image result