API Reference
Gemini Native Image Generation
POST
https://api.tokenbay.io/v1beta/models/{model}:generateContentGenerate 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}:generateContentRequest
schemacontentsarray<object>Required
Gemini-native conversation content containing the image prompt.
contents[].rolestringOptionalContent role, usually user.
contents[].parts[].textstringRequiredImage generation prompt.
generationConfigobjectRequired
Image generation configuration.
generationConfig.responseModalitiesstring[]RequiredRequested response types, such as IMAGE and TEXT.
Response
schemaReturns 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>OptionalText and generated image content blocks.
parts[].textstringOptionalText output when requested.
parts[].inlineDataobjectOptionalGenerated image data and MIME type.
candidates[].finishReasonstringOptionalGeneration stop reason.
candidates[].safetyRatings[]array<object>OptionalSafety evaluation results.
usageMetadataobjectOptionalInput, output, and total token usage.
