Skip to main content
POST
Generate content

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

model
enum<string>
required

The model name used for generation.

Available options:
gemini-3.1-pro-preview,
gemini-3.1-flash-image-preview,
gemini-3.1-flash-lite-preview,
gemini-3-pro-preview,
gemini-3-pro-image-preview,
gemini-3-flash-preview,
gemini-2.5-pro,
gemini-2.5-flash,
gemini-2.5-flash-lite,
gemini-2.0-flash

Body

application/json
contents
object[]
required

The current conversation contents with the model.

Minimum array length: 1
Example:
systemInstruction
object

System instruction set by the developer.

generationConfig
object

Configuration options for model generation and output.

tools
object[]

A list of tools the model can use to generate a response.

toolConfig
object

Tool configuration for any tools specified in the request.

safetySettings
object[]

A list of safety settings used to block unsafe content.

Response

Content generated successfully

candidates
object[]
usageMetadata
object
modelVersion
string