Skip to main content
POST
Generate an image with gemini-2.5-flash-image

Generate synchronously

A successful live response contained one text part followed by a PNG image part:

Submit asynchronously

Use the same body with :asyncGenerateContent. HTTP 202 returns a task ID; retrieve it from /v1/tasks/{task_id}. The verified task moved through in_progress and completed with a 1024 × 1024 PNG.

Decode every image part

The image may not be the first part, even in a successful response.

Test this model online

This page includes the real OpenAPI Try it form for the fixed gemini-2.5-flash-image path. Enter a development key, review the request body, and send the synchronous call without leaving this example.
The request is billable. Mintlify shows the entered key in its generated cURL; do not share authenticated screenshots.

Authorizations

Authorization
string
header
required

YingTu API key.

Body

application/json
contents
Message · object[]
required

Prompt and optional source image.

Minimum array length: 1
generationConfig
Output settings · object

Response

Complete Gemini response

candidates
object[]
required
usageMetadata
object
modelVersion
string

The model version that produced the response.

Example:

"gemini-2.5-flash-image"

responseId
string

Provider response identifier.

Example:

"response_example"

createTime
string<date-time>

Creation time when supplied by the selected model channel.