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:requiredobject

Gemini-compatible content payload.

Example[{"parts":[{"text":"Write a story about a magic backpack."}]}]

Response

200

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

Compatibility References

Use these external references to review additional parameters supported by compatible provider formats.