v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
GenAI Integration

Generate image (Gemini format)

For Imagen models, use the :predict suffix (e.g., imagen-3.0-generate-001:predict). For Gemini models, use :generateContent with generationConfig.responseModalities: ["IMAGE"] in the request body.

post/genai/v1beta/models/{model}:predict

Path parameters

modelstring required

Model name with action suffix. For Imagen models, use :predict (e.g., imagen-3.0-generate-001:predict). For Gemini models with image generation, use :generateContent (e.g., gemini-1.5-pro:generateContent).

Request body

modelstring

Model field for explicit model specification

cachedContentstring

Cached content resource name

labelsobject

Labels for the request

fallbacksstring[]

Response

Successful response. Returns JSON with generated image data in candidates[0].content.parts[0].inlineData. When streaming, events are sent via Server-Sent Events (SSE).

modelVersionstring

The model version used to generate the response

responseIdstring

Response ID for identifying each response (encoding of event_id)

createTimestring date-time

Timestamp when the request was made to the server