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

# Google (Gemini)

# Google (Gemini)

Google provides the Gemini model family for text, vision, and reasoning. WednesdayAI supports two authentication paths: a `GEMINI_API_KEY` for direct API access, and the Google Gemini CLI OAuth flow for users who prefer browser-based sign-in.

## Requirements

* A Gemini API key from [aistudio.google.com](https://aistudio.google.com/app/apikey), **or**
* A Google account with access to Gemini (for OAuth via `google-gemini-cli`)

## Quickstart

### API key

```bash theme={"dark"}
wednesdayai onboard --auth-choice gemini-api-key
# or non-interactive
wednesdayai onboard --gemini-api-key "$GEMINI_API_KEY"
```

### Google Gemini CLI OAuth

```bash theme={"dark"}
wednesdayai onboard --auth-choice google-gemini-cli
```

This opens a browser-based OAuth flow. Keep the terminal open until it completes.

After either method, verify the setup:

```bash theme={"dark"}
wednesdayai models status
```

## Configuration

### Environment variable

```bash theme={"dark"}
export GEMINI_API_KEY="AIza..."
```

WednesdayAI reads `GEMINI_API_KEY` automatically and enables the `google` provider.

### Config snippet

```json5 theme={"dark"}
{
  env: { GEMINI_API_KEY: "AIza..." },
  agents: {
    defaults: {
      model: { primary: "google/gemini-3-pro-preview" },
    },
  },
}
```

### Provider settings

| Setting | Value |
| - | - |
| Provider ID | `google` |
| Base URL | `https://generativelanguage.googleapis.com/v1beta` |
| API | `google-generative-ai` |
| Auth env var | `GEMINI_API_KEY` |
| Default model (onboarding) | `gemini-3-pro-preview` |

## Available models

The `google` provider includes all current Gemini models. Key models:

| Model ID | Name | Context | Notes |
| - | - | - | - |
| `gemini-3-pro-preview` | Gemini 3 Pro Preview | 1M | Default; reasoning; vision |
| `gemini-3-flash-preview` | Gemini 3 Flash Preview | 1M | Reasoning; vision |
| `gemini-2.5-pro` | Gemini 2.5 Pro | 1M | Reasoning; vision |
| `gemini-2.5-flash` | Gemini 2.5 Flash | 1M | Reasoning; vision |
| `gemini-2.5-flash-lite` | Gemini 2.5 Flash Lite | 1M | Reasoning; vision |
| `gemini-2.0-flash` | Gemini 2.0 Flash | 1M | Vision |
| `gemini-2.0-flash-lite` | Gemini 2.0 Flash Lite | 1M | Vision |
| `gemini-1.5-pro` | Gemini 1.5 Pro | 1M | Vision |
| `gemini-1.5-flash` | Gemini 1.5 Flash | 1M | Vision |
| `gemini-1.5-flash-8b` | Gemini 1.5 Flash 8B | 1M | Vision |

Use model IDs as `google/<model-id>` (example: `google/gemini-2.5-pro`).

## Vertex AI

For enterprise Vertex AI access, use the `google-vertex` provider. This uses Application Default Credentials (ADC) via `gcloud`:

```bash theme={"dark"}
gcloud auth application-default login
```

WednesdayAI resolves Vertex credentials via the ADC chain — no `GEMINI_API_KEY` is needed. The base URL is `https://{location}-aiplatform.googleapis.com` and uses the `google-vertex` API backend.

### google-vertex config snippet

```json5 theme={"dark"}
{
  models: {
    providers: {
      "google-vertex": {
        // models populated by pi-ai built-in catalog
        // auth resolved from gcloud ADC
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "google-vertex/gemini-2.5-pro" },
    },
  },
}
```

Available `google-vertex` models mirror most `google` models: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-2.0-flash`, `gemini-2.0-flash-lite`, `gemini-1.5-pro`, `gemini-1.5-flash`, `gemini-1.5-flash-8b`, `gemini-3.1-pro-preview`.

## Troubleshooting

**401 Unauthorized / API key not valid**

* Verify your API key starts with `AIza` and is copied in full.
* Re-run onboarding: `wednesdayai onboard --auth-choice gemini-api-key`.
* Ensure the Generative Language API is enabled in your Google Cloud project.

**OAuth token refresh failed**

* Re-run `wednesdayai onboard --auth-choice google-gemini-cli` to refresh the OAuth token.

**Model ID not found**

* Use `wednesdayai models list` to see available model IDs.
* WednesdayAI normalizes some model IDs: `gemini-3-pro` → `gemini-3-pro-preview`, `gemini-3-flash` → `gemini-3-flash-preview`.

**Vertex AI: no credentials**

* Run `gcloud auth application-default login` to authenticate, or set `GOOGLE_APPLICATION_CREDENTIALS` to a service account key file.

## Related

* [Model providers](https://docs.wednesdayai.dev/next/developers/concepts/model-providers.md)
* [Models](https://docs.wednesdayai.dev/next/developers/concepts/models.md)
* [Model failover](https://docs.wednesdayai.dev/next/developers/concepts/model-failover.md)
* [Gateway configuration](https://docs.wednesdayai.dev/next/admin/gateway/configuration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.