Create image

Creates images from a text prompt. Generation is routed to OpenAI or Google depending on the model you choose.

Request and response format follow the OpenAI Images Create API as a common contract. For Google models, see Gemini API image generation.

Required body fields: model and prompt. All other fields are optional and depend on the provider and model you select via model — for example n, size, quality, response_format, output_format, background, and aspect_ratio. OpenAI GPT Image (gpt-image-1) and Google Gemini image models accept different subsets; see property descriptions below and provider documentation.

model uses the provider/model identifier format (e.g. openai/gpt-image-1 or google/gemini-3.1-flash-image), consistent with other AI Gateway operations.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Common contract based on the OpenAI Images Create API. Only model and prompt are required. All other properties are optional and vary by provider and model — see field descriptions and Gemini API image generation.

string
required

Image generation model id in provider/model format,
e.g. openai/gpt-image-1 or google/gemini-3.1-flash-image.
Required; must not be omitted. Determines which provider is used and which optional fields apply.

string
required

Text description of the desired image. OpenAI (gpt-image-1): up to 32000 characters. Google: follow Gemini image generation prompt guidance. Limits depend on the provider and model.

integer
1 to 10
Defaults to 1

Number of images to generate. OpenAI: 1–10 (default 1). Google Gemini image models: depends on the model; see Gemini API image generation. Effective maximum depends on the provider and model.

string

Output dimensions when supported. OpenAI (gpt-image-1): 1024x1024, 1536x1024, 1024x1536, or auto. Google Gemini image models: use aspect_ratio and optional image_size (e.g. 1K, 2K, 4K) — see Gemini API image generation. Allowed values depend on the provider and model.

string

Generation quality when supported. OpenAI (gpt-image-1): low, medium, or high. Ignored by Google Gemini image models when not mapped. Depends on the provider and model.

string
enum
Defaults to url

How generated images are returned. OpenAI: url (temporary link) or b64_json. Some GPT Image models may always return base64 regardless of this field. Google: normalized to this shape by the gateway. Support depends on the provider and model.

Allowed:
string
enum
Defaults to png

OpenAI GPT Image models only. File format of the generated image.

Allowed:
string
enum
Defaults to auto

OpenAI GPT Image models only. Background transparency. Use transparent with output_format=png for alpha channel.

Allowed:
integer
0 to 100
Defaults to 100

OpenAI GPT Image models only. Compression level (0–100) for JPEG and WebP output.

string

OpenAI only. Optional end-user identifier for abuse monitoring. Ignored by Google Gemini image models.

string
enum

Google Gemini image models only. Output aspect ratio (maps to Gemini aspect_ratio in response_format.image). Ignored by OpenAI models that use size instead. See Gemini API image generation.

Allowed:
boolean

Google only (when supported by the model). Whether to rewrite/enhance the prompt before generation.

string
enum

Google only (when supported by the model). Controls people/face generation. See Gemini API image generation.

Allowed:
string
enum

Google only (when supported by the model). Safety filter threshold.

Allowed:
integer

Optional seed for reproducible generation when supported by the provider and model.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json