ImagesNative Gemini format
Native Gemini format
Gemini image generation
Path Parameters
model*string
Model name, such as gemini-3-pro-image-preview
Request Body
application/json
contents*
Conversation contents. For text-to-image, text only; for image-to-image, put the reference image as inlineData alongside the text in the same parts array
generationConfig?
Generation settings. For image output, responseModalities must include IMAGE
safetySettings?
Safety settings, with a blocking threshold per harm category
systemInstruction?
System instruction, used to constrain style or output requirements
Response Body
application/json
curl -X POST "https://jiniu.ai/v1beta/models/string:generateContent" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "一只戴宇航头盔的柴犬,等距视角" } ] } ], "generationConfig": { "responseModalities": [ "TEXT", "IMAGE" ], "imageConfig": { "aspectRatio": "16:9", "imageSize": "2K" } } }'{
"candidates": [
{
"content": {
"role": "string",
"parts": [
{}
]
},
"finishReason": "string",
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 0,
"candidatesTokenCount": 0,
"totalTokenCount": 0
}
}