> ## Documentation Index
> Fetch the complete documentation index at: https://alexcode.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding your API Key for Gemini (Google)

> Learn how to get your API Key

To use Gemini's models (Gemini 2.5 Pro, Gemini 2.0 Flash) in Xcode with Alex Sidebar without paying a subscription for Alex, you'll need a Google AI Studio API key.

Here's how to get one:

1. Visit [Google Cloud Console](https://aistudio.google.com)

2. Create an account or sign in if you already have one

3. Go to the (API Keys page)([https://aistudio.google.com/apikey](https://aistudio.google.com/apikey))

4. Click "Create API Key" and select a project to enable it for

5. Copy the API key - make sure to save it somewhere secure

6. In Alex Sidebar:
   * Open Settings (⚙️)
   * Select "Models" at the bottom of the page
   * Paste your AI Studio API key in the Gemini text field

<Note>
  Keep your API key secure and never share it publicly. If you suspect your key has been compromised, you should immediately rotate it in the Google Cloud Console.
</Note>

## Usage & Billing

* Google Cloud bills based on the number of tokens used
* You can monitor your usage in the Google Cloud Console
* Set up billing alerts to avoid unexpected charges
* New accounts typically come with some free credits to get started

For more information about Gemini's pricing and usage, visit [Google Cloud's pricing page](https://cloud.google.com/vertex-ai/pricing#gemini).

<Note>
  Enabling Gemini does not give you access to all of Alex's features. To enable codebase indexing, follow the [VoyageAI API Key Instructions](/get-started/adding-voyage-ai-api-key), and to enable Thinking mode, follow the [FireworksAI API Key Instructions](/get-started/adding-fireworks-ai-api-key).
</Note>

<Note>
  For other models like GPT 4o and the o-series (o1, o3, o4-mini), follow the [OpenAI API Key Instructions](/get-started/adding-openai-ai-api-key). For Anthropic's models (Claude 3.5 Sonnet, Claude 3.7 Sonnet) follow the [Anthropic API Key Instructions](/get-started/adding-claude-anthropic-ai-api-key).
</Note>
