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

生成 2K 图片

提交 1K 异步任务

imageSize 改为 1K,并使用 :asyncGenerateContent。实测提交返回 HTTP 202, 任务在第四次查询时完成。完成响应位于 result 中,结构与同步响应一致。 图片编辑同样使用 contents[].parts[];某次编辑响应先返回文字,再返回 JPEG, 因此解析器不能固定读取 parts[0]

在线测试

嵌入的 OpenAPI operation 已固定到 gemini-3.1-flash-image:generateContent。确认 imageSize、填入开发凭证后, 可直接在当前示例页发送请求。
所选尺寸决定真实计费档位。Mintlify 会在生成的 cURL 中显示已输入的 Key,请勿分享带凭证的截图。

授权

Authorization
string
header
必填

YingTu API key.

请求体

application/json
contents
Message · object[]
必填

Prompt and optional source image.

Minimum array length: 1
generationConfig
Output settings · object

响应

Complete Gemini response

candidates
object[]
必填
usageMetadata
object
modelVersion
string

The model version that produced the response.

示例:

"gemini-3.1-flash-image"

responseId
string

Provider response identifier.

示例:

"response_example"

createTime
string<date-time>

Creation time when supplied by the selected model channel.