メインコンテンツへスキップ
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