Skip to main content
POST
Image-to-Image Editing

画像の編集

Google Gemini 2.5 Flash Image とテキスト指示を使用して、既存の画像を編集します。

エンドポイント

説明

Google Gemini 2.5 Flash Image とテキスト指示を使用して、既存の画像を編集します。このエンドポイントは、画像間の編集用に特別に設計されています。
  • 画像ファイルは 必須 (オプションである /images/generations とは異なります)
  • 画像の編集または変換方法を説明するテキスト プロンプト
  • 編集された画像は同じ品質と形式のオプションで返されます
すべてのプロンプトと応答は、監査ログとコンプライアンスのために SMLTP を通じて自動的に処理されます。

認証

必須: API キー

リクエスト本文

このエンドポイントは multipart/form-data 形式を受け入れます。

パラメータ

リクエストの例

cURL

JavaScript/Node.js

パイソン

応答

成功の応答 (200)

応答フィールド

画像オブジェクト

メタデータ オブジェクト

エラー応答

400 不正なリクエスト

401 不正

403 禁止

413 ペイロードが大きすぎます

500 内部サーバーエラー

503 サービスは利用できません

注意事項

  • サポートされている画像形式: JPEG、PNG、WEBP、GIF
  • 最大ファイルサイズ: 画像あたり 10MB
  • このエンドポイントにはイメージ ファイルが 必須 (/images/generations とは異なります)
  • プロンプトには、アップロードされた画像を編集または変換する方法が説明されています
  • セキュリティとコンプライアンスのために、すべてのリクエストは SMLTP を通じて処理されます
  • URL の代わりに response_format: "b64_json" を使用して、base64 でエンコードされた画像データを受信します

承認

Authorization
string
header
必須

API key authentication using Bearer token format. Example: Authorization: Bearer sk-your-api-key-here

ボディ

multipart/form-data
prompt
string
必須

Text instructions describing how to edit or transform the uploaded image

Required string length: 1 - 4000
:

"Add dramatic sunset colors to the sky and enhance the overall atmosphere"

image
file
必須

Image file to edit (required, JPEG, PNG, WEBP, or GIF, max 10MB)

smltp_policy
string
デフォルト:internal

SMLTP security policy to apply (e.g., 'internal', 'public', 'confidential', 'hipaa', 'gdpr')

:

"internal"

response_format
enum<string>
デフォルト:url

The format of the response images

利用可能なオプション:
url,
b64_json
:

"url"

レスポンス

Image edited successfully

success
boolean
:

true

id
string

Unique request identifier

:

"f55bb4aa-ad9a-4b5a-9c94-511bf6fce806"

object
string
:

"image.edit"

created
integer

Unix timestamp of when the image was edited

:

1705312200

data
object[]

Array of edited images

metadata
object