Get a Gemini API key
Use your own key to enable optional AI correction/rewriting in AI Keyboard.
Keep your API key private. Don’t share it publicly or commit it to Git.
Steps
Prerequisite: a Google account.
-
Open https://ai.google.dev/gemini-api
and click
Sign in. - Click
Get API Key in Google AI Studio. - Click
Get API Key. - Check the consent box (
I consent to…) and clickContinue. - On the API keys page, click
Create API Key. - If a popup appears, click
Got it. - Click
Create API key in new project. -
Click
Copyto copy your key. This may be the last time it is shown — save it somewhere secure. - Paste the key into AI Keyboard: Setup wizard → API key, or AI Keyboard → Settings → API key.
Get the key again (rotate)
-
In Google AI Studio, click
Create API keyagain. If it asks for a Google Cloud project, selectingGenerative Language Clientshould work.
事前準備:需要一個 Google 帳號。
-
開啟
https://ai.google.dev/gemini-api
,點選
Sign in登入。 - 點選
Get API Key in Google AI Studio。 - 點選
Get API Key。 - 勾選同意項目(
I consent to…),再點Continue。 - 進入 API keys 頁面後,點選
Create API Key。 - 若跳出提示視窗,點選
Got it。 - 點選
Create API key in new project。 -
點
Copy複製金鑰。這可能是最後一次顯示金鑰的畫面,請務必妥善保存。 - 將金鑰貼到 AI Keyboard:設定精靈 → API key,或 AI Keyboard → Settings → API key。
再次取得(輪替)
-
在 Google AI Studio 再次點
Create API key。若要求選擇 Google Cloud 專案, 選Generative Language Client通常即可。
准备:需要一个 Google 账号。
-
打开
https://ai.google.dev/gemini-api
,点击
Sign in登录。 - 点击
Get API Key in Google AI Studio。 - 点击
Get API Key。 - 勾选同意选项(
I consent to…),然后点击Continue。 - 进入 API keys 页面后,点击
Create API Key。 - 如果出现提示弹窗,点击
Got it。 - 点击
Create API key in new project。 -
点击
Copy复制密钥。这可能是最后一次显示密钥的页面,请务必安全保存。 - 把密钥粘贴到 AI Keyboard:设置向导 → API key,或 AI Keyboard → Settings → API key。
再次获取(轮换)
-
在 Google AI Studio 再次点击
Create API key。如果要求选择 Google Cloud 项目, 选择Generative Language Client通常即可。
事前準備:Google アカウントが必要です。
-
https://ai.google.dev/gemini-api
を開き、
Sign inからログインします。 Get API Key in Google AI Studioをクリックします。Get API Keyをクリックします。I consent to…にチェックを入れ、Continueをクリックします。- API keys ページで
Create API Keyをクリックします。 - ポップアップが出たら
Got itをクリックします。 Create API key in new projectをクリックします。-
Copyをクリックしてキーを取得します。表示される最後のタイミングの可能性があるため、 必ず安全な場所に控えてください。 - AI Keyboard に貼り付けます:セットアップ → API key、または AI Keyboard → Settings → API key。
もう一度取得(ローテーション)
-
Google AI Studio で再度
Create API keyをクリックします。Google Cloud Projects を 求められた場合は、Generative Language Clientを選択すれば OK です。
References
- Source guide: monomonotech.jp — Gemini APIの無料APIキーを取得する方法
- Official Gemini API page: https://ai.google.dev/gemini-api