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

Generate a 2K asset

The verified 2K result returned a 2048 × 2048 JPEG:

Queue a 1K task

Use the identical body with imageSize: "1K" and the asynchronous suffix. The live task returned HTTP 202, reached in_progress, and completed after four polls with its Gemini response under result.

Edit without changing the subject

Send the instruction and source bytes as adjacent parts. Scan the returned parts rather than assuming the image is at index zero; one verified edit returned model text before the JPEG.

Test this model online

The embedded OpenAPI operation uses the fixed gemini-3.1-flash-image:generateContent path. Confirm imageSize, enter a development key, and run the request directly on this page.
The selected size determines the billable tier. 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-3.1-flash-image"

responseId
string

Provider response identifier.

Example:

"response_example"

createTime
string<date-time>

Creation time when supplied by the selected model channel.