메인 콘텐츠로 건너뛰기
POST
/
v1
/
images
/
edits
OpenAI image edits
curl --request POST \
  --url https://maas.apigo.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'image=<string>' \
  --form 'prompt=在图片中添加一朵红色的玫瑰花' \
  --form background=transparent \
  --form input_fidelity=high \
  --form mask='@example-file' \
  --form model=gpt-image-1 \
  --form n=1 \
  --form output_compression=100 \
  --form output_format=png \
  --form partial_images=0 \
  --form quality=auto \
  --form response_format=url \
  --form size=1024x1024 \
  --form stream=false \
  --form 'user=<string>' \
  --form image.0='@example-file' \
  --form image.1.items='@example-file'
{
  "created": 1589478378,
  "background": "auto",
  "output_format": "png",
  "quality": "high",
  "size": "1024x1024",
  "data": [
    {
      "url": "https://example.com/edited-image.png"
    }
  ],
  "usage": {
    "input_tokens": 18,
    "input_tokens_details": {
      "image_tokens": 5,
      "text_tokens": 13
    },
    "output_tokens": 1,
    "total_tokens": 19
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt

Use this file to discover all available pages before exploring further.

이미지 편집, 인페인팅 및 소스 이미지 변환에 이 끝점을 사용합니다.
  • Authorization: Bearer {API_KEY}로 인증
  • 이 엔드포인트는 일반적으로 multipart/form-data를 사용합니다.
  • 필요한 입력은 일반적으로 imageprompt이며, mask는 편집 가능한 영역을 좁힙니다.
  • gpt-image-1dall-e-2는 파일 크기 제한, 다중 이미지 지원 및 input_fidelity에서 실질적으로 다릅니다.
  • 응답에 임시 url 값이 포함되어 있으면 신속하게 미러링하세요. b64_json가 포함된 경우 메인 스레드에서 너무 많은 큰 이미지를 디코딩하지 마십시오.

인증

Authorization
string
header
필수

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

본문

multipart/form-data
image
필수

Input image or images to edit.

prompt
string
필수

Text instruction describing the desired edit.

예시:

"在图片中添加一朵红色的玫瑰花"

background
enum<string>

Only supported by gpt-image-1.

사용 가능한 옵션:
transparent,
opaque,
auto
input_fidelity
enum<string>

Only supported by gpt-image-1.

사용 가능한 옵션:
high,
low
mask
file

Optional PNG mask file. Usually must match the image dimensions.

model
enum<string>

Image editing model.

사용 가능한 옵션:
gpt-image-1,
dall-e-2
n
integer
기본값:1

Number of edited images to generate.

필수 범위: 1 <= x <= 10
output_compression
integer
기본값:100

Compression level for gpt-image-1 jpeg/webp output.

필수 범위: 0 <= x <= 100
output_format
enum<string>

Only supported by gpt-image-1.

사용 가능한 옵션:
png,
jpeg,
webp
partial_images
integer
기본값:0

Number of partial images for streaming previews.

필수 범위: 0 <= x <= 3
quality
enum<string>

Supported values vary by model.

사용 가능한 옵션:
auto,
high,
medium,
low,
standard
response_format
enum<string>

Only applies to dall-e-2.

사용 가능한 옵션:
url,
b64_json
size
enum<string>

Allowed values depend on the selected model.

사용 가능한 옵션:
1024x1024,
1536x1024,
1024x1536,
auto,
256x256,
512x512
stream
boolean
기본값:false

Streams edited image output when supported.

user
string

Unique identifier for the end user.

응답

Successful image edit response

created
integer<int64>
필수

Unix timestamp in seconds.

data
object[]
필수
background
enum<string>
사용 가능한 옵션:
transparent,
opaque,
auto
output_format
enum<string>
사용 가능한 옵션:
png,
jpeg,
webp
quality
enum<string>
사용 가능한 옵션:
auto,
high,
medium,
low,
hd,
standard
size
string
usage
object