Skip to main content
POST

Authorizations

Authorization
string
header
required

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

Body

application/json
contents
object[]
required

Current conversation content. A single-round request usually has only one Content; multi-round conversations include historical and latest requests in order.

Minimum array length: 1
systemInstruction
object

System commands set by developers should currently use the plain text part.

tools
object[]

A list of tools that the model can use, such as function calls or code execution.

toolConfig
object

Tool call configuration.

safetySettings
object[]

Security filtering rules; the same category can be configured at most once, overriding the default threshold for that category.

generationConfig
object

Generate and output configurations.

cachedContent
string

The cached content name to use as context, in the format cachedContents/{cachedContent}.

serviceTier
string

Request service level.

store
boolean

Whether to log this request; if set, it will override the project-level log configuration.

Response

200 - application/json

Gemini API: models.generateContent normal response. Fully inline and suitable for importing into Apifox.

candidates
object[]

A list of candidate responses generated by the model.

promptFeedback
object

Feedback when prompt words are blocked or filtered.

usageMetadata
object

Word usage statistics.

modelVersion
string

The actual model version used.

responseId
string

Response unique ID.