cURL
curl --request POST \ --url http://sandbox.mintlify.com/v1beta/models/{model}:generateContent \ --header 'Content-Type: application/json' \ --header 'x-goog-api-key: <api-key>' \ --data ' { "contents": [ { "role": "user", "parts": [ { "text": "请总结这段内容" } ] } ] } '
{ "candidates": [ { "content": { "role": "model", "parts": [ { "text": "这里是总结结果。" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 24, "candidatesTokenCount": 36, "totalTokenCount": 60 } }
Generates synchronous text or multimodal output with Gemini.
Gemini 官方文档把图片理解、图片生成和图片编辑都建立在 generateContent 这一套接口之上。
generateContent
inlineData
candidates[].content.parts[]
Gemini model name.
"gemini-2.5-pro"
Show child attributes
Successful Gemini content response