Skip to main content
Requesty supports image generation through two different endpoints: the dedicated Images API (/v1/images/generations and /v1/images/edits) for standard image workflows, and the Chat Completions API (/v1/chat/completions) for models that return images alongside text.
Browse image models in the Requesty Console.

Images API (/v1/images/generations)

The dedicated images endpoint follows the OpenAI Images API format and is the recommended way to generate images with supported models.

Request Format

Parameters

ParameterTypeRequiredDescription
modelstringYesThe model to use for image generation
promptstringYesA text description of the desired image
nintegerNoNumber of images to generate (default: 1)
sizestringNoImage dimensions (e.g., 1024x1024, 1536x1024, 1024x1536)
qualitystringNoImage quality (auto, high, medium, low)
response_formatstringNoOutput delivery format: url or b64_json (default: url)
backgroundstringNoBackground type: auto, transparent, or opaque
output_formatstringNoFile format: png, jpeg, or webp

Response Format

The response returns a data array containing the generated images:
When response_format is set to b64_json:

Supported Models

ModelDescription
azure/openai/gpt-image-1OpenAI’s GPT Image 1 model via Azure
azure/openai/gpt-image-1.5OpenAI’s GPT Image 1.5 model via Azure

Image Edits API (/v1/images/edits)

The image edits endpoint applies a text prompt to one or more input images. It is OpenAI compatible, so you can use client.images.edit() directly.

Request Format

The endpoint accepts both multipart/form-data (the OpenAI SDK default for file uploads) and application/json (with image references as base64 data URLs or file IDs).
JSON variant:

Parameters

ParameterTypeRequiredDescription
modelstringYesThe model to use for image editing
promptstringYesA text description of the desired edit
image[] / imagesfile[] or ImageReference[]YesThe input images. Use image[] form fields for file uploads, or images with file_id or image_url in JSON. Up to 16 images.
maskfile or ImageReferenceNoOptional mask. Transparent pixels mark the area that will be regenerated.
nintegerNoNumber of edited images to generate (default: 1)
sizestringNoOutput size (auto, 1024x1024, 1536x1024, 1024x1536)
qualitystringNoImage quality (auto, high, medium, low)
input_fidelitystringNoFidelity to the input image (high or low)
backgroundstringNoBackground type (auto, transparent, opaque)
output_formatstringNoFile format (png, jpeg, webp)
output_compressionintegerNoCompression level (0 to 100) for webp or jpeg
response_formatstringNoOutput delivery format (url or b64_json)

Python Example

JavaScript/TypeScript Example

Masked Edits

Pass a mask image to restrict edits to a specific region. Transparent pixels in the mask mark the area that will be regenerated.

Supported Models

ModelDescription
azure/openai/gpt-image-1OpenAI’s GPT Image 1 model via Azure
azure/openai/gpt-image-1.5OpenAI’s GPT Image 1.5 model via Azure

Chat Completions API (/v1/chat/completions)

Google Gemini image models generate images natively through the standard chat completions endpoint. Images are returned alongside text in the response, and you can control aspect ratio and resolution with the image_config parameter.

Request Format

Parameters

All standard chat completions parameters apply. The additional image_config object controls the generated image output:
ParameterTypeRequiredDescription
image_configobjectNoControls the aspect ratio and resolution of generated images
image_config.aspect_ratiostringNoAspect ratio of the output image. Supported values: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
image_config.image_sizestringNoResolution tier. Supported values: 1K (default), 2K, 4K
When image_config is omitted, the model defaults to a 1:1 aspect ratio at 1K resolution.

Response Format

The response includes both the standard text content and an array of generated images:

Python Example

JavaScript/TypeScript Example

Supported Models

ModelDescription
vertex/google/gemini-2.5-flash-image-previewGemini 2.5 Flash image generation via Vertex AI
vertex/gemini-3.1-flash-image-previewGemini 3.1 Flash image generation via Vertex AI
vertex/google/gemini-3-pro-image-previewGemini 3 Pro image generation via Vertex AI

Supported Aspect Ratios & Resolutions

Aspect Ratio1K2K4K
1:11024×10242048×20484096×4096
2:3848×12641696×25283392×5056
3:21264×8482528×16965056×3392
3:4896×12001792×24003584×4800
4:31200×8962400×17924800×3584
4:5928×11521856×23043712×4608
5:41152×9282304×18564608×3712
9:16768×13761536×27523072×5504
16:91376×7682752×15365504×3072
21:91584×6723168×13446336×2688
These match the aspect ratios and resolutions supported by Google’s Gemini image models.

Choosing an Endpoint

FeatureImages GenerateImages EditChat Completions API
Endpoint/v1/images/generations/v1/images/edits/v1/chat/completions
OpenAI SDK supportclient.images.generate()client.images.edit()client.chat.completions.create()
Accepts input imagesNoYes (up to 16)Yes (as chat content)
Mask supportNoYesNo
Text + image responseNoNoYes
Conversational contextNoNoYes
Aspect ratio controlNoNoYes (image_config.aspect_ratio)
Resolution controlVia sizeVia sizeYes (image_config.image_size: 1K, 2K, 4K)
Background controlYesYesNo
Output format controlYes (png, jpeg, webp)Yes (png, jpeg, webp)No
Image generation models may have different pricing compared to text models. Check the model library for specific pricing information.

Limitations

  • Image size and resolution depend on the specific model capabilities
  • Some models may have content filtering or safety restrictions
  • Response size limits apply to the combined text and image data
Last modified on May 26, 2026