> ## 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

> Connect WednesdayAI to Gemini via an AI Studio API key or a Vertex AI service account.

# Google

WednesdayAI supports Google's Gemini family. Authenticate with an AI Studio API key (easiest) or Vertex AI (for GCP-native deployments).

## AI Studio API key

Create a key at [aistudio.google.com](https://aistudio.google.com) and onboard:

```bash theme={"dark"}
openclaw onboard --auth-choice gemini-api-key
```

Or set the key on the gateway host:

```bash theme={"dark"}
echo 'GEMINI_API_KEY=AIza...' >> ~/.openclaw/.env
```

Rotation variables (`GEMINI_API_KEYS`, `GEMINI_API_KEY_1`, `GEMINI_API_KEY_2`) are honoured, and the bare `GOOGLE_API_KEY` is included as a fallback.

<Note>
  `GOOGLE_API_KEY` fallback support may vary by version — verify it is still recognised in your deployment by checking the core release notes.
</Note>

## Gemini CLI (OAuth)

WednesdayAI supports OAuth authentication via the [Gemini CLI](https://github.com/google-gemini/gemini-cli). This is an active primary auth path — no API key required:

```bash theme={"dark"}
openclaw onboard --auth-choice google-gemini-cli
# or
openclaw models auth login --provider google-gemini-cli
```

This opens a browser for the OAuth flow and stores the token in the auth profile store. The Gemini CLI must be installed first (`npm install -g @google/gemini-cli`).

<Note>
  Some users have reported Google account restrictions when using third-party clients. Review Google's terms of service and consider using a non-critical account.
</Note>

## Vertex AI

For production GCP deployments, use Application Default Credentials (ADC) via the `google-vertex` provider.

**Preferred — user ADC:**

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

**Alternative — service account:**

```bash theme={"dark"}
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
```

The service account needs the **Vertex AI User** (`roles/aiplatform.user`) role.

<Note>
  `GOOGLE_CLOUD_PROJECT` is optional — it defaults to the project in your service account credentials or your active `gcloud` configuration.
</Note>

## Selecting a model

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

Use the `google/` prefix for AI Studio and `google-vertex/` for Vertex. Run `openclaw models list --all` for the catalog and `openclaw models status` for what your auth can reach.

<Note>
  WednesdayAI also bundles `google-antigravity` as an unofficial OAuth provider. Some users have reported Google account restrictions when using third-party clients — review Google's terms and use a non-critical account if you enable it.
</Note>

## Environment variables

| Variable                                  | Description                                                                                                                                                 |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GEMINI_API_KEY`                          | Primary AI Studio API key                                                                                                                                   |
| `GEMINI_API_KEYS`                         | Comma-separated key list for rotation                                                                                                                       |
| `GEMINI_API_KEY_1`, `GEMINI_API_KEY_2`, … | Individual numbered rotation keys                                                                                                                           |
| `OPENCLAW_LIVE_GEMINI_KEY`                | Single-key live override — takes priority over all other Gemini keys and bypasses rotation entirely; applies to both `google` and `google-vertex` providers |
| `GOOGLE_API_KEY`                          | Fallback if no `GEMINI_*` key is set                                                                                                                        |
| `GOOGLE_APPLICATION_CREDENTIALS`          | Path to Vertex AI service-account JSON                                                                                                                      |
| `GOOGLE_CLOUD_PROJECT`                    | GCP project ID for Vertex AI (optional — defaults to project in credentials or `gcloud` config)                                                             |

## Troubleshooting

<AccordionGroup>
  <Accordion title="API key rejected">
    Ensure the key was created in AI Studio and that the Generative Language API is enabled for the project.
  </Accordion>

  <Accordion title="Vertex AI permission denied">
    The service account is missing the **Vertex AI User** role. Add it in IAM and Admin.
  </Accordion>

  <Accordion title="Model not found">
    Not all Gemini models are available in all regions. On Vertex, try a different region or check the Vertex AI model availability table.
  </Accordion>
</AccordionGroup>
