Gemini API Key 獲取方式有兩種
一是透過 Google AI Studio 快速申請免費金鑰,
二是在 Google Cloud Console 建立專案並啟用 Gemini API 後生成專屬 API Key
方式一:Google AI Studio 快速申請
- 登入 Google 帳號後,進入 Google AI Studio 平台.
- 點選「Get API Key」後,依指示建立金鑰,系統會直接產生一組 API Key,可用於一般開發與免費額度測試.
- 此方式不用綁定雲端帳單,適合試用、教學或簡易應用場景,但部分進階權限與配額需付費升級.
https://aistudio.google.com/
方式二:Google Cloud Console 建立專案
- 登入 Google Cloud Console,點擊「新增專案」並命名.
- 在「API 和服務」>「憑證」頁面點選「建立憑證」,選擇「API 金鑰」.
- 須在新專案中啟用 Gemini API,方能產生對應金鑰.
- 此方式可自訂權限、配置安全機制、配合計費帳戶使用,適合需要更大配額或正式商業應用.
以上兩種申請流程都能取得 Gemini API Key,但功能限制與配額有所不同。
https://cloud.google.com/?hl=zh-TW
在寫安卓 APP 時目前因為權限限制,還是需要 Google Cloud Console 付費版
其他像是 web 就不用