Skip to main content
POST
Generate an image synchronously
调用方能够等待最终 Gemini 响应时使用此方法。 共享 schema 包含整个家族的尺寸枚举;发送 Try it 前,请在对应模型参数页确认该值有效。

比较模型限制

真实调用前确认价格和分辨率。

授权

Authorization
string
header
必填

YingTu API key.

路径参数

model
enum<string>
必填

Current Nano Banana model ID.

可用选项:
gemini-2.5-flash-image,
gemini-3.1-flash-lite-image,
gemini-3.1-flash-image,
gemini-3-pro-image

请求体

application/json
contents
Prompt and input · object[]
必填

Messages sent to the model.

Minimum array length: 1
tools
object[]

Optional Gemini tools. Availability depends on the selected image model.

toolConfig
object

Configuration for tools declared in tools.

safetySettings
object[]
systemInstruction
object
cachedContent
string

Optional cached content resource name when supported by the selected model.

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.