POST /v1/images/generations
Generates one or more images from a text description. The gateway forwards the request to the target provider (e.g. OpenAI DALL·E, Stability AI, or others) and returns image data as URLs or base64-encoded strings.Request headers
The provider to route the request to (e.g.
openai, stability-ai). Required when not using a config.Your provider API key.
A JSON config object or config ID that defines routing, fallbacks, retries, and more.
A virtual key ID from Portkey Cloud.
Request body
The image generation model to use (e.g.
dall-e-3, dall-e-2).A text description of the desired image. For
dall-e-3, the maximum length is 4000 characters; for dall-e-2, 1000 characters.The number of images to generate.
dall-e-3 supports only n=1; dall-e-2 supports up to 10.The dimensions of the generated images. Supported values depend on the model:
dall-e-2:256x256,512x512,1024x1024dall-e-3:1024x1024,1792x1024,1024x1792
The quality of the image.
dall-e-3 supports standard and hd. dall-e-2 ignores this field.The visual style of the image.
dall-e-3 supports vivid (hyper-real) and natural (photorealistic). dall-e-2 ignores this field.The format in which to return the image. One of
url (a temporary URL valid for 60 minutes) or b64_json (base64-encoded PNG).A unique identifier for the end user, used for monitoring and abuse detection.
Response
Unix timestamp of when the images were created.
An array of generated image objects.