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

# Google AI

> Google AI provides the Gemini model family (Gemini 3.1 Pro, Gemini 3 Flash, Gemini 3.1 Flash-Lite, and prior 2.x models) through both an OpenAI-compatible endpoint and native Google AI Studio API.

Google AI offers 54 models through Lava's AI Gateway, supporting Chat Completions, Chat Completions (Gemini Native), Chat Completions (Gemini Streaming). Authentication uses `Authorization: Bearer` or `x-goog-api-key`. See the [Google AI API docs](https://ai.google.dev/gemini-api/docs) for provider-specific parameters.

<Info>Supports both **managed** (Lava's API keys) and **unmanaged** (bring your own credentials) mode.</Info>

## Quick Start

```typescript theme={null}
const response = await fetch('https://api.lava.so/v1/forward?u=https%3A%2F%2Fgenerativelanguage.googleapis.com%2Fv1beta%2Fopenai%2Fchat%2Fcompletions', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${forwardToken}`,
  },
  body: JSON.stringify({
    model: 'gemini-3.5-flash',
    messages: [{ role: "user", content: "Hello!" }],
  }),
});
```

## Chat Completions

**Target URL:** `https://generativelanguage.googleapis.com/v1beta/openai/chat/completions`

|                  |                                          |
| ---------------- | ---------------------------------------- |
| **Auth Header**  | `Authorization: Bearer`                  |
| **Content Type** | `application/json`                       |
| **Streaming**    | Yes (set `stream: true` in request body) |

| Model                                | Input / 1M tokens | Output / 1M tokens |
| ------------------------------------ | ----------------- | ------------------ |
| gemini-3.1-pro-preview               | \$2.00            | \$12.00            |
| models/gemini-3.1-pro-preview        | \$2.00            | \$12.00            |
| gemini-3.5-flash                     | \$1.50            | \$9.00             |
| models/gemini-3.5-flash              | \$1.50            | \$9.00             |
| gemini-2.5-pro                       | \$1.25            | \$10.00            |
| models/gemini-2.5-pro                | \$1.25            | \$10.00            |
| gemini-3-flash-preview               | \$0.50            | \$3.00             |
| models/gemini-3-flash-preview        | \$0.50            | \$3.00             |
| gemini-2.5-flash                     | \$0.30            | \$2.50             |
| models/gemini-2.5-flash              | \$0.30            | \$2.50             |
| gemini-3.1-flash-lite                | \$0.25            | \$1.50             |
| models/gemini-3.1-flash-lite         | \$0.25            | \$1.50             |
| gemini-3.1-flash-lite-preview        | \$0.25            | \$1.50             |
| models/gemini-3.1-flash-lite-preview | \$0.25            | \$1.50             |
| gemini-2.5-flash-lite                | \$0.10            | \$0.40             |
| models/gemini-2.5-flash-lite         | \$0.10            | \$0.40             |
| gemini-2.0-flash                     | \$0.10            | \$0.40             |
| models/gemini-2.0-flash              | \$0.10            | \$0.40             |

## Chat Completions (Gemini Native)

**Target URL:** `https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent`

|                  |                    |
| ---------------- | ------------------ |
| **Auth Header**  | `x-goog-api-key`   |
| **Content Type** | `application/json` |
| **Streaming**    | No                 |

| Model                                | Input / 1M tokens | Output / 1M tokens |
| ------------------------------------ | ----------------- | ------------------ |
| gemini-3.1-pro-preview               | \$2.00            | \$12.00            |
| models/gemini-3.1-pro-preview        | \$2.00            | \$12.00            |
| gemini-3.5-flash                     | \$1.50            | \$9.00             |
| models/gemini-3.5-flash              | \$1.50            | \$9.00             |
| gemini-2.5-pro                       | \$1.25            | \$10.00            |
| models/gemini-2.5-pro                | \$1.25            | \$10.00            |
| gemini-3-flash-preview               | \$0.50            | \$3.00             |
| models/gemini-3-flash-preview        | \$0.50            | \$3.00             |
| gemini-2.5-flash                     | \$0.30            | \$2.50             |
| models/gemini-2.5-flash              | \$0.30            | \$2.50             |
| gemini-3.1-flash-lite                | \$0.25            | \$1.50             |
| models/gemini-3.1-flash-lite         | \$0.25            | \$1.50             |
| gemini-3.1-flash-lite-preview        | \$0.25            | \$1.50             |
| models/gemini-3.1-flash-lite-preview | \$0.25            | \$1.50             |
| gemini-2.5-flash-lite                | \$0.10            | \$0.40             |
| models/gemini-2.5-flash-lite         | \$0.10            | \$0.40             |
| gemini-2.0-flash                     | \$0.10            | \$0.40             |
| models/gemini-2.0-flash              | \$0.10            | \$0.40             |

## Chat Completions (Gemini Streaming)

**Target URL:** `https://generativelanguage.googleapis.com/v1beta/models/{model}:streamGenerateContent`

|                  |                    |
| ---------------- | ------------------ |
| **Auth Header**  | `x-goog-api-key`   |
| **Content Type** | `application/json` |
| **Streaming**    | Always             |

| Model                                | Input / 1M tokens | Output / 1M tokens |
| ------------------------------------ | ----------------- | ------------------ |
| gemini-3.1-pro-preview               | \$2.00            | \$12.00            |
| models/gemini-3.1-pro-preview        | \$2.00            | \$12.00            |
| gemini-3.5-flash                     | \$1.50            | \$9.00             |
| models/gemini-3.5-flash              | \$1.50            | \$9.00             |
| gemini-2.5-pro                       | \$1.25            | \$10.00            |
| models/gemini-2.5-pro                | \$1.25            | \$10.00            |
| gemini-3-flash-preview               | \$0.50            | \$3.00             |
| models/gemini-3-flash-preview        | \$0.50            | \$3.00             |
| gemini-2.5-flash                     | \$0.30            | \$2.50             |
| models/gemini-2.5-flash              | \$0.30            | \$2.50             |
| gemini-3.1-flash-lite                | \$0.25            | \$1.50             |
| models/gemini-3.1-flash-lite         | \$0.25            | \$1.50             |
| gemini-3.1-flash-lite-preview        | \$0.25            | \$1.50             |
| models/gemini-3.1-flash-lite-preview | \$0.25            | \$1.50             |
| gemini-2.5-flash-lite                | \$0.10            | \$0.40             |
| models/gemini-2.5-flash-lite         | \$0.10            | \$0.40             |
| gemini-2.0-flash                     | \$0.10            | \$0.40             |
| models/gemini-2.0-flash              | \$0.10            | \$0.40             |

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
