gpt-image-2 の作成
POST
/v1/images/generations
- テキスト
promptから画像を生成します(gpt-image-2) size、format、qualityなどの出力パラメータに対応- リクエストボディは
application/json - 公式ドキュメント:Images create
Authorizations
bearer
Type
HTTP (bearer)
Request Body
application/json
model
string
Required
画像生成に使用するモデル(例:gpt-image-2)。
prompt
string
Required
生成したい画像のテキスト説明。最大 1000 文字。
n
integer
生成する画像の枚数。1 から 10 の間である必要があります。
size
string
画像サイズ
1024x1024 正方形
1536x1024 横長
1024x1536 縦長
2048x2048 2K 正方形
2048x1152 2K 横長
3840x2160 4K 横長
2160x3840 4K 縦長
auto デフォルト
サイズ制限
- 画像の最大辺 ≤ 3840px
- 幅・高さともに 16px の倍数
- 長辺 / 短辺 の比 ≤ 3:1
- 総ピクセル数:最小 655360 ~ 最大 8294400
format
string
画像形式
選択肢:png、jpeg、webp
quality
string
画質
選択肢:low、medium、high、auto(デフォルト)
Responses
application/json
object
id
string
Required
object
string
Required
created
integer
Required
choices
object[]
Required
usage
object
Required