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

Response Format

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

Supported Models


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

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


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:
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

Supported Aspect Ratios & Resolutions

These match the aspect ratios and resolutions supported by Google’s Gemini image models.

Choosing an Endpoint

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