Generate Content

POST/v1beta/models/{model}:{GenerateContentType}
Generate content using the Google Gemini-compatible request format.

Path Parameters

model:requiredstring

Model identifier used for this request.

Examplegemini-3.5-flash
GenerateContentType:requiredstring

Gemini-compatible generation action.

AllowedgenerateContentstreamGenerateContent
ExamplegenerateContent

Query Parameters

key:optionalstring

Optional request parameter.

Example{{key}}

Request Body

application/json
contents:requiredarray

Gemini-compatible content payload.

Response

200

A successful request returns a JSON response. The complete example is shown in the code panel.