Authorizations
All API endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Path Parameters
Model nameThe examples use
gemini-2.5-pro, which you can replace with other supported Gemini models:gemini-2.5-flash- Gemini 2.5 Flashgemini-2.5-pro- Gemini 2.5 Progemini-2.5-flash-lite- Gemini 2.5 Flash Litegemini-2.5-pro-thinking- Gemini 2.5 Pro Deep Thinking
Generation method (recommended:
generateContent for quick start):generateContent: Wait for complete response and return at oncestreamGenerateContent: Stream response, return content in chunks
generateContent, streamGenerateContentBody
List of conversation contentsMinimum 1 message requiredExample:
Generation configuration (optional)
Safety settings (optional)
Response
List of candidate responses
Prompt feedback information
Usage statistics