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

# Google

> Integrate Google Gemini models through the Adaline Proxy for automatic telemetry and observability.

# Google

Integrate Google Gemini models through the Adaline Proxy to automatically capture telemetry — requests, responses, token usage, latency, and costs — with minimal code changes.

## Supported Models

**Chat Models**

| Model | Description |
| - | - |
| `gemini-3.1-pro-preview` | Latest Gemini 3.1 Pro preview |
| `gemini-3.1-pro-preview-customtools` | Gemini 3.1 Pro preview with custom tools |
| `gemini-3-pro-preview` | Gemini 3 Pro preview |
| `gemini-3-flash-preview` | Gemini 3 Flash preview |
| `gemini-2.5-pro` | Gemini 2.5 Pro |
| `gemini-2.5-pro-preview-03-25` | Gemini 2.5 Pro March 2025 preview |
| `gemini-2.5-flash` | Gemini 2.5 Flash |
| `gemini-2.5-flash-preview-04-17` | Gemini 2.5 Flash April 2025 preview |
| `gemini-2.5-flash-lite` | Lightweight Gemini 2.5 |
| `gemini-2.5-flash-lite-preview-09-2025` | Gemini 2.5 Flash Lite September 2025 preview |
| `gemini-2.0-flash` | Fast Gemini 2.0 model |
| `gemini-2.0-flash-lite` | Lightweight Gemini 2.0 |
| `gemini-1.5-pro` | Gemini 1.5 Pro, 1M token context |
| `gemini-1.5-pro-latest` | Gemini 1.5 Pro latest |
| `gemini-1.5-pro-002` | Gemini 1.5 Pro version 002 |
| `gemini-1.5-pro-001` | Gemini 1.5 Pro version 001 |
| `gemini-1.5-flash` | Gemini 1.5 Flash |
| `gemini-1.5-flash-latest` | Gemini 1.5 Flash latest |
| `gemini-1.5-flash-002` | Gemini 1.5 Flash version 002 |
| `gemini-1.5-flash-001` | Gemini 1.5 Flash version 001 |

**Embedding Models**

| Model | Description |
| - | - |
| `text-embedding-004` | Latest text embedding model |
| `text-embedding-001` | Legacy embedding model |

## Proxy Base URL

```
https://gateway.adaline.ai/v1/google
```

## Prerequisites

1. A [Google AI API key](https://aistudio.google.com/app/apikey)
2. An [Adaline API key](https://www.adaline.ai/docs/admin/create-api-keys.md), project ID, and prompt ID

## Chat Completions

### Complete Chat

```python Python theme={null}
from google import genai
from google.genai import types

client = genai.Client(
    http_options={
        "base_url": "https://gateway.adaline.ai/v1/google",
        "headers": {
            "adaline-api-key": "your-adaline-api-key",
            "adaline-project-id": "your-project-id",
            "adaline-prompt-id": "your-prompt-id",
        },
    },
    api_key="your-google-api-key",
)

response = client.models.generate_content(
    model="gemini-1.5-pro",
    contents="What is the future of artificial intelligence?",
    config=types.GenerateContentConfig(
        http_options=types.HttpOptions(
            headers={
                "adaline-trace-name": "google-chat-completion"  # Optional
            }
        )
    )
)

print(response.text)
```

> [!NOTE]
>
> Google's SDK uses `http_options` for base URL and headers, rather than `base_url` and `extra_headers` like OpenAI-compatible SDKs.

### Stream Chat

```python Python theme={null}
from google import genai
from google.genai import types

client = genai.Client(
    http_options={
        "base_url": "https://gateway.adaline.ai/v1/google",
        "headers": {
            "adaline-api-key": "your-adaline-api-key",
            "adaline-project-id": "your-project-id",
            "adaline-prompt-id": "your-prompt-id",
        },
    },
    api_key="your-google-api-key",
)

stream = client.models.generate_content_stream(
    model="gemini-1.5-pro",
    contents="Explain the concept of machine learning in detail.",
    config=types.GenerateContentConfig(
        http_options=types.HttpOptions(
            headers={
                "adaline-trace-name": "google-stream-chat"  # Optional
            }
        )
    )
)

for chunk in stream:
    if hasattr(chunk, 'text') and chunk.text:
        print(chunk.text, end="")
```

## Embeddings

```python Python theme={null}
from google import genai
from google.genai import types

client = genai.Client(
    http_options={
        "base_url": "https://gateway.adaline.ai/v1/google",
        "headers": {
            "adaline-api-key": "your-adaline-api-key",
            "adaline-project-id": "your-project-id",
            "adaline-prompt-id": "your-prompt-id",
        },
    },
    api_key="your-google-api-key",
)

response = client.models.embed_content(
    model="text-embedding-004",
    contents="The quick brown fox jumps over the lazy dog",
    config=types.EmbedContentConfig(
        http_options=types.HttpOptions(
            headers={
                "adaline-trace-name": "google-embedding"  # Optional
            }
        )
    )
)
```

## Next Steps

* [Multi-Step Workflows](https://www.adaline.ai/docs/integrations/examples/multi-step-workflows.md) — RAG pipelines, multi-step generation, and conversational agents
* [Headers Reference](https://www.adaline.ai/docs/reference/proxy/headers.md) — Complete header documentation

***

> [card] [Back to Integrations](https://www.adaline.ai/docs/integrations/introduction.md)
>
> Browse all integrations


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