Android Studio で、[File](macOS では [Android Studio])> [Settings] > [Tools] > [Gemini] に移動して、Gemini API キーを入力します。
Gemini in Android Studio を再起動して、エージェント モードからさらに優れた回答を得られるようにします。
個人用 API キーに関連付けられた Gemini API の使用には追加料金が適用されるため、Gemini API キーを保護してください。AI Studio で Gemini API キーの使用状況をモニタリングするには、[Get API Key] > [Usage & Billing] を使用します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-31 UTC。"],[],[],null,["# Add your own Gemini API key\n\n| **Note:** The ability to add your own API key is only applicable if you're using Gemini's free tier; business users have access to Gemini 2.5 Pro by default.\n\nThe default Agent mode in Android Studio has a no-cost daily quota with a\nlimited context window. To expand the context window, you can add your own\nGemini API key to take advantage of up to 1 million tokens with Gemini 2.5 Pro. \n\nA larger context window lets you send more instructions, code, and attachments\nto Gemini, leading to even higher quality responses. This is especially useful\nwhen working with agents because the larger context provides Gemini 2.5 Pro with\nthe ability to reason about complex or long-running tasks.\n\nTo get an API key:\n\n1. Sign in to [Google AI Studio](https://aistudio.google.com/) and get a key by clicking on the Get API key button.\n2. In Android Studio, go to **File (Android Studio** on macOS) **\\\u003e Settings \\\u003e\n Tools \\\u003e Gemini** to enter your Gemini API key.\n3. Relaunch Gemini in Android Studio and get even better responses from Agent mode.\n\nBe sure to safeguard your Gemini API key because\n[additional charges](https://ai.google.dev/gemini-api/docs/pricing) apply for\nGemini API usage associated with a personal API key. You can monitor your Gemini\nAPI key usage in AI Studio through **Get API Key \\\u003e Usage \\& Billing**."]]