{model}
mode: "async"
Prefer: respond-async
GET /v1beta/models/{model}:getTask
POST /v1beta/models/{model}:streamGenerateContent
Authorization: Bearer ********************
{ "contents": [ { "role": "user", "parts": [ {"text": "一张海边日落的产品海报,干净构图,不要文字"} ] } ], "generationConfig": { "responseFormat": { "image": { "aspectRatio": "16:9", "imageSize": "2K" } } }, "response_format": "b64_json" }
curl --location 'https://feichuangtech.cn/v1beta/models/gemini-3.1-flash-image:generateContent' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ {"text": "一张海边日落的产品海报,干净构图,不要文字"} ] } ], "generationConfig": { "responseFormat": { "image": { "aspectRatio": "16:9", "imageSize": "2K" } } }, "response_format": "b64_json" }'
response_format
b64_json
candidates[0].content.parts[0].inlineData
url
candidates[0].content.parts[0].text
usageMetadata
{ "candidates": [ { "content": { "parts": [ {"inlineData": {"mimeType": "image/png", "data": "iVBORw0KGgo...(Base64 示例已截断)"}} ], "role": "model" }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 0, "candidatesTokenCount": 0, "totalTokenCount": 0 } }