Skip to main content
Generate images from text prompts at up to 50% off official pricing using Flatkey’s /v1/images/generations endpoint. It is fully compatible with the OpenAI images API, so you can use gpt-image-2 and other supported models with the OpenAI SDK or a direct REST call.

Supported image models

See the Model Directory for the full image model list.

Quick start with the OpenAI SDK

With curl

Parameters

model
string
required
The image model to use. E.g. gpt-image-2, gemini-3-pro-image.
prompt
string
required
A text description of the image to generate. More detailed prompts produce better results.
n
integer
Number of images to generate (default: 1). Maximum depends on the model.
size
string
Image dimensions. Common values: "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792". Support varies by model.
response_format
string
"url" (default) returns a temporary URL. "b64_json" returns base64-encoded image data.

Response format

URLs returned from image generation are temporary and expire after a short period. Download and store images you want to keep.

Writing effective prompts

  • Be specific about style: photorealistic, oil painting, watercolor, 3D render
  • Include lighting details: golden hour, studio lighting, dramatic shadows
  • Specify composition: close-up, wide angle, bird’s eye view, portrait orientation
  • Add quality modifiers: highly detailed, 4K, professional photography