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 to use for generation.

Available options:
gemini-3.1-pro-preview,
gemini-3.1-flash-image,
gemini-3.1-flash-lite-preview,
gemini-3-pro-preview,
gemini-3-pro-image,
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 content of the current conversation with the model.

Minimum array length: 1
Example:
systemInstruction
object

Developer set system instruction.

generationConfig
object

Configuration options for model generation and outputs.

tools
object[]

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

toolConfig
object

Tool configuration for any tools specified in the request.

safetySettings
object[]

A list of unique SafetySetting instances for blocking unsafe content.

Response

Content generated successfully

candidates
object[]
usageMetadata
object
modelVersion
string