Skip to main content
POST
Gemini generateContent
Gemini’s official docs use the same generateContent family for image understanding, image generation, and image editing.
  • Images can be passed as inlineData or via the Files API
  • Small assets are commonly sent inline, while larger or reusable assets are better handled through Files API references
  • This path is suitable for image QA, OCR-assisted analysis, UI understanding, and multimodal reasoning
  • Native image generation and image editing still use generateContent
  • Text and generated images both come back through candidates[].content.parts[]
  • Google’s official docs note that generated images include a SynthID watermark

Authorizations

x-goog-api-key
string
header
required

Path Parameters

model
string
required

Gemini model name.

Example:

"gemini-2.5-pro"

Body

application/json
contents
object[]
required
systemInstruction
object
generationConfig
object
safetySettings
object[]
tools
object[]

Response

Successful Gemini content response

candidates
object[]
usageMetadata
object