Gemini 1.5 Flash-8B is now available for production use!
Learn more
Send feedback
Gemini API quickstart
Stay organized with collections
Save and categorize content based on your preferences.
This quickstart shows you how to get started with the Gemini API using the SDK
of your choice.
Python
Node.js
Go
Dart (Flutter)
Android
Swift
Web
REST
Prerequisites
Install the Gemini API SDK
Set up your API key
To use the Gemini API, you'll need an API key. If you don't already have one,
create a key in Google AI Studio.
Get an API key from Google AI Studio
Then, configure your key.
Import the library
Make your first request
Use the
generateContent
method
to generate text.
What's next
Now that you're set up to make requests to the Gemini API, you can use the full
range of Gemini API capabilities to build your apps and workflows. To get
started with Gemini API capabilities, see the following guides:
For in-depth documentation of Gemini API methods and request parameters, see the
guides in the API reference .
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-28 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-28 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-28 UTC."],[],[]]