Skip to main content
POST
cURL

Query Parameters

key
string
required

API Key

Body

application/json
contents
object[]
required

Array of conversation turns. Each turn has a role and parts. A part can be a text prompt, or an inline_data image (base64). To use a reference image, include both a text part and an inline_data part in the same parts array.

Example:
generationConfig
object
required

Response

Image generated successfully

candidates
object[]
usageMetadata
object