infery
← All models

GPT Image 2

gpt-image-2

Image generationby OpenAI

State-of-the-art image generation model

images

Details

Accepts
text + image

Pricing

Input
625 cr / 1M tokens
Output
1250 cr / 1M tokens
Image input
1000 cr / 1M tokens

Prices in credits (1 credit = $0.01).

Data schema

approximate

Input

FieldTypeDescription
nintegerNumber of outputs.
sizestringenum: 1024x1024, 1024x1536, 1536x1024, auto
promptrequiredstringThe text prompt.
qualitystringenum: low, medium, high, auto
backgroundstringenum: transparent, opaque, auto
output_formatstringenum: png, webp, jpeg
imagestringInput image (URL or data URI).
user_idstringAn optional unique identifier representing your end-user. This helps OpenAI monitor and detect abuse.
moderationenum: auto, lowContent moderation level
aspect_ratioenum: 1:1, 3:2, 2:3, 4:3, 3:4, 16:9The size of the generated image. Use 'auto' to let the model pick. Sizes above 2560x1440 are experimental and may give more variable results.
input_imagesarrayA list of images to use as input for the generation
openai_api_keystringYour OpenAI API key (optional - uses proxy if not provided)
number_of_imagesintegerNumber of images to generate (1-10)
output_compressionintegerCompression level (0-100%)

Output

FieldTypeDescription
imagesarrayGenerated images ([{ url }]).