API ReferenceImage SeriesGemini FormatPOSTGemini Native Image Generation
Image SeriesPOSTGemini Native Image Generation
API Reference

Gemini Native Image Generation

POSThttps://api.tokenbay.io/v1beta/models/{model}:generateContent

Generate images using the native Gemini generateContent format

Calls a Gemini image model with the native generateContent request and response format. Set responseModalities to request image output.

Gemini Native Image Generation

gemini
POST/v1beta/models/{model}:generateContent

Request

schema
contentsarray<object>Required

Gemini-native conversation content containing the image prompt.

contents[].rolestringOptional

Content role, usually user.

contents[].parts[].textstringRequired

Image generation prompt.

generationConfigobjectRequired

Image generation configuration.

generationConfig.responseModalitiesstring[]Required

Requested response types, such as IMAGE and TEXT.

Response

schema

Returns Gemini candidates. Generated images are included in content parts according to the selected model.

candidates[]array<object>Optional

Generated candidates.

candidates[].content.parts[]array<object>Optional

Text and generated image content blocks.

parts[].textstringOptional

Text output when requested.

parts[].inlineDataobjectOptional

Generated image data and MIME type.

candidates[].finishReasonstringOptional

Generation stop reason.

candidates[].safetyRatings[]array<object>Optional

Safety evaluation results.

usageMetadataobjectOptional

Input, output, and total token usage.

Related